GNU bug report logs -
#78074
isearch not respecting point when changing direction after scrolling
Previous Next
Reported by: Jake <jforst.mailman <at> gmail.com>
Date: Sat, 26 Apr 2025 16:29:02 UTC
Severity: normal
Fixed in version 31.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 78074 <at> debbugs.gnu.org (full text, mbox):
>> I think this is a bug because it doesn't happen when
>> `isearch-repeat-on-direction-change' has its default value of nil.
>
> Thanks for the bug report. Maybe we don't need these lines
> in 'isearch-repeat' after all:
>
> (if (and isearch-other-end isearch-repeat-on-direction-change)
> (goto-char isearch-other-end))
>
> Could you please try to remove these 2 lines and see whether this
> improves the behavior of changing the direction.
Actually, this still should be used when changing the direction
with point on the current match. So here is the correct patch:
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 52c5042133e..57df42e1128 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1952,7 +1952,9 @@ isearch-repeat
(funcall isearch-wrap-function)
(goto-char (if isearch-forward (point-min) (point-max))))))
;; C-s in reverse or C-r in forward, change direction.
- (if (and isearch-other-end isearch-repeat-on-direction-change)
+ (if (and isearch-other-end isearch-repeat-on-direction-change
+ (or (null isearch-cmds)
+ (eq (isearch--state-point (car isearch-cmds)) (point))))
(goto-char isearch-other-end))
(setq isearch-forward (not isearch-forward)
isearch-success t))
This bug report was last modified 23 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.