unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Marcin Kasperski <Marcin.Kasperski@softax.com.pl>
Cc: 15836@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	[thread overview]
Message-ID: <22a9hey6yj.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <877gcjmbsh.fsf@softax.com.pl> (Marcin Kasperski's message of "Fri, 08 Nov 2013 11:24:14 +0100")

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.





  reply	other threads:[~2013-11-08 20:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08 10:24 bug#15836: 24.3; query-replace-regexp does not detect incorrect usage of \# Marcin Kasperski
2013-11-08 20:27 ` Glenn Morris [this message]
2013-11-08 20:35   ` Glenn Morris
2013-11-08 23:15     ` Stefan Monnier
2013-11-13 20:34       ` Marcin Kasperski
2013-11-13 20:50         ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22a9hey6yj.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=15836@debbugs.gnu.org \
    --cc=Marcin.Kasperski@softax.com.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).