From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/82173 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.gnus.general Subject: Re: Username for gnus-notifications Date: Thu, 30 Aug 2012 15:10:11 +0200 Message-ID: <873934wmoc.fsf@thinkpad.tsdh.de> References: <87a9xcyk00.fsf@thinkpad.tsdh.de> <878vcwri8g.fsf@dex.adm.naquadah.org> <873934yiml.fsf@thinkpad.tsdh.de> <874nnkredw.fsf@dex.adm.naquadah.org> <87oblswz56.fsf@thinkpad.tsdh.de> <87y5kw63v1.fsf@micropit.couberia.bzh> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1346332305 3263 80.91.229.3 (30 Aug 2012 13:11:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Aug 2012 13:11:45 +0000 (UTC) Cc: ding@gnus.org To: Peter =?utf-8?Q?M=C3=BCnster?= Original-X-From: ding-owner+M30441@lists.math.uh.edu Thu Aug 30 15:11:45 2012 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T74XA-0000Js-3W for ding-account@gmane.org; Thu, 30 Aug 2012 15:11:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1T74Vs-0005l4-Do; Thu, 30 Aug 2012 08:10:24 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1T74Vq-0005kk-9m for ding@lists.math.uh.edu; Thu, 30 Aug 2012 08:10:22 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1T74Vo-0004qM-O9 for ding@lists.math.uh.edu; Thu, 30 Aug 2012 08:10:21 -0500 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1T74Vn-0006XC-4w for ding@gnus.org; Thu, 30 Aug 2012 15:10:19 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id D723DD2341; Thu, 30 Aug 2012 15:10:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at uni-koblenz.de Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QHb-9mmWdxb8; Thu, 30 Aug 2012 15:10:14 +0200 (CEST) X-CHKRCPT: Envelopesender noch tsdh@gnu.org Original-Received: from thinkpad.tsdh.de (tsdh.uni-koblenz.de [141.26.67.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id CC366D233C; Thu, 30 Aug 2012 15:10:14 +0200 (CEST) In-Reply-To: <87y5kw63v1.fsf@micropit.couberia.bzh> ("Peter \=\?utf-8\?Q\?M\?\= \=\?utf-8\?Q\?\=C3\=BCnster\=22's\?\= message of "Thu, 30 Aug 2012 13:01:06 +0200") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux) X-Spam-Score: -4.9 (----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:82173 Archived-At: Peter M=C3=BCnster writes: Hi Peter, >> For example, it seems feasible to use :actions and :on-action to >> display the mail in Gnus when I click the notification. > > Yes, that works quite well. Here the function, that I use: > > (defun pm/gnus (&optional id key) > "Switch to group buffer, or start gnus if it does not exist." > (interactive) > (when (or (not key) (string=3D key "email")) > (if (get-buffer "*Group*") > (progn (switch-to-buffer "*Group*") (gnus-group-get-new-news)) > (gnus)) > (if (display-graphic-p) > (x-focus-frame nil)))) > > [...] > (notifications-notify :title "New Email!" :timeout (* 60 1000) > :actions '("email" "read email") :on-action= 'pm/gnus) > [...] But that just switches to Gnus, it doesn't show you the exact mail that was advertised in the notification. Basically, I'd like to click the notification Peter M=C3=BCnster Re: Username for gnus-notifications and Gnus opens my ding nnimap group, shows a summary of all new mail in there, and selects your message. I think, it should be doable by also ripping out the Message-Id and group in addition to From/Subject from new messages. Then you know what group a summary should be opened for, and you can use `gnus-summary-refer-article' to the select the right one. Bye, Tassilo