[PATCH 4/5] Set higher priority for headers and hidden citation overlays.

Dmitry Kurochkin dmitry.kurochkin at gmail.com
Wed May 25 15:10:15 PDT 2011


Before the patch, message, headers and hidden citation overlays
had zero priority.  All these overlay have `invisible' property.
Emacs documentation says that we should not make assumptions
about which overlay will prevail when they have the same priority
[1].  It happens to work as we need, but we should not rely on
undocumented behavior.

[1] http://www.gnu.org/s/emacs/manual/html_node/elisp/Overlay-Properties.html
---
 emacs/notmuch-show.el |    4 +++-
 emacs/notmuch-wash.el |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 34c0b79..e1846bc 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -733,7 +733,9 @@ current buffer, if possible."
     ;; message.
     (put-text-property message-start message-end :notmuch-message-extent (cons message-start message-end))
 
-    (overlay-put (make-overlay headers-start headers-end) 'invisible headers-invis-spec)
+    (let ((headers-overlay (make-overlay headers-start headers-end)))
+      (overlay-put headers-overlay 'invisible headers-invis-spec)
+      (overlay-put headers-overlay 'priority 10))
     (overlay-put (make-overlay body-start body-end) 'invisible message-invis-spec)
 
     ;; Save the properties for this message. Currently this saves the
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index bd521ba..992fa8f 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -139,6 +139,7 @@ insert before the button, probably for indentation."
     (add-to-invisibility-spec invis-spec)
     (overlay-put overlay 'invisible (list invis-spec message-invis-spec))
     (overlay-put overlay 'isearch-open-invisible #'notmuch-wash-region-isearch-show)
+    (overlay-put overlay 'priority 10)
     (overlay-put overlay 'type type)
     (goto-char (1+ end))
     (save-excursion
-- 
1.7.5.1



More information about the notmuch mailing list