emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] make org-notify support for macOS desktop notification


From: Maxim Nikulin
Subject: Re: [PATCH] make org-notify support for macOS desktop notification
Date: Tue, 6 Jul 2021 19:13:42 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 06/07/2021 08:45, stardiviner wrote:
Here is the new patch which invokes notifications though Emacs built-in API 
`ns-do-applescript`.
I suspect, you considered your original patch as small and simple, 
didn't you?
+          (format "display notification \"%s\" with title \"Org mode 
notification\""
+                  (replace-regexp-in-string "\"" "#" notification))))
Last character of notification might be "\" so it might escape the 
closing quote. Some less common quote character like "ยด" may be less 
confusing than "#" in this confusing if proper escaping is a challenge. 
I am unsure how many people are still using 8-bit charsets.
It seems there is no way to pass argv through `ns-do-applescript'. Is 
there at least a helper to escape strings similar to 
`shell-quote-argument'? Otherwise it is not friendly to developers since 
everyone has to do it himself.
On 06/07/2021 07:06, Tim Cross wrote:
I suspect that any code
which 'encourages' the use of melpa packages will not be acceptabl
If there are license problems with `osx-lib-notify2', I expect, it can be utilized through `org-show-notification-handler'. However users have to manually add such customization that is not really convenient.
If `org-show-notification' depends on runtime configuration (whether 
DBus socket is available), maybe it is reasonable to rewrite the 
function and to add a convention that e.g. 'default return value causes 
attempt to call next handler in the responsibility chain. The intention 
is to allow fallback from `org-show-notification-handler' to standard 
notifiers or graceful degradation from `notifications-notify' to 
`message' if dbus connection is not available (e.g. Emacs is running in 
a minimal container). Such changes however out of scope of this patch.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]