From 8486e99366a496ebf1903ff853ea713fb0e65083 Mon Sep 17 00:00:00 2001 From: Olivier Berger Date: Thu, 22 May 2014 10:59:07 +0200 Subject: [PATCH] Re: Improving spam-tagging keybinding function to act on region in emacs --- 21/15b354e81d93d5221fd3faf001f6baa2e0710d | 98 +++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 21/15b354e81d93d5221fd3faf001f6baa2e0710d diff --git a/21/15b354e81d93d5221fd3faf001f6baa2e0710d b/21/15b354e81d93d5221fd3faf001f6baa2e0710d new file mode 100644 index 000000000..d6417cc70 --- /dev/null +++ b/21/15b354e81d93d5221fd3faf001f6baa2e0710d @@ -0,0 +1,98 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 122C3431FBC + for ; Thu, 22 May 2014 01:59:23 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id sKd-mh42etNI for ; + Thu, 22 May 2014 01:59:17 -0700 (PDT) +Received: from zproxy120.enst.fr (zproxy120.enst.fr [137.194.52.34]) + by olra.theworths.org (Postfix) with ESMTP id 74A3C431FAE + for ; Thu, 22 May 2014 01:59:17 -0700 (PDT) +Received: from localhost (localhost [127.0.0.1]) + by zproxy120.enst.fr (Postfix) with ESMTP id 7FE5610055A; + Thu, 22 May 2014 10:59:13 +0200 (CEST) +Received: from zproxy120.enst.fr ([127.0.0.1]) + by localhost (zproxy120.enst.fr [127.0.0.1]) (amavisd-new, port 10032) + with ESMTP id 1VN9HJkofbls; Thu, 22 May 2014 10:59:09 +0200 (CEST) +Received: from localhost (localhost [127.0.0.1]) + by zproxy120.enst.fr (Postfix) with ESMTP id 5324D100544; + Thu, 22 May 2014 10:59:09 +0200 (CEST) +X-Virus-Scanned: amavisd-new at zproxy120.enst.fr +Received: from zproxy120.enst.fr ([127.0.0.1]) + by localhost (zproxy120.enst.fr [127.0.0.1]) (amavisd-new, port 10026) + with ESMTP id IMcP7Vl-UEVM; Thu, 22 May 2014 10:59:09 +0200 (CEST) +Received: from localhost (bauxite.int-evry.fr [157.159.110.64]) + by zproxy120.enst.fr (Postfix) with ESMTPSA id 2B2E2100541; + Thu, 22 May 2014 10:59:09 +0200 (CEST) +From: Olivier Berger +To: Mark Walters +Subject: Re: Improving spam-tagging keybinding function to act on region in + emacs +In-Reply-To: <87wqde6xup.fsf@qmul.ac.uk> +References: <87oazb9k5f.fsf@inf-8660.int-evry.fr> <87mweuzy87.fsf@qmul.ac.uk> + <87bnv92521.fsf@inf-8660.int-evry.fr> <87wqde6xup.fsf@qmul.ac.uk> +User-Agent: Notmuch/0.18 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Thu, 22 May 2014 10:59:07 +0200 +Message-ID: <87wqdechpg.fsf@inf-8660.int-evry.fr> +MIME-Version: 1.0 +Content-Type: text/plain +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 22 May 2014 08:59:23 -0000 + +Mark Walters writes: + +> On Wed, 07 May 2014, Olivier Berger wrote: +>>> +>> +>> Note that I'm now using the following : +>> (define-key notmuch-search-mode-map "S" +>> (lambda (&optional beg end) +>> "mark messages in thread as spam" +>> (interactive (notmuch-search-interactive-region)) +>> (notmuch-search-tag '("+spam" "-inbox") beg end) +>> (if (eq beg end) (notmuch-search-next-thread)))) +>> +>> This offers the possibility to jump to the next line when tagging +>> individual lines, and not do so when acting on a region. +>> +>> Btw, such a difference in behaviour may be a tiny, but still nice +>> improvement on the code of notmuch-search-archive-thread too. +> +> I think this is worth doing: do you want to send a patch? The above lisp +> is fine but I would replace the "if" by "when". (The main difference is +> that "when" cannot take an else clause so using when flags up that there +> is not an else clause.) +> +> If the above is inconvenient then I am happy to post such a patch. +> + +AFAI'm concerned, feel free to do so ;) + +Best regards, +-- +Olivier BERGER +http://www-public.telecom-sudparis.eu/~berger_o/ - OpenPGP-Id: 2048R/5819D7E8 +Ingenieur Recherche - Dept INF +Institut Mines-Telecom, Telecom SudParis, Evry (France) -- 2.26.2