From 0e3f8e89a4bf1fb7a4f41c8f95bb91978fa88eb9 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Wed, 15 Feb 2012 09:03:39 +0000 Subject: [PATCH] [RFC PATCH v5 11/11] emacs: show: recognize the exclude flag. --- 4c/1d2126b0f953eb695e477d9f5b828955b3413b | 114 ++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 4c/1d2126b0f953eb695e477d9f5b828955b3413b diff --git a/4c/1d2126b0f953eb695e477d9f5b828955b3413b b/4c/1d2126b0f953eb695e477d9f5b828955b3413b new file mode 100644 index 000000000..a12900c5b --- /dev/null +++ b/4c/1d2126b0f953eb695e477d9f5b828955b3413b @@ -0,0 +1,114 @@ +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 A5077421192 + for ; Wed, 15 Feb 2012 01:03:51 -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 xehkJ7nAqChw for ; + Wed, 15 Feb 2012 01:03:50 -0800 (PST) +Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com + [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 72E4C41ED8A for ; Wed, 15 Feb 2012 01:03:21 -0800 + (PST) +Received: by mail-ww0-f45.google.com with SMTP id dt12so647956wgb.2 + for ; Wed, 15 Feb 2012 01:03:21 -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=OX+sI66hnqkk2247rAaBhFDlVOrYRKw0X8MjApEnOCazhl9jZEbBcD4QlwlyU/0JwF + 32APfFqFwXGkh+nQSvm9Un09Yo8vPofWoFVieB2YtUlgG0Vj+3sTfCQszJNNWHiANowd + fJuTqlgtgBo5E5c+RrtswKIOhj2nCtrLs6YBw= +Received: by 10.180.86.9 with SMTP id l9mr34218882wiz.15.1329296601195; + Wed, 15 Feb 2012 01:03:21 -0800 (PST) +Received: from localhost (94-192-233-223.zone6.bethere.co.uk. + [94.192.233.223]) by mx.google.com with ESMTPS id + da8sm32097210wib.6.2012.02.15.01.03.19 (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 15 Feb 2012 01:03:20 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [RFC PATCH v5 11/11] emacs: show: recognize the exclude flag. +Date: Wed, 15 Feb 2012 09:03:39 +0000 +Message-Id: <1329296619-7463-12-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.2.3 +In-Reply-To: <1329296619-7463-1-git-send-email-markwalters1009@gmail.com> +References: <1329296619-7463-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: Wed, 15 Feb 2012 09:03:52 -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 + -- 2.26.2