GNU bug report logs - #15836
24.3; query-replace-regexp does not detect incorrect usage of \#

Previous Next

Package: emacs;

Reported by: Marcin Kasperski <Marcin.Kasperski <at> softax.com.pl>

Date: Fri, 8 Nov 2013 16:49:02 UTC

Severity: wishlist

Found in version 24.3

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: Marcin Kasperski <Marcin.Kasperski <at> softax.com.pl>
Cc: 15836 <at> debbugs.gnu.org
Subject: bug#15836: 24.3; query-replace-regexp does not detect incorrect usage of \#
Date: Fri, 08 Nov 2013 15:27:48 -0500
Marcin Kasperski wrote:

>    M-x query-replace-regexp
>    ^
>    \,(\#)
[...]
>    Symbol's function definition is void: replace-count
>
> (which made me look for uninstalled libraries, spoiled files etc)
>
> Expected effect:
>
>    Some error pointing on regexp syntax.

I'm not sure how to make this any better. You basically got exactly what
you asked for, given how it's documented to work:

    In interactive calls, the replacement text may contain `\,' followed
    by a Lisp expression used as part of the replacement text. [...]
    `\#' itself [stands] for `replace-count', the number of replacements
    occurred so far

So you wrote:

(replace-count)

which is indeed not a function.


The error message could perhaps be wrapped in "Error evaluating
replacement expression: <actual error message>"; but I'm not sure that
would have helped you decide whether it was an internal issue or a
mistake on your part. Special-casing your particular error does not seem
worth it to me.




This bug report was last modified 11 years and 182 days ago.

Previous Next


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