[PATCH] emacs: Fix i-search to open up invisible citations as necessary

David Edmondson dme at dme.org
Fri Apr 23 10:39:33 PDT 2010


Add an `isearch-open-invisible' property to the overlays used to hide
citations and signatures, together with an appropriate function to
leave the invisible text visible should that be required.
---
 emacs/notmuch-wash.el |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index fe33819..dd5d0a1 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -83,6 +83,9 @@ collapse the remaining lines into a button.")
   'help-echo "mouse-1, RET: Show signature"
   :supertype 'notmuch-wash-button-invisibility-toggle-type)
 
+(defun notmuch-wash-region-isearch-show (overlay)
+  (remove-from-invisibility-spec (overlay-get overlay 'invisible)))
+
 (defun notmuch-wash-region-to-button (beg end type prefix button-text)
   "Auxilary function to do the actual making of overlays and buttons
 
@@ -102,6 +105,7 @@ is what to put on the button."
 					  type "-toggle-type"))))
     (add-to-invisibility-spec invis-spec)
     (overlay-put overlay 'invisible invis-spec)
+    (overlay-put overlay 'isearch-open-invisible #'notmuch-wash-region-isearch-show)
     (goto-char (1+ end))
     (save-excursion
       (goto-char (1- beg))
-- 
1.7.0



More information about the notmuch mailing list