aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJuri Linkov2025-04-29 19:41:44 +0300
committerJuri Linkov2025-04-29 19:41:44 +0300
commit9d0595d8795fbd604c6429317daff4d6445f8904 (patch)
tree052d429fddaa6a0ea2a7a9b41cff7beb0dddb6d3 /lisp
parent622825995204b7aae70b836c8e5e5d44385c401b (diff)
downloademacs-9d0595d8795fbd604c6429317daff4d6445f8904.tar.gz
emacs-9d0595d8795fbd604c6429317daff4d6445f8904.zip
Fix invalid search bound in 'search-within-boundaries'.
* lisp/isearch.el (search-within-boundaries): Don't go over BOUND. * test/lisp/isearch-tests.el (isearch--test-search-within-boundaries): Test with the BOUND arg as well (bug#78116).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/isearch.el16
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 5cde8092bde..b23f38077aa 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -4625,7 +4625,13 @@ defaults to the value of `isearch-search-fun-default' when nil."
4625 ;; Otherwise, try to search for the next property. 4625 ;; Otherwise, try to search for the next property.
4626 (unless beg 4626 (unless beg
4627 (setq beg (funcall next-fun old)) 4627 (setq beg (funcall next-fun old))
4628 (when beg (goto-char beg))) 4628 (when beg
4629 (if (or (null bound)
4630 (if isearch-forward
4631 (< beg bound)
4632 (> beg bound)))
4633 (goto-char beg)
4634 (setq beg nil))))
4629 ;; Non-nil `beg' means there are more properties. 4635 ;; Non-nil `beg' means there are more properties.
4630 (while (and beg (not found)) 4636 (while (and beg (not found))
4631 ;; Search for the end of the current property. 4637 ;; Search for the end of the current property.
@@ -4675,7 +4681,13 @@ defaults to the value of `isearch-search-fun-default' when nil."
4675 ;; Get the next text property. 4681 ;; Get the next text property.
4676 (unless found 4682 (unless found
4677 (setq beg (funcall next-fun end)) 4683 (setq beg (funcall next-fun end))
4678 (when beg (goto-char beg)))) 4684 (when beg
4685 (if (or (null bound)
4686 (if isearch-forward
4687 (< beg bound)
4688 (> beg bound)))
4689 (goto-char beg)
4690 (setq beg nil)))))
4679 (unless found (goto-char old)) 4691 (unless found (goto-char old))
4680 found)) 4692 found))
4681 4693