[PATCH 4/5] Set higher priority for headers and hidden citation overlays.
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Wed, 25 May 2011 22:10:15 +0000 (02:10 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:21 +0000 (09:38 -0800)
d3/46d888d4498d74f1ff329993e2aa4fc4961664 [new file with mode: 0644]

diff --git a/d3/46d888d4498d74f1ff329993e2aa4fc4961664 b/d3/46d888d4498d74f1ff329993e2aa4fc4961664
new file mode 100644 (file)
index 0000000..45aa473
--- /dev/null
@@ -0,0 +1,108 @@
+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 7201E429E50\r
+       for <notmuch@notmuchmail.org>; Wed, 25 May 2011 15:10:25 -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 bKf9xc6RwFsO for <notmuch@notmuchmail.org>;\r
+       Wed, 25 May 2011 15:10:23 -0700 (PDT)\r
+Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com\r
+       [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id E7B0A429E47\r
+       for <notmuch@notmuchmail.org>; Wed, 25 May 2011 15:10:19 -0700 (PDT)\r
+Received: by mail-fx0-f53.google.com with SMTP id 8so217139fxm.26\r
+       for <notmuch@notmuchmail.org>; Wed, 25 May 2011 15:10:19 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer\r
+       :in-reply-to:references;\r
+       bh=SUqsr2PZ54+4OFQA4U0jC9+4gUE7loqubWtdQ9cJ3hI=;\r
+       b=wgFXpPyw2wFDROL8qSRKUSh/WGX4rMzAu+3U6Nwc9SRbx1CKlOfXtXIPriYu1RNJB6\r
+       QI9iZXHXptka41JNHr/GD4aJf7oCLcj+9HoBWgX1zVF5KulE1VEwov0LaF3F/5qj+Jhd\r
+       oO5nxsmsEYFGQujFujYKe1ThjZdaskxGvmRF8=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       b=ikaN+pHXEvX3l4zuUV5zCiwhWzJX3rnE0sm9uvxJw6Vx8iRbJLjbSPuv14qHycnPSK\r
+       VvOGFNj1krfeGI3IkTBB3PP0HpNVUmmIGCRMeLb4PtQMwUcJcFWFlBia5PPlhlR/RDkN\r
+       cPAbBK0yq79YezPxYg1DCfhKG0Shryka2pTbg=\r
+Received: by 10.223.25.201 with SMTP id a9mr90080fac.141.1306361419625;\r
+       Wed, 25 May 2011 15:10:19 -0700 (PDT)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id g8sm31681fai.44.2011.05.25.15.10.18\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Wed, 25 May 2011 15:10:19 -0700 (PDT)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 4/5] Set higher priority for headers and hidden citation\r
+       overlays.\r
+Date: Thu, 26 May 2011 02:10:15 +0400\r
+Message-Id: <1306361416-5019-5-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-Mailer: git-send-email 1.7.5.1\r
+In-Reply-To: <1306361416-5019-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1306361416-5019-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, 25 May 2011 22:10:25 -0000\r
+\r
+Before the patch, message, headers and hidden citation overlays\r
+had zero priority.  All these overlay have `invisible' property.\r
+Emacs documentation says that we should not make assumptions\r
+about which overlay will prevail when they have the same priority\r
+[1].  It happens to work as we need, but we should not rely on\r
+undocumented behavior.\r
+\r
+[1] http://www.gnu.org/s/emacs/manual/html_node/elisp/Overlay-Properties.html\r
+---\r
+ emacs/notmuch-show.el |    4 +++-\r
+ emacs/notmuch-wash.el |    1 +\r
+ 2 files changed, 4 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 34c0b79..e1846bc 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -733,7 +733,9 @@ current buffer, if possible."\r
+     ;; message.\r
+     (put-text-property message-start message-end :notmuch-message-extent (cons message-start message-end))\r
\r
+-    (overlay-put (make-overlay headers-start headers-end) 'invisible headers-invis-spec)\r
++    (let ((headers-overlay (make-overlay headers-start headers-end)))\r
++      (overlay-put headers-overlay 'invisible headers-invis-spec)\r
++      (overlay-put headers-overlay 'priority 10))\r
+     (overlay-put (make-overlay body-start body-end) 'invisible message-invis-spec)\r
\r
+     ;; Save the properties for this message. Currently this saves the\r
+diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el\r
+index bd521ba..992fa8f 100644\r
+--- a/emacs/notmuch-wash.el\r
++++ b/emacs/notmuch-wash.el\r
+@@ -139,6 +139,7 @@ insert before the button, probably for indentation."\r
+     (add-to-invisibility-spec invis-spec)\r
+     (overlay-put overlay 'invisible (list invis-spec message-invis-spec))\r
+     (overlay-put overlay 'isearch-open-invisible #'notmuch-wash-region-isearch-show)\r
++    (overlay-put overlay 'priority 10)\r
+     (overlay-put overlay 'type type)\r
+     (goto-char (1+ end))\r
+     (save-excursion\r
+-- \r
+1.7.5.1\r
+\r