emacs-devel
[Top][All Lists]
Advanced

[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: 16 Jun 2004 14:15:36 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

address@hidden (Kim F. Storm) writes:

> David Kastrup <address@hidden> writes:
> 
> > Juri Linkov <address@hidden> writes:
> > 
> > I'd rather say that since we already have special symbols
> > \1 \2 \3 \#1 \#2 \#3, that the most natural choice would probably be
> > just \# for the match number.  Then we'd have
> > 
> > \\label{fn:\,\# } RET
> > 
> > And it would probably make sense to define \# as a string component
> > on its own, too, so that we can just write
> > \\label{fn:\#} RET
> > if we want to.
> > 
> 
> \, and \# both looks good to me.  
> 
> The extra space after the \, form should be optional, i.e. if there is
> a space, remove it, if not, it's not an error.

Quite so.  \# caters for the most frequent use of \' without matched
parens.  However, other possible uses are references to frequently
used constant expressions one does not want to type out, and things like
\,?x
to insert ASCII codes as numbers and so on, so I think that the
optional space is still worth the price to pay.

> I haven't studied the two proposed implementations in details,
> but if there is an issue re. security and non-interactive calls,
> it might make sense to simply not accept these formats if called
> non-interactively.  After all, this function is called
> QUERY-replace-regexp.

An advantage is that, like query-replace-regexp-eval, the command
history contains a nicely compiled expression that is quite more
appropriate for cut&paste purposes into Lisp programs (which usually
should not use things like perform-replace, anyway).

Just working on a newer version right now.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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