From: Olivier Berger Date: Tue, 6 May 2014 12:17:00 +0000 (+0200) Subject: Improving spam-tagging keybinding function to act on region in emacs X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2639755f2e65155efccca3054fe4da7f09a680d0;p=notmuch-archives.git Improving spam-tagging keybinding function to act on region in emacs --- diff --git a/3d/5ed7afdeb9e9d31dab33adc8ecdc42f10600f2 b/3d/5ed7afdeb9e9d31dab33adc8ecdc42f10600f2 new file mode 100644 index 000000000..8071acbec --- /dev/null +++ b/3d/5ed7afdeb9e9d31dab33adc8ecdc42f10600f2 @@ -0,0 +1,89 @@ +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 1C0E8431FDF + for ; Tue, 6 May 2014 05:23:01 -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 2Q5nap38Cf4x for ; + Tue, 6 May 2014 05:22:53 -0700 (PDT) +X-Greylist: delayed 343 seconds by postgrey-1.32 at olra; + Tue, 06 May 2014 05:22:53 PDT +Received: from zproxy120.enst.fr (zproxy120.enst.fr [137.194.52.34]) + by olra.theworths.org (Postfix) with ESMTP id 76381431FD6 + for ; Tue, 6 May 2014 05:22:53 -0700 (PDT) +Received: from localhost (localhost [127.0.0.1]) + by zproxy120.enst.fr (Postfix) with ESMTP id 8ABAC112F3C + for ; Tue, 6 May 2014 14:17:06 +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 10024) + with ESMTP id vqgvqbRybU17 for ; + Tue, 6 May 2014 14:17:02 +0200 (CEST) +Received: from localhost (bauxite.int-evry.fr [157.159.110.64]) + by zproxy120.enst.fr (Postfix) with ESMTPSA id 6C768112F2D + for ; Tue, 6 May 2014 14:17:02 +0200 (CEST) +From: Olivier Berger +To: notmuch@notmuchmail.org +Subject: Improving spam-tagging keybinding function to act on region in emacs +User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Tue, 06 May 2014 14:17:00 +0200 +Message-ID: <87oazb9k5f.fsf@inf-8660.int-evry.fr> +MIME-Version: 1.0 +Content-Type: text/plain +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: Tue, 06 May 2014 12:23:01 -0000 + +Hi. + +I've tried tu use the tips indicated at +http://notmuchmail.org/emacstips/#index8h2 so as to add a keybinding to +tag spam messages, and wonder if there's a possibility to make it apply +on selected regions, like what notmuch-search-archive-thread does. + +I can achieve the same result using a macro to iterate over lines, but a +single key press to tag results of a search filter would be quite +convienent. + +And... at the moment, it seems to me that with the current suggested +lambdas, if one presses 'S' after selecting a whole region results in +tagging all sorts of messages (all ?) with the spam tag ! :-/ + + +Btw, I think that the current examples could be improved by adding a (next-line) +at the end, like : +(define-key notmuch-search-mode-map "S" + (lambda () + "mark messages in thread as spam" + (interactive) + (notmuch-search-tag '("+spam" "-inbox")) + (next-line))) + +Thanks in advance. + +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) +