emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jay Kamat <jaygkamat@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [PATCH] Allow :urgency flags for org-notify
Date: Sat, 13 Jan 2018 19:13:40 -0500	[thread overview]
Message-ID: <87mv1h1emj.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 624 bytes --]

Hi,

I recently began using the org-notify package, and I would like to pass
the :urgency flag to `notifications-notify' occasionally. This small
patch passes the :urgency key from the org-notify configuration on to
`notitifications-notify'.

For example, after this patch, you can:

(org-notify-add 'test-notifications
'(:time "10m" :period "1m" :actions -notify/window :urgency critical))

And get notifications labeled as critical in that way.

Eventually, I would like to write an alert
(https://github.com/jwiegley/alert) backend for org-notify, would that
be suitable for inclusion in the core package?

Thanks,
-Jay


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Respect-urgency-tags-for-org-notify-windows.patch --]
[-- Type: text/x-diff, Size: 1009 bytes --]

From dc8d8917720985e7006e75100ccc9f32c0e27b06 Mon Sep 17 00:00:00 2001
From: Jay Kamat <jaygkamat@gmail.com>
Date: Sat, 13 Jan 2018 19:03:07 -0500
Subject: [PATCH] Respect :urgency tags for org-notify windows

* contrib/lisp/org-notify.el (org-notify-action-notify): pass :urgency
  to notifications-notify.
---
 contrib/lisp/org-notify.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/lisp/org-notify.el b/contrib/lisp/org-notify.el
index 5f64d3162b..96e7d4ee27 100644
--- a/contrib/lisp/org-notify.el
+++ b/contrib/lisp/org-notify.el
@@ -373,6 +373,7 @@ org-notify window.  Mostly copied from `appt-select-lowest-window'."
               :title     (plist-get plist :heading)
               :body      (org-notify-body-text plist)
               :timeout   (if duration (* duration 1000))
+              :urgency   (plist-get plist :urgency)
               :actions   org-notify-actions
               :on-action 'org-notify-on-action-notify)))
     (setq org-notify-on-action-map
-- 
2.11.0


             reply	other threads:[~2018-01-14  0:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-14  0:13 Jay Kamat [this message]
2018-01-15 15:26 ` [PATCH] Allow :urgency flags for org-notify Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mv1h1emj.fsf@gmail.com \
    --to=jaygkamat@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).