When I start emacs in terminal, the notifier style works well. If I start emacs in gui mode, it fails.
这是我第一个觉得奇怪的点。
Run describe variable in GUI mode, the output looks like this:
alert-notifier-command is a variable defined in ‘alert.el’. Its value is nil Original value was “/usr/local/bin/terminal-notifier”
This variable may be risky if used as a file-local variable.
Documentation: Path to the terminal-notifier command. From GitHub - julienXX/terminal-notifier: Send User Notifications on macOS from the command-line..
You can customize this variable.
Additional info:
(executable-find "terminal-notifier")
;; output is /usr/local/bin/terminal-notifier
I’m pretty sure that I have not set alert-notifier-command
variable manually, and no package set it
这是我第二个觉得奇怪的点:alert-noitifier-command 变量的值为啥会变呢?
~/.emacs.d/elpa > ag 'alert-notifier-command'
alert-20180827.422/alert.el
837:(defcustom alert-notifier-command (executable-find "terminal-notifier")
851: (if alert-notifier-command
856: (apply #'call-process alert-notifier-command nil nil nil args))
~/.emacs.d/elpa > cat ~/.emacs | grep "alert-notifier-command"
Version:
- My OS is macOS 10.13.4.
- Emacs Version is 26.1.1
- alert version is alert-20180827.422
我在 GitHub 上也提了 issue,但是想想这里或许可以更快的获得解答,所以在这里也提个问。
更新 (18-10-09 22:54):
- 问题一,为啥 GUI 不能 work:exec-path 不对,导致 GUI 模式下不能正确执行,解决办法见讨论
- 问题二,为啥 Emacs 说 original value 是 xxx:因为 describle variable 的实现是 eval 一下定义语句。
- 问题三:为啥当时 Terminal 模式可以?暂时未解决