From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/17476 Path: news.gmane.org!not-for-mail From: Rasmus Newsgroups: gmane.emacs.gnus.user Subject: [patches] mark as read with gnus notification Date: Sat, 07 Mar 2015 18:21:00 +0100 Message-ID: <871tl0k9kz.fsf@gmx.us> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1425749129 15083 80.91.229.3 (7 Mar 2015 17:25:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Mar 2015 17:25:29 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Sat Mar 07 18:25:15 2015 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YUITT-0003vb-6I for gegu-info-gnus-english@m.gmane.org; Sat, 07 Mar 2015 18:25:15 +0100 Original-Received: from localhost ([::1]:35765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUITS-0002x3-Dg for gegu-info-gnus-english@m.gmane.org; Sat, 07 Mar 2015 12:25:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUITP-0002wh-OR for info-gnus-english@gnu.org; Sat, 07 Mar 2015 12:25:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUITJ-0002m1-Nm for info-gnus-english@gnu.org; Sat, 07 Mar 2015 12:25:11 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:54186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUITJ-0002jd-DU for info-gnus-english@gnu.org; Sat, 07 Mar 2015 12:25:05 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YUITI-0003lL-3d for info-gnus-english@gnu.org; Sat, 07 Mar 2015 18:25:04 +0100 Original-Received: from 102.201.133.37.dynamic.jazztel.es ([37.133.201.102]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Mar 2015 18:25:04 +0100 Original-Received: from rasmus by 102.201.133.37.dynamic.jazztel.es with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Mar 2015 18:25:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 144 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 102.201.133.37.dynamic.jazztel.es Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEUKFRJUbVlfi3YgQT2n 0Kvg/N5UophZjX8kV1c+lpjySPhsAAAACXBIWXMAAABIAAAASABGyWs+AAAB8ElEQVQ4y9VTwY7T QAydrDn02KiL6HGpirhOsJDCbQvJnV0yd5C6WfXIgWY50h5wj0ioyvwtz56kSKU/gKWm4/dsP4+d OJcsX8zcJbuuQ3N7Ac+qEELjLyQEtdt/amaVZoQGxzf4//CXgIQSU5fVoarDqWa2hMBVCDeoeeOy cDcS+bKaOvc23GXhHu7zZiSK5Urzwv2z8BGHK6QNxML06qZOUBivVFyb/4AGpkaMfRW5+d9CnYh6 JLJEvEKnn9VtVgNBmRHr9UP4pOInwuU5HpN4bNtKB1TlY0aR47ISY9z8XumApgPumNmxxAOoummq RSK8Z+eZWHrgcV1V73MbFrH35JlLLRVju26/mARAoAlHqePm2L5MG2HgxCwHI2IfN33COcUroSbv NlKwV4KoBA6il74X5gMcnyqh0Mk0ez4DQcTWEmyvP+iV/dx73MAnDWBS7nH2/FMgohpDAiuc8r1e kU38IHuSJKgPI7T2D/RDqXUjCPgEeNdGsTg/kKzDkvm2fezF69C0y0SQ80W3ffwVD1KqJKVSrBfZ da93Ty++d0+mmGbK9pLIbJdLuYW+rUGTSjsJz2WWdd1XqGMQRNiPI0+8Rwx5vXZaqbWLALg8rMZW qo2hJ6cEpdDh5RiAyfm3h1iDsnOCxsxz3P2H9gdT4qxCIzJxIQAAACV0RVh0ZGF0ZTpjcmVhdGUA MjAxMS0wNy0yMVQxNzoyNDo1NSswMjowMFwRps8AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTEtMDct MjFUMTc6MjQ6NTUrMDI6MDAtTB5zAAAAAElFTkSuQmCC User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:p9ISvKWMJvcgfuPfnGwHqRbO+fY= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:17476 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-gnus-notifications-Raise-frame-when-clicking-Read.patch >From b567a21d3039be1f1c82f35057543440ba074760 Mon Sep 17 00:00:00 2001 From: rasmus 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 + + * gnus-notifications.el (gnus-notifications-action): Raise window + frame. + 2015-02-26 Katsumi Yamaoka * 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-gnus-notification.el-Add-mark-as-read.patch >From f73b285a33d40cd217bc45861d9308f831ffd0c3 Mon Sep 17 00:00:00 2001 From: rasmus 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 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 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline