emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 6cd7c6fb1c: org-fold-core: Improve integration with


From: ELPA Syncer
Subject: [elpa] externals/org 6cd7c6fb1c: org-fold-core: Improve integration with isearch API
Date: Sat, 13 Aug 2022 20:57:46 -0400 (EDT)

branch: externals/org
commit 6cd7c6fb1cf6363f1057086760bed9875cdd97c7
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    org-fold-core: Improve integration with isearch API
    
    * lisp/org-fold-core.el (org-fold-core--isearch-show):
    (org-fold-core--isearch-show-temporary): Allow REGION argument to be
    overlay.
    
    Fixes 
https://orgmode.org/list/62f834ed.050a0220.afd79.0022SMTPIN_ADDED_BROKEN@mx.google.com
---
 lisp/org-fold-core.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/org-fold-core.el b/lisp/org-fold-core.el
index 93cbdb9fb6..da465fe1d7 100644
--- a/lisp/org-fold-core.el
+++ b/lisp/org-fold-core.el
@@ -1150,7 +1150,11 @@ This function is intended to be used as 
`isearch-filter-predicate'."
   (clrhash org-fold-core--isearch-local-regions))
 
 (defun org-fold-core--isearch-show (region)
-  "Reveal text in REGION found by isearch."
+  "Reveal text in REGION found by isearch.
+REGION can also be an overlay in current buffer."
+  (when (overlayp region)
+    (setq region (cons (overlay-start region)
+                       (overlay-end region))))
   (org-with-point-at (car region)
     (while (< (point) (cdr region))
       (funcall org-fold-core-isearch-open-function (car region))
@@ -1158,7 +1162,11 @@ This function is intended to be used as 
`isearch-filter-predicate'."
 
 (defun org-fold-core--isearch-show-temporary (region hide-p)
   "Temporarily reveal text in REGION.
-Hide text instead if HIDE-P is non-nil."
+Hide text instead if HIDE-P is non-nil.
+REGION can also be an overlay in current buffer."
+  (when (overlayp region)
+    (setq region (cons (overlay-start region)
+                       (overlay-end region))))
   (if (not hide-p)
       (let ((pos (car region)))
        (while (< pos (cdr region))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]