emacs-diffs
[Top][All Lists]
Advanced

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

feature/fix-the-long-lines-display-bug 7b19ce51fc: Fix improvement of is


From: Gregory Heytings
Subject: feature/fix-the-long-lines-display-bug 7b19ce51fc: Fix improvement of isearch in auto-narrow-mode.
Date: Wed, 6 Jul 2022 12:06:09 -0400 (EDT)

branch: feature/fix-the-long-lines-display-bug
commit 7b19ce51fc3f6b39e40bd1510f46927c91b847ff
Author: Gregory Heytings <gregory@heytings.org>
Commit: Gregory Heytings <gregory@heytings.org>

    Fix improvement of isearch in auto-narrow-mode.
    
    * lisp/files.el (auto-narrow--reset-isearch-lazy-highlight): New internal
    function.
    (auto-narrow-pre-command-function, auto-narrow-post-command-function): Use 
the
    new internal function.
---
 lisp/files.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index 89c7334c5a..9d7273cb1c 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2729,6 +2729,11 @@ beginning and end of the buffer."
 (defvar-local auto-narrow--isearch-lazy-highlight nil
   "Internal variable used by `auto-narrow-mode'.")
 
+(defun auto-narrow--reset-isearch-lazy-highlight ()
+  "Internal function used by `auto-narrow-mode'."
+  (when auto-narrow-mode
+    (setq-local isearch-lazy-highlight auto-narrow--isearch-lazy-highlight)))
+
 (defvar-local auto-narrow--initialized nil
   "Internal variable used by `auto-narrow-mode'.")
 
@@ -2736,8 +2741,7 @@ beginning and end of the buffer."
   "Conditionally widen display when `auto-narrow-mode' is in effect."
   (when auto-narrow-mode
     (setq-local widen-automatically t
-                isearch-widen-automatically t
-                isearch-lazy-highlight auto-narrow--isearch-lazy-highlight)
+                isearch-widen-automatically t)
     (if (memq this-command '(narrow-to-region narrow-to-defun narrow-to-page))
         (setq auto-narrow--narrowing-state 'explicit
               widen-automatically auto-narrow--widen-automatically
@@ -2754,6 +2758,7 @@ beginning and end of the buffer."
              (not (eq auto-narrow--narrowing-state 'explicit)))
     (unless auto-narrow--initialized
       (run-hooks 'auto-narrow-hook)
+      (add-hook 'isearch-mode-end-hook 
#'auto-narrow--reset-isearch-lazy-highlight)
       (setq auto-narrow--widen-automatically widen-automatically
             auto-narrow--isearch-widen-automatically 
isearch-widen-automatically
             auto-narrow--isearch-lazy-highlight isearch-lazy-highlight



reply via email to

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