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 DCF14431FBF for ; Sat, 25 Feb 2012 19:17:55 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.201 X-Spam-Level: X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=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 jz145VHHhhoQ for ; Sat, 25 Feb 2012 19:17:55 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 4B4FA431FAE for ; Sat, 25 Feb 2012 19:17:55 -0800 (PST) Received: by werp13 with SMTP id p13so2550292wer.26 for ; Sat, 25 Feb 2012 19:17:54 -0800 (PST) Received-SPF: pass (google.com: domain of markwalters1009@gmail.com designates 10.180.101.200 as permitted sender) client-ip=10.180.101.200; Authentication-Results: mr.google.com; spf=pass (google.com: domain of markwalters1009@gmail.com designates 10.180.101.200 as permitted sender) smtp.mail=markwalters1009@gmail.com; dkim=pass header.i=markwalters1009@gmail.com Received: from mr.google.com ([10.180.101.200]) by 10.180.101.200 with SMTP id fi8mr16926240wib.20.1330226274182 (num_hops = 1); Sat, 25 Feb 2012 19:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=y8Cn2mSbzbMeIcOfFPJoIgXa1ASnjb9usGZdKfkhBvo=; b=tHR+E+8Ys+JVjnAcOL7P+yJwn1frL4UL5aJANQE05jtsqoA9R2lz45i+OJyxgw/io7 h/Oy5VkR5Stp8Vimi9OEUucIEm7EpgNtOmXppjwsIXjYHFILyWYw/IPthH2EjX4FOszR kDkLO9XfO0Y71I5UKEGD00/hcJBi+pN8PlKNw= Received: by 10.180.101.200 with SMTP id fi8mr9156976wib.20.1330157154032; Sat, 25 Feb 2012 00:05:54 -0800 (PST) Received: from localhost (94-192-233-223.zone6.bethere.co.uk. [94.192.233.223]) by mx.google.com with ESMTPS id m16sm20600151wie.9.2012.02.25.00.05.52 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 25 Feb 2012 00:05:53 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org, Austin Clements Subject: [Patch v6 12/13] emacs: show: recognize the exclude flag. Date: Sat, 25 Feb 2012 08:06:43 +0000 Message-Id: <1330157204-26094-13-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1330157204-26094-1-git-send-email-markwalters1009@gmail.com> References: <1330157204-26094-1-git-send-email-markwalters1009@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: Sun, 26 Feb 2012 03:17:56 -0000 Show mode will recognize the exclude flag by not opening excluding messages by default, and will start at the first matching non-excluded message. If there are no matching non-excluded messages it will go to the first matching (necessarily excluded) message. --- emacs/notmuch-show.el | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index aa9ccee..96b0c71 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -948,7 +948,8 @@ current buffer, if possible." ;; Message visibility depends on whether it matched the search ;; criteria. - (notmuch-show-message-visible msg (plist-get msg :match)))) + (notmuch-show-message-visible msg (and (plist-get msg :match) + (not (plist-get msg :excluded)))))) (defun notmuch-show-toggle-process-crypto () "Toggle the processing of cryptographic MIME parts." @@ -1079,6 +1080,10 @@ function is used." ;; Move straight to the first open message (unless (notmuch-show-message-visible-p) (notmuch-show-next-open-message)) + (when (eobp) + (goto-char (point-min)) + (unless (notmuch-show-get-prop :match) + (notmuch-show-next-matching-message))) ;; Set the header line to the subject of the first open message. (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject))) @@ -1557,6 +1562,18 @@ to show, nil otherwise." (goto-char (point-max)))) r)) +(defun notmuch-show-next-matching-message () + "Show the next matching message." + (interactive) + (let (r) + (while (and (setq r (notmuch-show-goto-message-next)) + (not (notmuch-show-get-prop :match)))) + (if r + (progn + (notmuch-show-mark-read) + (notmuch-show-message-adjust)) + (goto-char (point-max))))) + (defun notmuch-show-previous-open-message () "Show the previous open message." (interactive) -- 1.7.2.3