alert
alert copied to clipboard
osx-notifier isn't working
I've tried to show alert using sox-notifier
and got this error:
Debugger entered--Lisp error: (file-error "Searching for program" "no such file or directory" "osascript -e 'display notification \"test\" with title \".emacs\"'") call-process("osascript -e 'display notification \"test\" with title \".emacs\"'") apply(call-process "osascript -e 'display notification \"test\" with title \".emacs\"'") alert-osx-notifier-notify((:message "test" :title ".emacs" :icon nil :severity normal :category nil :buffer #<buffer .emacs> :mode emacs-lisp-mode :data nil)) alert-send-notification(#<buffer .emacs> (:message "test" :title ".emacs" :icon nil :severity normal :category nil :buffer #<buffer .emacs> :mode emacs-lisp-mode :data nil) (:title "Notify using native OSX notification" :notifier alert-osx-notifier-notify)) alert("test") eval((alert "test") nil) eval-last-sexp-1(nil) eval-last-sexp(nil) call-interactively(eval-last-sexp nil nil) command-execute(eval-last-seep)
I've fixed it with
defun alert-osx-notifier-notify (info)
(apply #'call-process "osascript" nil nil nil "-e" (list (format "display notification %S with title %S"
(alert-encode-string (plist-get info :message))
(alert-encode-string (plist-get info :title)))))
(alert-message-notify info))
but I'm new to emacs and ELisp and I'm not sure that it's a right way to go. Would you like to get a PR?
I'm seeing the same failure - @kardapoltsev's code seems to fix it. I'm also an emacs noob, but maybe call-process has changed in functionality across emacs versions? I'm on (emacs-version)
GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.4.0, NS appkit-1404.41 Version 10.11.4 (Build 15E27e)) of 2016-01-31
I'm also seeing a similar one. Redefining the defun like suggested does seem to fix it.
alert-osx-notifier-notify: Wrong type argument: listp, "osascript -e 'display notification "org-plus-contrib :home:" with title "org"'"
+1 seeing the same thing. Patch seems to work for me.
Hi guys. It is 2017 already and this issue is still exists... @jwiegley will you accept PR with the fix described by @kardapoltsev? Can we send it? thanks.
Sure, it's small enough not to need papers.
Thank you. I sent pull request which is actually copy of @kardapoltsev fix described above. Hope he is not mind 😊
With #45 merged, can this now be closed?