Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osx-notifier isn't working #38

Open
kardapoltsev opened this issue May 14, 2016 · 7 comments
Open

osx-notifier isn't working #38

kardapoltsev opened this issue May 14, 2016 · 7 comments

Comments

@kardapoltsev
Copy link

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?

@bradleybuda
Copy link

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

@torgeir
Copy link

torgeir commented Oct 22, 2016

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"'"

@jojojames
Copy link

+1 seeing the same thing. Patch seems to work for me.

@krydos
Copy link
Contributor

krydos commented Jan 6, 2017

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.

@jwiegley
Copy link
Owner

jwiegley commented Jan 6, 2017

Sure, it's small enough not to need papers.

krydos added a commit to krydos/alert that referenced this issue Jan 6, 2017
@krydos
Copy link
Contributor

krydos commented Jan 6, 2017

Thank you. I sent pull request which is actually copy of @kardapoltsev fix described above. Hope he is not mind 😊

jwiegley added a commit that referenced this issue Jan 6, 2017
@Wilfred
Copy link

Wilfred commented Jun 11, 2018

With #45 merged, can this now be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants