From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 6BCA7431FBC for ; Fri, 27 Jan 2012 20:42:51 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 F14em3RUWNTE for ; Fri, 27 Jan 2012 20:42:49 -0800 (PST) Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 30849431FD2 for ; Fri, 27 Jan 2012 20:42:40 -0800 (PST) Received: by mail-bk0-f53.google.com with SMTP id zt19so2255515bkb.26 for ; Fri, 27 Jan 2012 20:42:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; bh=yl7aFDnK+K1NlXaiWVuzmUQ6o/aIJyXl6ul29D4daAc=; b=gFpvR2a7W3TsQohI37ka8nImaL0sQref+jvErRKyB187Enw0B3S0cDkPLaZUzsa+aj 8amOo7QEp9Pzph2CPQXW9HStN7NeC0hmYY5VVfzRAIvCiTIgobYRwis9PitTMFNmc0g/ upDT9YaW1nIZuHU1TB0A44cUTRrRWfew5Mj5c= Received: by 10.204.154.140 with SMTP id o12mr4416125bkw.102.1327725759902; Fri, 27 Jan 2012 20:42:39 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id cz3sm20740671bkb.3.2012.01.27.20.42.39 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jan 2012 20:42:39 -0800 (PST) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH 5/6] emacs: add "*" binding for notmuch-show view Date: Sat, 28 Jan 2012 08:41:23 +0400 Message-Id: <1327725684-5887-5-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com> References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com> 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: Sat, 28 Jan 2012 04:42:52 -0000 The patch adds `notmuch-show-operate-all' function bound to "*" in notmuch-show view. The function is similar to the `notmuch-search-operate-all' function for the notmuch-search view: it changes tags for all messages in the current thread. --- emacs/notmuch-show.el | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 03eadfb..2ca4d92 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1073,6 +1073,7 @@ thread id. If a prefix is given, crypto processing is toggled." (define-key map "c" 'notmuch-show-stash-map) (define-key map "=" 'notmuch-show-refresh-view) (define-key map "h" 'notmuch-show-toggle-headers) + (define-key map "*" 'notmuch-show-operate-all) (define-key map "-" 'notmuch-show-remove-tag) (define-key map "+" 'notmuch-show-add-tag) (define-key map "x" 'notmuch-show-archive-thread-then-exit) @@ -1489,6 +1490,21 @@ i.e. a list of tags to change with '+' and '-' prefixes." initial-input (notmuch-show-get-message-id)))) (apply 'notmuch-show-tag-message changed-tags))) +(defun notmuch-show-operate-all (&rest changed-tags) + "Change tags for all messages in the current thread. + +`Changed-tags' is a list of tag operations for \"notmuch tag\", +i.e. a list of tags to change with '+' and '-' prefixes." + (interactive (notmuch-select-tags-with-completion nil notmuch-show-thread-id)) + (apply 'notmuch-tag notmuch-show-thread-id changed-tags) + (save-excursion + (goto-char (point-min)) + (loop do (let* ((current-tags (notmuch-show-get-tags)) + (new-tags (notmuch-update-tags current-tags changed-tags))) + (unless (equal current-tags new-tags) + (notmuch-show-set-tags new-tags))) + while (notmuch-show-goto-message-next)))) + (defun notmuch-show-add-tag () "Same as `notmuch-show-tag' but sets initial input to '+'." (interactive) -- 1.7.8.3