1 Return-Path: <tom.hirschowitz@univ-savoie.fr>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 7F57E431FBD
\r
6 for <notmuch@notmuchmail.org>; Thu, 5 Jun 2014 02:58:58 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 21LqtV-zjHh2 for <notmuch@notmuchmail.org>;
\r
16 Thu, 5 Jun 2014 02:58:52 -0700 (PDT)
\r
17 X-Greylist: delayed 378 seconds by postgrey-1.32 at olra;
\r
18 Thu, 05 Jun 2014 02:58:52 PDT
\r
19 Received: from dsi-mta-out.univ-savoie.fr (dsi-mta-out.univ-savoie.fr
\r
21 by olra.theworths.org (Postfix) with ESMTP id 73380431FBC
\r
22 for <notmuch@notmuchmail.org>; Thu, 5 Jun 2014 02:58:52 -0700 (PDT)
\r
23 Received: from localhost (localhost [127.0.0.1])
\r
24 by dsi-mta-out.univ-savoie.fr (Postfix) with ESMTP id E5AF0422A2
\r
25 for <notmuch@notmuchmail.org>; Thu, 5 Jun 2014 11:52:32 +0200 (CEST)
\r
26 Received: from dsi-mta-out.univ-savoie.fr ([127.0.0.1])
\r
27 by localhost (dsi-mta-out.univ-savoie.fr [127.0.0.1]) (amavisd-new,
\r
28 port 10026) with ESMTP id KnSPTAk0dvdc for <notmuch@notmuchmail.org>;
\r
29 Thu, 5 Jun 2014 11:52:32 +0200 (CEST)
\r
30 Received: from dsi-mail-msa1.univ-savoie.fr (dsi-mail-msa1.univ-savoie.fr
\r
32 by dsi-mta-out.univ-savoie.fr (Postfix) with ESMTP id CE9F6422A1
\r
33 for <notmuch@notmuchmail.org>; Thu, 5 Jun 2014 11:52:32 +0200 (CEST)
\r
34 Received: from localhost (localhost [127.0.0.1])
\r
35 by dsi-mail-msa1.univ-savoie.fr (Postfix) with ESMTP id CC68E14093
\r
36 for <notmuch@notmuchmail.org>; Thu, 5 Jun 2014 11:52:32 +0200 (CEST)
\r
37 X-Virus-Scanned: Debian amavisd-new at dsi-mail-msa1.univ-savoie.fr
\r
38 Received: from dsi-mail-msa1.univ-savoie.fr ([127.0.0.1])
\r
39 by localhost (dsi-mail-msa1.univ-savoie.fr [127.0.0.1]) (amavisd-new,
\r
40 port 10024) with ESMTP id JtjGUMP2xbrP for <notmuch@notmuchmail.org>;
\r
41 Thu, 5 Jun 2014 11:52:32 +0200 (CEST)
\r
42 Received: from hirscho.lama.univ-savoie.fr (lama-d186.univ-savoie.fr
\r
44 by dsi-mail-msa1.univ-savoie.fr (Postfix) with ESMTP id B271914080
\r
45 for <notmuch@notmuchmail.org>; Thu, 5 Jun 2014 11:52:32 +0200 (CEST)
\r
46 From: Tom Hirschowitz <tom.hirschowitz@univ-savoie.fr>
\r
47 To: notmuch@notmuchmail.org
\r
49 Subject: an emacs macro
\r
50 User-Agent: Notmuch/0.18 (http://notmuchmail.org) Emacs/23.4.1
\r
51 (x86_64-pc-linux-gnu)
\r
52 Date: Thu, 05 Jun 2014 11:52:32 +0200
\r
53 Message-ID: <87bnu7k7j3.fsf@hirscho.lama.univ-savoie.fr>
\r
55 Content-Type: text/plain; charset=us-ascii
\r
56 X-BeenThere: notmuch@notmuchmail.org
\r
57 X-Mailman-Version: 2.1.13
\r
59 List-Id: "Use and development of the notmuch mail system."
\r
60 <notmuch.notmuchmail.org>
\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
64 List-Post: <mailto:notmuch@notmuchmail.org>
\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
68 X-List-Received-Date: Thu, 05 Jun 2014 09:58:58 -0000
\r
73 I'm trying to define a macro for notmuch/emacs which in show-mode would
\r
75 - prompt the user for tags (possibly starting with "+"),
\r
77 - tag the shown message with these tags plus an additional fixed tag,
\r
80 I know next to nothing about emacs/lisp, so I tried to mimick notmuch*.el.
\r
82 Here's my most plausible attempt:
\r
84 (defun notmuch-show-move (tag-changes)
\r
85 "Add the local tag, plus possibly others, given as interactive arguments."
\r
86 (interactive (list (notmuch-read-tag-changes (notmuch-show-get-tags)
\r
87 "Tag message" "+")))
\r
88 (let* ((tag-changes-with-local (cons "+local" tag-changes))
\r
89 (rien (notmuch-tag (notmuch-show-get-message-id) tag-changes-with-local))
\r
90 (current-tags (notmuch-show-get-tags))
\r
91 (new-tags (notmuch-update-tags current-tags tag-changes-with-local)))
\r
92 (unless (equal current-tags new-tags)
\r
93 (notmuch-show-set-tags new-tags))))
\r
95 (define-key notmuch-show-mode-map (kbd "M") 'notmuch-show-move)
\r
96 (define-key notmuch-search-mode-map (kbd "M") 'notmuch-show-move)
\r
98 This seems to work in show-mode, but not in search-mode.
\r
99 I'd be grateful for any hint on doing this in tree- and search-modes
\r
100 (and possibly explanations on why the current version does not work).
\r