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 375DA429E5F for ; Wed, 18 Jan 2012 00:07:07 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 yC51A6MziIm7 for ; Wed, 18 Jan 2012 00:07:06 -0800 (PST) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 64C94429E27 for ; Wed, 18 Jan 2012 00:07:06 -0800 (PST) Received: by wibhr12 with SMTP id hr12so4192303wib.26 for ; Wed, 18 Jan 2012 00:07:05 -0800 (PST) Received: by 10.180.106.130 with SMTP id gu2mr34552169wib.6.1326874025250; Wed, 18 Jan 2012 00:07:05 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id r1sm21063112wia.8.2012.01.18.00.07.03 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jan 2012 00:07:04 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id 17AB3A0397; Wed, 18 Jan 2012 08:07:02 +0000 (GMT) To: Jameson Graef Rollins , Notmuch Mail Subject: Re: [PATCH 1/6] emacs: break up notmuch-show-archive-thread-internal into two generally useful functions In-Reply-To: <1326823531-14549-1-git-send-email-jrollins@finestructure.net> References: <871uqy19yo.fsf@servo.finestructure.net> <1326823531-14549-1-git-send-email-jrollins@finestructure.net> User-Agent: Notmuch/0.11+64~g42e8f66 (http://notmuchmail.org) Emacs/24.0.92.1 (x86_64-pc-linux-gnu) From: David Edmondson Date: Wed, 18 Jan 2012 08:06:58 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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: Wed, 18 Jan 2012 08:07:07 -0000 --=-=-= Content-Type: text/plain Very happy with the overall ideas. On Tue, 17 Jan 2012 10:05:26 -0800, Jameson Graef Rollins wrote: > -(defun notmuch-show-archive-thread-internal (show-next) > - ;; Remove the tag from the current set of messages. > +(defun notmuch-show-tag-thread-internal (tag &optional remove) > + ;; Add tag to the current set of messages. If the remove switch is > + ;; given, tags will be removed instead of added. > (goto-char (point-min)) > - (loop do (notmuch-show-remove-tag "inbox") > - until (not (notmuch-show-goto-message-next))) > - ;; Move to the next item in the search results, if any. > + (let ((tag-function 'notmuch-show-add-tag)) > + (if remove > + (setq tag-function 'notmuch-show-remove-tag)) This seems odd. How about: (let ((tag-function (if remove 'notmuch-show-remove-tag 'notmuch-show-add-tag))) ... > + (loop do (funcall tag-function tag) > + until (not (notmuch-show-goto-message-next))))) Otherwise good. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk8WfaIACgkQaezQq/BJZRY0YQCeMjm077EtqDUSByF/NmkMPSFs yXQAmQH9R9iB2bV4S8STnd8z985P9qDk =puTL -----END PGP SIGNATURE----- --=-=-=--