From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Robert J. Chassell" Newsgroups: gmane.emacs.devel Subject: Re: should query-replace-regexp-eval be in the manual? Date: Mon, 16 Apr 2007 00:51:09 +0000 (UTC) Message-ID: References: Reply-To: bob@rattlesnake.com NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1176684694 21797 80.91.229.12 (16 Apr 2007 00:51:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Apr 2007 00:51:34 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 16 02:51:26 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HdFRF-000458-41 for ged-emacs-devel@m.gmane.org; Mon, 16 Apr 2007 02:51:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HdFVm-0002GU-TT for ged-emacs-devel@m.gmane.org; Sun, 15 Apr 2007 20:56:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HdFVj-0002F5-E3 for emacs-devel@gnu.org; Sun, 15 Apr 2007 20:56:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HdFVi-0002Dl-NF for emacs-devel@gnu.org; Sun, 15 Apr 2007 20:56:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HdFVi-0002Dc-KQ for emacs-devel@gnu.org; Sun, 15 Apr 2007 20:56:02 -0400 Original-Received: from cpe-69-205-32-54.nycap.res.rr.com ([69.205.32.54] helo=rattlesnake.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HdFR9-0001zV-R9 for emacs-devel@gnu.org; Sun, 15 Apr 2007 20:51:20 -0400 Original-Received: by rattlesnake.com via sendmail from stdin id (Debian Smail3.2.0.115) Mon, 16 Apr 2007 00:51:09 +0000 (UTC) In-reply-to: X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:69477 Archived-At: 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