diff options
| author | Rasmus Pank Roulund | 2015-03-08 10:10:37 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2015-03-08 10:10:37 +0000 |
| commit | 08534cef42568878d03ba116288b9ccbc43984b4 (patch) | |
| tree | f5199aeb7c22ae70215830d0e98c1b5b477b547d | |
| parent | 0f2fd5603a06982ef057f0a8bc12e76bc8e026a3 (diff) | |
| download | emacs-08534cef42568878d03ba116288b9ccbc43984b4.tar.gz emacs-08534cef42568878d03ba116288b9ccbc43984b4.zip | |
lisp/gnus/gnus-notifications: Raise frame when clicking Read; Add mark as read
| -rw-r--r-- | lisp/gnus/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/gnus/gnus-notifications.el | 21 |
2 files changed, 21 insertions, 7 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 2ee0c56c7f5..763267c3413 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2015-03-08 Rasmus Pank Roulund <rasmus@pank.eu> | ||
| 2 | |||
| 3 | * gnus-notifications.el (gnus-notifications-action): Raise window | ||
| 4 | frame. | ||
| 5 | (gnus-notifications-action): Allow mark as read. | ||
| 6 | (gnus-notifications-notify): Show uption to mark as read. | ||
| 7 | |||
| 1 | 2015-03-08 Adam Sjøgren <asjo@koldfront.dk> | 8 | 2015-03-08 Adam Sjøgren <asjo@koldfront.dk> |
| 2 | 9 | ||
| 3 | * message.el (message-insert-formatted-citation-line): Change %F to | 10 | * message.el (message-insert-formatted-citation-line): Change %F to |
diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el index 2941cc46e4a..22dba3570a3 100644 --- a/lisp/gnus/gnus-notifications.el +++ b/lisp/gnus/gnus-notifications.el | |||
| @@ -75,12 +75,19 @@ not get notifications." | |||
| 75 | "Map notifications ids to messages.") | 75 | "Map notifications ids to messages.") |
| 76 | 76 | ||
| 77 | (defun gnus-notifications-action (id key) | 77 | (defun gnus-notifications-action (id key) |
| 78 | (when (string= key "read") | 78 | (let ((group-article (assoc id gnus-notifications-id-to-msg))) |
| 79 | (let ((group-article (assoc id gnus-notifications-id-to-msg))) | 79 | (when group-article |
| 80 | (when group-article | 80 | (let ((group (cadr group-article)) |
| 81 | (let ((group (cadr group-article)) | 81 | (article (nth 2 group-article))) |
| 82 | (article (nth 2 group-article))) | 82 | (cond ((string= key "read") |
| 83 | (gnus-fetch-group group (list article))))))) | 83 | (gnus-fetch-group group (list article)) |
| 84 | (when (and window-system (fboundp 'x-focus-frame)) (x-focus-frame (selected-frame)))) | ||
| 85 | ((string= key "mark-read") | ||
| 86 | (gnus-update-read-articles | ||
| 87 | group | ||
| 88 | (delq article (gnus-list-of-unread-articles group))) | ||
| 89 | ;; gnus-group-refresh-group | ||
| 90 | (gnus-group-update-group group))))))) | ||
| 84 | 91 | ||
| 85 | (defun gnus-notifications-notify (from subject photo-file) | 92 | (defun gnus-notifications-notify (from subject photo-file) |
| 86 | "Send a notification about a new mail. | 93 | "Send a notification about a new mail. |
| @@ -90,7 +97,7 @@ Return a notification id if any, or t on success." | |||
| 90 | 'notifications-notify | 97 | 'notifications-notify |
| 91 | :title from | 98 | :title from |
| 92 | :body subject | 99 | :body subject |
| 93 | :actions '("read" "Read") | 100 | :actions '("read" "Read" "mark-read" "Mark As Read") |
| 94 | :on-action 'gnus-notifications-action | 101 | :on-action 'gnus-notifications-action |
| 95 | :app-icon (gnus-funcall-no-warning | 102 | :app-icon (gnus-funcall-no-warning |
| 96 | 'image-search-load-path "gnus/gnus.png") | 103 | 'image-search-load-path "gnus/gnus.png") |