From: "Robert J. Chassell" <bob@rattlesnake.com>
To: emacs-devel@gnu.org
Subject: Re: should query-replace-regexp-eval be in the manual?
Date: Mon, 16 Apr 2007 00:51:09 +0000 (UTC) [thread overview]
Message-ID: <m1HdFQz-0027M2C@rattlesnake.com> (raw)
In-Reply-To: <EIENLHALHGIMHGDOLMIMMEKIDAAA.drew.adams@oracle.com>
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
bob@rattlesnake.com bob@gnu.org
http://www.rattlesnake.com http://www.teak.cc
next prev parent reply other threads:[~2007-04-16 0:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-13 16:41 should query-replace-regexp-eval be in the manual? Drew Adams
2007-04-14 9:47 ` Alan Mackenzie
2007-04-14 14:43 ` Drew Adams
2007-04-15 21:56 ` David Kastrup
2007-04-15 22:03 ` David Kastrup
2007-04-15 22:11 ` Lennart Borgman (gmail)
2007-04-15 22:55 ` Drew Adams
2007-04-16 0:51 ` Robert J. Chassell [this message]
2007-04-16 3:45 ` Stefan Monnier
2007-04-15 22:54 ` Drew Adams
2007-04-16 15:37 ` Richard Stallman
2007-04-16 17:22 ` David Kastrup
2007-04-17 18:03 ` Richard Stallman
2007-04-17 23:27 ` David Kastrup
2007-04-18 14:56 ` Richard Stallman
2007-04-18 16:37 ` David Kastrup
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1HdFQz-0027M2C@rattlesnake.com \
--to=bob@rattlesnake.com \
--cc=emacs-devel@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.