changeset 74669:900d63313056

(outline-isearch-open-invisible-function): New defvar. (outline-flag-region): Use it if non-nil for isearch-open-invisible overlay property instead of outline-isearch-open-invisible.
author Kim F. Storm <storm@cua.dk>
date Sun, 17 Dec 2006 00:48:26 +0000
parents deefd1777d72
children 0d3e2195ab9b
files lisp/outline.el
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/outline.el	Sun Dec 17 00:48:14 2006 +0000
+++ b/lisp/outline.el	Sun Dec 17 00:48:26 2006 +0000
@@ -690,6 +690,11 @@
     (goto-char beg)))
 
 
+(defvar outline-isearch-open-invisible-function nil
+  "Function called if `isearch' finishes in an invisible overlay.
+The function is called with the overlay as its only argument.
+If nil, `show-entry' is called to reveal the invisible text.")
+
 (put 'outline 'reveal-toggle-invisible 'outline-reveal-toggle-invisible)
 (defun outline-flag-region (from to flag)
   "Hide or show lines from FROM to TO, according to FLAG.
@@ -698,7 +703,9 @@
   (when flag
     (let ((o (make-overlay from to)))
       (overlay-put o 'invisible 'outline)
-      (overlay-put o 'isearch-open-invisible 'outline-isearch-open-invisible)))
+      (overlay-put o 'isearch-open-invisible
+		   (or outline-isearch-open-invisible-function
+		       'outline-isearch-open-invisible))))
   ;; Seems only used by lazy-lock.  I.e. obsolete.
   (run-hooks 'outline-view-change-hook))