[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: query-replace-interactive not documented

From: David Kastrup
Subject: Re: query-replace-interactive not documented
Date: 13 Jun 2004 11:03:19 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Richard Stallman <address@hidden> writes:

>     What do you think about documenting `query-replace-regexp-eval'
>     in the Emacs manual even without a keybinding?
> The reason I did not document it before is that I'm not sure it is
> really very useful.  I never use it.  How many people here actually
> use it?

I do.  One typical qpplication is

M-x query-replace-regexp-eval RET
\\footnote{ RET
(format "\\footnote{\\label{fn:%d}" replace-count) RET

Also other stuff where you want to replace with numerical expressions.

Of course, most of these uses could be avoided if the replacement
string of the ordinary query-replace-regexp would offer, say

M-x query-replace-regexp RET
\\footnote{ RET
\\footnote{\\label{fn:\!replace-count} RET


\\footnote{\\label{fn:\!(format "%d" replace-count)} RET

Namely \! followed by a sexp.  This would allow the full flexibility
of query-replace-regexp-eval without needing a separate command, and
one would need to switch to Lisp only for the really needed passages
instead of the whole replacement string.

David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

[Prev in Thread] Current Thread [Next in Thread]