[PATCH 4/6] emacs: improve hidden signatures handling in notmuch-show-advance-and...
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Wed, 29 Jun 2011 19:42:36 +0000 (23:42 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:49 +0000 (09:38 -0800)
d1/8ad00f66e7458c2f495948a0376885b4d7a8e9 [new file with mode: 0644]

diff --git a/d1/8ad00f66e7458c2f495948a0376885b4d7a8e9 b/d1/8ad00f66e7458c2f495948a0376885b4d7a8e9
new file mode 100644 (file)
index 0000000..338512c
--- /dev/null
@@ -0,0 +1,101 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id EE11B41ED6A\r
+       for <notmuch@notmuchmail.org>; Wed, 29 Jun 2011 12:42:57 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id J8gEkwBJ9Xds for <notmuch@notmuchmail.org>;\r
+       Wed, 29 Jun 2011 12:42:57 -0700 (PDT)\r
+Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 1260141ED66\r
+       for <notmuch@notmuchmail.org>; Wed, 29 Jun 2011 12:42:55 -0700 (PDT)\r
+Received: by mail-bw0-f53.google.com with SMTP id 12so1456477bwg.26\r
+       for <notmuch@notmuchmail.org>; Wed, 29 Jun 2011 12:42:55 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=zrHA+ifthfgHP+Ej3ABOoqO+3pgC7SAtL5YSWWNUxmo=;\r
+       b=U1sEgesQUQKD0WqZ3mtHE+9cTh4PG6NgiLDyPEhj3JLkPMhYiRmKw3CkKt0eGppBhC\r
+       WGmukcQOU1InaTo2c6B8o8P9jj6RYsFc6AciZr0cRAiwaAoO80PdVKAi/0O5sqsI4Az3\r
+       kZnk9uII3nCj1Rx1r2sWRTnRMNbSDpC3zSAbU=\r
+Received: by 10.204.14.12 with SMTP id e12mr1045148bka.210.1309376575632;\r
+       Wed, 29 Jun 2011 12:42:55 -0700 (PDT)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id ek1sm1430878bkb.9.2011.06.29.12.42.54\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Wed, 29 Jun 2011 12:42:54 -0700 (PDT)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 4/6] emacs: improve hidden signatures handling in\r
+       notmuch-show-advance-and-archive\r
+Date: Wed, 29 Jun 2011 23:42:36 +0400\r
+Message-Id: <1309376558-26284-4-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 29 Jun 2011 19:42:58 -0000\r
+\r
+Use `previous-single-char-property-change' instead of going\r
+through each character by hand and testing it's visibility.  This\r
+fixes `notmuch-show-advance-and-archive' to work for the last\r
+message in thread with hidden signature.\r
+---\r
+ emacs/notmuch-show.el |   17 +++++++++--------\r
+ 1 files changed, 9 insertions(+), 8 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 6685717..ad3cc7b 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1113,17 +1113,18 @@ thread, (remove the \"inbox\" tag from each message). Also kill\r
+ this buffer, and display the next thread from the search from\r
+ which this thread was originally shown."\r
+   (interactive)\r
+-  (let ((end-of-this-message (notmuch-show-message-bottom)))\r
++  (let* ((end-of-this-message (notmuch-show-message-bottom))\r
++       (visible-end-of-this-message (1- end-of-this-message)))\r
++    (while (invisible-p visible-end-of-this-message)\r
++      (setq visible-end-of-this-message\r
++          (previous-single-char-property-change visible-end-of-this-message\r
++                                                'invisible)))\r
+     (cond\r
+      ;; Ideally we would test `end-of-this-message' against the result\r
+      ;; of `window-end', but that doesn't account for the fact that\r
+-     ;; the end of the message might be hidden, so we have to actually\r
+-     ;; go to the end, walk back over invisible text and then see if\r
+-     ;; point is visible.\r
+-     ((save-excursion\r
+-      (goto-char (- end-of-this-message 1))\r
+-      (notmuch-show-move-past-invisible-backward)\r
+-      (> (point) (window-end)))\r
++     ;; the end of the message might be hidden.\r
++     ((and visible-end-of-this-message\r
++         (> visible-end-of-this-message (window-end)))\r
+       ;; The bottom of this message is not visible - scroll.\r
+       (scroll-up nil))\r
\r
+-- \r
+1.7.5.4\r
+\r