emacs-devel
[Top][All Lists]
Advanced

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

Re: should query-replace-regexp-eval be in the manual?


From: Robert J. Chassell
Subject: Re: should query-replace-regexp-eval be in the manual?
Date: Mon, 16 Apr 2007 00:51:09 +0000 (UTC)

The discussion of query-replace-regexp presumes using it
interactively.  That does not necessarily follow, although I suppose
interactive use is most common.

For example

    M-C-% or.*ry RET \,(format "strange %s" \#)

is

    (query-replace-regexp "or.*ry"
                          '(replace-eval-replacement
                            replace-quote
                            (format "strange %s" replace-count)))

[i.e., convert "ordinary" or something like it to "strange" plus a number]

When you are writing Emacs Lisp expressions, it is simpler to use
`query-replace-regexp-eval'.  The same result will come from invoking

    (query-replace-regexp-eval "or.*ary"
                               '(format "strange %s" replace-count))

I recommend leaving it in the source.  Perhaps (a short) mention in
the manual is useful, although I do not feel strongly about that.

--
    Robert J. Chassell                          GnuPG Key ID: 004B4AC8
    address@hidden                         address@hidden
    http://www.rattlesnake.com                  http://www.teak.cc




reply via email to

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