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 6712C431FBC for ; Sun, 29 Jan 2012 18:28:31 -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 dVjGTspmTiKS for ; Sun, 29 Jan 2012 18:28:30 -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 DCA1C421184 for ; Sun, 29 Jan 2012 18:27:56 -0800 (PST) Received: by mail-bk0-f53.google.com with SMTP id 11so960274bke.26 for ; Sun, 29 Jan 2012 18:27:56 -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=yhE5OyCdGaZS5A8LnhnUswrEXllCVTPuBrlU+A3W4as=; b=k5GSfSa4jMR6RG2Vat7m93Z2PFmvbQxfKK//R3GTPmtE3wj/3g1++O6QBITR7g9QWr YSp0tNo1cDvZA0c5t5cIiKKo+KO6bBtmmWfp4pxahAGzkoWs/WQ69bUTNSTBYMUj/Yk6 KE8ILJobisEC1rE70IimKop3GX5C4TqHV4dds= Received: by 10.204.152.219 with SMTP id h27mr7639917bkw.40.1327890476653; Sun, 29 Jan 2012 18:27:56 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id ci12sm34228847bkb.13.2012.01.29.18.27.55 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 Jan 2012 18:27:56 -0800 (PST) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH v2 11/13] emacs: code cleanup in `notmuch-show-operate-all', no functional changes Date: Mon, 30 Jan 2012 06:26:20 +0400 Message-Id: <1327890382-548-12-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1327890382-548-1-git-send-email-dmitry.kurochkin@gmail.com> References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com> <1327890382-548-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: Mon, 30 Jan 2012 02:28:31 -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 b115a8f..69381ac 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1516,13 +1516,12 @@ TAG-CHANGES is a list of tag operations for `notmuch-tag'." TAG-CHANGES is a list of tag operations for `notmuch-tag'." (interactive (notmuch-read-tag-changes nil notmuch-show-thread-id)) (apply 'notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes) - (save-excursion - (goto-char (point-min)) - (loop do (let* ((current-tags (notmuch-show-get-tags)) - (new-tags (notmuch-update-tags current-tags tag-changes))) - (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 tag-changes))) + (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