unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19208: replace-match unhelpful error message
@ 2014-11-28 17:00 Phillip Lord
  2019-08-03 14:01 ` Lars Ingebrigtsen
  2019-08-03 20:22 ` Paul Eggert
  0 siblings, 2 replies; 15+ messages in thread
From: Phillip Lord @ 2014-11-28 17:00 UTC (permalink / raw)
  To: 19208


Occurs in Emacs 24.3 and trunk

Running this code in *scratch* buffer

(progn
  (goto-char (point-min))
  (re-search-forward "This")
  (replace-match "That" nil nil nil))

Now undo and run this code

(progn
  (goto-char (point-min))
  (re-search-forward "This")
  (replace-match "That" nil nil nil 1))

This causes the following error.

progn: Args out of range: -1, -1


The error is caused because I have asked for a subexp that doesn't exist in
the regexp. A programmer error for sure, but the Args out of range error seems
rather unfriendly to me, especially as I have no idea where the -1, or
-1 has come from.

"Attempt to replace regexp subexpression that doesn't exist", for
example, would be nicer.







^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-08-05  2:25 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-28 17:00 bug#19208: replace-match unhelpful error message Phillip Lord
2019-08-03 14:01 ` Lars Ingebrigtsen
2019-08-03 20:22 ` Paul Eggert
2019-08-03 20:31   ` Lars Ingebrigtsen
2019-08-03 20:50     ` Paul Eggert
2019-08-04  9:09       ` Andreas Schwab
2019-08-03 23:59     ` Noam Postavsky
2019-08-04  9:02       ` Andreas Schwab
2019-08-04 14:12         ` Noam Postavsky
2019-08-04 15:13           ` Andreas Schwab
2019-08-04 17:41             ` Paul Eggert
2019-08-04 18:14               ` Andreas Schwab
2019-08-05  2:25           ` Richard Stallman
2019-08-04 11:47       ` Lars Ingebrigtsen
2019-08-04  9:18   ` Andreas Schwab

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).