From: Dmitry Kurochkin Date: Sat, 28 Jan 2012 05:59:08 +0000 (+0400) Subject: [PATCH 9/6] emacs: code cleanup in `notmuch-show-operate-all', no functional changes X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=07b47da7e1115d31dc3a11fa541fde94d94a1612;p=notmuch-archives.git [PATCH 9/6] emacs: code cleanup in `notmuch-show-operate-all', no functional changes --- diff --git a/b6/e20028111319b1b77eadb9220d4662039665d5 b/b6/e20028111319b1b77eadb9220d4662039665d5 new file mode 100644 index 000000000..096268412 --- /dev/null +++ b/b6/e20028111319b1b77eadb9220d4662039665d5 @@ -0,0 +1,92 @@ +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 24A3E431FB6 + for ; Fri, 27 Jan 2012 22:00:19 -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 ck-Mwd-8Nh-R for ; + Fri, 27 Jan 2012 22:00:18 -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 85339431FAE + for ; Fri, 27 Jan 2012 22:00:18 -0800 (PST) +Received: by mail-bk0-f53.google.com with SMTP id zt19so2289195bkb.26 + for ; Fri, 27 Jan 2012 22:00:18 -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=PJUXLhd/PXeraR1lX38LfmoWiUEZ3H85TNL7oh8WeFU=; + b=RlGZF/JBmPhjpwrs23uraXMd3CONZlD5EEluYd2T0FELm7pEoyPQi60Af9t40o+YaP + ENqb8PtOiq1ngGCLM6gB2lugLJBJZwg1rCe6zIIMEHGm98wZDRQfE7lCtRkUnkQOqjnf + mmY8qbOR16wpAz9eKW1yHcP26usbz0Qmc6JH4= +Received: by 10.205.127.141 with SMTP id ha13mr4670529bkc.28.1327730418130; + Fri, 27 Jan 2012 22:00:18 -0800 (PST) +Received: from localhost ([91.144.186.21]) + by mx.google.com with ESMTPS id ew13sm21197973bkb.1.2012.01.27.22.00.17 + (version=TLSv1/SSLv3 cipher=OTHER); + Fri, 27 Jan 2012 22:00:17 -0800 (PST) +From: Dmitry Kurochkin +To: notmuch@notmuchmail.org +Subject: [PATCH 9/6] emacs: code cleanup in `notmuch-show-operate-all', + no functional changes +Date: Sat, 28 Jan 2012 09:59:08 +0400 +Message-Id: <1327730348-6466-2-git-send-email-dmitry.kurochkin@gmail.com> +X-Mailer: git-send-email 1.7.8.3 +In-Reply-To: <1327730348-6466-1-git-send-email-dmitry.kurochkin@gmail.com> +References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com> + <1327730348-6466-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 06:00:19 -0000 + +Use `notmuch-show-mapc' function instead of a custom `loop'. +--- + emacs/notmuch-show.el | 13 ++++++------- + 1 files changed, 6 insertions(+), 7 deletions(-) + +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index e606224..4ec3fce 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -1518,13 +1518,12 @@ i.e. a list of tags to change with '+' and '-' prefixes." + 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-get-messages-ids-search) 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)))) ++ (notmuch-show-mapc ++ (lambda () ++ (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)))))) + + (defun notmuch-show-add-tag () + "Same as `notmuch-show-tag' but sets initial input to '+'." +-- +1.7.8.3 +