GNU bug report logs - #52248
Open hidden overlays in isearch-delete-char

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 2 Dec 2021 20:00:02 UTC

Severity: normal

Tags: patch

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Open hidden overlays in isearch-delete-char
Date: Thu, 02 Dec 2021 21:56:02 +0200
Tags: patch

This is not a regression.

While navigating forward with C-s in a buffer with invisible overlays
such as when using outline-minor-mode with hidden outlines,
it opens hidden overlays on the current match, and hides again
when going to the next match.

But going back with DEL (isearch-delete-char) doesn't reopen
the hidden overlay on the previous match.  Here is the fix:

diff --git a/lisp/isearch.el b/lisp/isearch.el
index fcb7d646c6..8421c5629b 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2504,6 +2552,10 @@ isearch-delete-char
   (if (null (cdr isearch-cmds))
       (ding)
     (isearch-pop-state))
+  ;; When going back to the hidden match, reopen it.
+  (when (and (eq search-invisible 'open) isearch-hide-immediately isearch-other-end)
+    (isearch-range-invisible (min (point) isearch-other-end)
+                             (max (point) isearch-other-end)))
   (isearch-update))
 
 (defun isearch-del-char (&optional arg)
-- 





This bug report was last modified 3 years and 165 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.