* Invalid search bound (wrong side of point)
@ 2004-05-31 16:33 Juri Linkov
2004-05-31 17:02 ` Andreas Schwab
2004-06-01 14:57 ` Richard Stallman
0 siblings, 2 replies; 3+ messages in thread
From: Juri Linkov @ 2004-05-31 16:33 UTC (permalink / raw)
`perform-replace' signals an error even during normal operation such
as replacing a string in the active region with transient mark mode
enabled. This bug can be reproduced by evaluating in the *scratch* buffer:
(progn
(transient-mark-mode 1)
(insert "\na\n\n\n")
(perform-replace "^" " " nil t nil nil nil (- (point) 4) (- (point) 2)))
`perform-replace' uses nil value returned from `re-search-forward'
as a condition to terminate the loop, but when the value of point
becomes greater than limit, "Invalid search bound" error is signalled,
even though `noerror' argument of `re-search-forward' is t.
Generally, this error can be observed by evaluating in this buffer by C-x C-e:
(re-search-forward "abc" (point-min) t)
whereas evaluating the following expression simply returns nil:
(re-search-forward "def" (point-max) t)
It seems that `search_command' should be changed to not signal an
"Invalid search bound" error if its `noerror' argument is non-nil.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Invalid search bound (wrong side of point)
2004-05-31 16:33 Invalid search bound (wrong side of point) Juri Linkov
@ 2004-05-31 17:02 ` Andreas Schwab
2004-06-01 14:57 ` Richard Stallman
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2004-05-31 17:02 UTC (permalink / raw)
Cc: emacs-devel
Juri Linkov <juri@jurta.org> writes:
> It seems that `search_command' should be changed to not signal an
> "Invalid search bound" error if its `noerror' argument is non-nil.
I don't think so. This error is unrelated to the meaning of the `noerror'
argument. The latter only suppresses the search-failed error, all other
errors are still signalled.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Invalid search bound (wrong side of point)
2004-05-31 16:33 Invalid search bound (wrong side of point) Juri Linkov
2004-05-31 17:02 ` Andreas Schwab
@ 2004-06-01 14:57 ` Richard Stallman
1 sibling, 0 replies; 3+ messages in thread
From: Richard Stallman @ 2004-06-01 14:57 UTC (permalink / raw)
Cc: emacs-devel
`perform-replace' uses nil value returned from `re-search-forward'
as a condition to terminate the loop, but when the value of point
becomes greater than limit, "Invalid search bound" error is signalled,
even though `noerror' argument of `re-search-forward' is t.
I think that is correct behavior. Invalid arguments are a different
matter from valid arguments but no match.
The clean solution is for perform-replace to detect the situation
explicitly.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-06-01 14:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-31 16:33 Invalid search bound (wrong side of point) Juri Linkov
2004-05-31 17:02 ` Andreas Schwab
2004-06-01 14:57 ` Richard Stallman
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).