[Top][All Lists]

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

[elpa] master 8cd3279: [el-search] Small fix in occur filter-buffer-subs

From: Michael Heerdegen
Subject: [elpa] master 8cd3279: [el-search] Small fix in occur filter-buffer-substring-function
Date: Sat, 4 May 2019 13:36:09 -0400 (EDT)

branch: master
commit 8cd3279b930004a8518a806f08f9df5c60f9be11
Author: Michael Heerdegen <address@hidden>
Commit: Michael Heerdegen <address@hidden>

    [el-search] Small fix in occur filter-buffer-substring-function
    * packages/el-search/el-search.el (el-search--occur): Use dedicated
    text property to mark headlines in *El Occur*.
    (el-search-occur-filter-buffer-substring): Use it to check whether the
    substring includes any headline instead of 'outline-regexp' based
 packages/el-search/el-search.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el
index 6e7f891..f49e945 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/el-search.el
@@ -3524,6 +3524,7 @@ Prompt for a new pattern and revert."
 (defvar el-search-occur-match-ov-prop 'el-occur-match-data)
+(defvar el-search-occur-headline-prop 'el-search-occur-headline)
 (defun el-search-occur-jump-to-match ()
@@ -3713,9 +3714,7 @@ When nil, all such treatment is disabled."
 (defun el-search-occur-filter-buffer-substring (beg end &optional delete)
   (if (or delete
           (not el-search-occur-match-markers)
-          (not (save-excursion
-                 (goto-char beg)
-                 (search-forward-regexp outline-regexp end t))))
+          (eq end (next-single-char-property-change beg 
el-search-occur-headline-prop nil end)))
       (buffer-substring--filter beg end delete)
     (let ((contents '())
@@ -3868,8 +3867,9 @@ addition from `special-mode-map':
                       (insert "\n\n;;; *** ")
                        (or file (format "%S" buffer))
-                       'action (lambda (_) (el-search--occur-button-action
-                                            (or get-buffer file buffer))))
+                       'action
+                       (lambda (_) (el-search--occur-button-action (or 
get-buffer file buffer)))
+                       el-search-occur-headline-prop t)
                       (insert (format "  (%d match%s)\n"
                                       (if (> buffer-matches 1) "es" "")))

reply via email to

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