--- /dev/null
+Return-Path: <olivier.berger@telecom-sudparis.eu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 0E412431FAF\r
+ for <notmuch@notmuchmail.org>; Wed, 7 May 2014 04:37:25 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id Cd9q6SOdRd80 for <notmuch@notmuchmail.org>;\r
+ Wed, 7 May 2014 04:37:18 -0700 (PDT)\r
+Received: from zproxy120.enst.fr (zproxy120.enst.fr [137.194.52.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 9183A431FAE\r
+ for <notmuch@notmuchmail.org>; Wed, 7 May 2014 04:37:18 -0700 (PDT)\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by zproxy120.enst.fr (Postfix) with ESMTP id 93F3A1134DE\r
+ for <notmuch@notmuchmail.org>; Wed, 7 May 2014 13:37:17 +0200 (CEST)\r
+X-Virus-Scanned: amavisd-new at zproxy120.enst.fr\r
+Received: from zproxy120.enst.fr ([127.0.0.1])\r
+ by localhost (zproxy120.enst.fr [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id Kye+ceGE79eY for <notmuch@notmuchmail.org>;\r
+ Wed, 7 May 2014 13:37:13 +0200 (CEST)\r
+Received: from localhost (bauxite.int-evry.fr [157.159.110.64])\r
+ by zproxy120.enst.fr (Postfix) with ESMTPSA id 384A01134A3\r
+ for <notmuch@notmuchmail.org>; Wed, 7 May 2014 13:37:13 +0200 (CEST)\r
+From: Olivier Berger <olivier.berger@telecom-sudparis.eu>\r
+To: notmuch@notmuchmail.org\r
+Subject: Re: Improving spam-tagging keybinding function to act on region in\r
+ emacs\r
+In-Reply-To: <87mweuzy87.fsf@qmul.ac.uk>\r
+References: <87oazb9k5f.fsf@inf-8660.int-evry.fr> <87mweuzy87.fsf@qmul.ac.uk>\r
+User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Wed, 07 May 2014 13:37:10 +0200\r
+Message-ID: <87bnv92521.fsf@inf-8660.int-evry.fr>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 07 May 2014 11:37:25 -0000\r
+\r
+Hi.\r
+\r
+Mark Walters <markwalters1009@gmail.com> writes:\r
+\r
+> Hello\r
+>\r
+> As this section was rather outdated I have updated to modern notmuch. (In\r
+> fact the lisp snippets should work back to at least 0.13)\r
+>\r
+> On Tue, 06 May 2014, Olivier Berger <olivier.berger@telecom-sudparis.eu> wrote:\r
+>> Hi.\r
+>>\r
+>> I've tried tu use the tips indicated at\r
+>> http://notmuchmail.org/emacstips/#index8h2 so as to add a keybinding to\r
+>> tag spam messages, and wonder if there's a possibility to make it apply\r
+>> on selected regions, like what notmuch-search-archive-thread does.\r
+>\r
+> I have added a snippet showing how to do this (and noted that is not\r
+> possible in notmuch-tree as we don't have a tag region option there).\r
+>\r
+\r
+Thanks. This works exactly I like it :-)\r
+\r
+>> Btw, I think that the current examples could be improved by adding a (next-line)\r
+>> at the end, like :\r
+>> (define-key notmuch-search-mode-map "S"\r
+>> (lambda ()\r
+>> "mark messages in thread as spam"\r
+>> (interactive)\r
+>> (notmuch-search-tag '("+spam" "-inbox"))\r
+>> (next-line)))\r
+>\r
+> I have left this as it is as this works in search mode, but not show\r
+> mode and I didn't want to have too many examples. Obviously feel free to\r
+> edit the wiki if you like!\r
+>\r
+\r
+Note that I'm now using the following :\r
+ (define-key notmuch-search-mode-map "S"\r
+ (lambda (&optional beg end)\r
+ "mark messages in thread as spam"\r
+ (interactive (notmuch-search-interactive-region))\r
+ (notmuch-search-tag '("+spam" "-inbox") beg end)\r
+ (if (eq beg end) (notmuch-search-next-thread))))\r
+\r
+This offers the possibility to jump to the next line when tagging\r
+individual lines, and not do so when acting on a region.\r
+\r
+Btw, such a difference in behaviour may be a tiny, but still nice\r
+improvement on the code of notmuch-search-archive-thread too.\r
+\r
+I haven't touched the wiki, as I'm not sure this is the best way to\r
+write it and everyone would be interested.\r
+\r
+Hope this helps.\r
+\r
+Best regards,\r
+\r
+-- \r
+Olivier BERGER \r
+http://www-public.telecom-sudparis.eu/~berger_o/ - OpenPGP-Id: 2048R/5819D7E8\r
+Ingenieur Recherche - Dept INF\r
+Institut Mines-Telecom, Telecom SudParis, Evry (France)\r