Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes a few changes, somewhat independent, but all related:
auto-dark-allow-osascript
to true1;osascript
on-demand if neitherns-do-applescript
normac-do-applescript
is available2; andosascript
as a separateauto-dark-detection-method
3.These can be easily separated depending on which, if any, you think are improvements.
Footnotes
I don’t know why this is even a variable. If it’s not allowed, then there is no way to use Auto-Dark on systems that require it, and the failure mode is opaque (“Could not determine a viable theme detection mechanism!”). There’s probably something I’m overlooking, but if so, it should be documented. ↩
If this change isn’t made, then the error message “Try setting
auto-dark-allow-osascript
to t” doesn’t make sense, as it’s only reported in a location where the value ofauto-dark-allow-osascript
has no effect. The alternative is to change the error message to something like “auto-dark-detection-method
indicates that this Emacs build has AppleScript support, but none could be found. Either rebuild Emacs with AppleScript support or change the detection method and setauto-dark-allow-osascript
”. ↩With Simplify AppleScript handling #59, the two
fboundp
checks added before falling back toosascript
should be more than outweighed by the removal of shell invocation. ↩