]> git.notmuchmail.org Git - notmuch/commitdiff
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)
committerCarl Worth <cworth@cworth.org>
Wed, 15 Jun 2011 14:07:32 +0000 (07:07 -0700)
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
emacs/notmuch-wash.el

index 5436b3419f8f37ab199b4e01387be8df171fb821..a49bbd3de32fb4bb28e36295073131a2cffbdd08 100644 (file)
@@ -753,7 +753,9 @@ current buffer, if possible."
     ;; message.
     (put-text-property message-start message-end :notmuch-message-extent (cons message-start message-end))
 
     ;; 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
     (overlay-put (make-overlay body-start body-end) 'invisible message-invis-spec)
 
     ;; Save the properties for this message. Currently this saves the
index 8607fb006e1a42729ed669b346732b9e19499ec7..92f07c5000751fb394d45c26cb2593902e594e6b 100644 (file)
@@ -156,6 +156,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)
     (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
     (overlay-put overlay 'type type)
     (goto-char (1+ end))
     (save-excursion