Hi,
Two patches to gnus-notification that should apply against master. I'm
sending them here since apparently gmane.emacs.gnus.general is down or
something. I hope somebody will apply them nonetheless.
1. Raise frame when clicking read.
2. Allow to mark as read from notification, e.g. for notification ("your
order has shipped")
My paperwork is sorted out.
—Rasmus
--
Slowly unravels in a ball of yarn and the devil collects it
>From b567a21d3039be1f1c82f35057543440ba074760 Mon Sep 17 00:00:00 2001
From: rasmus <[email protected]>
Date: Sat, 7 Mar 2015 18:10:03 +0100
Subject: [PATCH 1/2] gnus-notifications: Raise frame when clicking Read
* gnus-notifications.el (gnus-notifications-action): Raise window
frame.
---
lisp/ChangeLog | 5 +++++
lisp/gnus-notifications.el | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2047481..b6526b7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-07 Rasmus Pank Roulund <[email protected]>
+
+ * gnus-notifications.el (gnus-notifications-action): Raise window
+ frame.
+
2015-02-26 Katsumi Yamaoka <[email protected]>
* gnus-art.el (gnus-mime-inline-part, gnus-mm-display-part):
diff --git a/lisp/gnus-notifications.el b/lisp/gnus-notifications.el
index 2941cc4..1ed344e 100644
--- a/lisp/gnus-notifications.el
+++ b/lisp/gnus-notifications.el
@@ -80,7 +80,8 @@ not get notifications."
(when group-article
(let ((group (cadr group-article))
(article (nth 2 group-article)))
- (gnus-fetch-group group (list article)))))))
+ (gnus-fetch-group group (list article))
+ (when (window-system) (x-focus-frame (selected-frame))))))))
(defun gnus-notifications-notify (from subject photo-file)
"Send a notification about a new mail.
--
2.3.1
>From f73b285a33d40cd217bc45861d9308f831ffd0c3 Mon Sep 17 00:00:00 2001
From: rasmus <[email protected]>
Date: Sat, 7 Mar 2015 18:12:41 +0100
Subject: [PATCH 2/2] gnus-notification.el: Add mark as read
* gnus-notifications.el (gnus-notifications-action): Allow mark as read.
(gnus-notifications-notify): Show uption to mark as read.
---
lisp/ChangeLog | 2 ++
lisp/gnus-notifications.el | 22 ++++++++++++++--------
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b6526b7..072c6fc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,8 @@
* gnus-notifications.el (gnus-notifications-action): Raise window
frame.
+ (gnus-notifications-action): Allow mark as read.
+ (gnus-notifications-notify): Show uption to mark as read.
2015-02-26 Katsumi Yamaoka <[email protected]>
diff --git a/lisp/gnus-notifications.el b/lisp/gnus-notifications.el
index 1ed344e..7f8fd9e 100644
--- a/lisp/gnus-notifications.el
+++ b/lisp/gnus-notifications.el
@@ -75,13 +75,19 @@ not get notifications."
"Map notifications ids to messages.")
(defun gnus-notifications-action (id key)
- (when (string= key "read")
- (let ((group-article (assoc id gnus-notifications-id-to-msg)))
- (when group-article
- (let ((group (cadr group-article))
- (article (nth 2 group-article)))
- (gnus-fetch-group group (list article))
- (when (window-system) (x-focus-frame (selected-frame))))))))
+ (let ((group-article (assoc id gnus-notifications-id-to-msg)))
+ (when group-article
+ (let ((group (cadr group-article))
+ (article (nth 2 group-article)))
+ (cond ((string= key "read")
+ (gnus-fetch-group group (list article))
+ (when (window-system) (x-focus-frame (selected-frame))))
+ ((string= key "mark-read")
+ (gnus-update-read-articles
+ group
+ (delq article (gnus-list-of-unread-articles group)))
+ ;; gnus-group-refresh-group
+ (gnus-group-update-group group)))))))
(defun gnus-notifications-notify (from subject photo-file)
"Send a notification about a new mail.
@@ -91,7 +97,7 @@ Return a notification id if any, or t on success."
'notifications-notify
:title from
:body subject
- :actions '("read" "Read")
+ :actions '("read" "Read" "mark-read" "Mark As Read")
:on-action 'gnus-notifications-action
:app-icon (gnus-funcall-no-warning
'image-search-load-path "gnus/gnus.png")
--
2.3.1
_______________________________________________
info-gnus-english mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/info-gnus-english