From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/17218 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.gnus.user Subject: Re: Using lisp code in query-replace-regexp Date: Tue, 04 Nov 2014 20:57:27 +0100 Organization: Aioe.org NNTP Server Message-ID: <87d292pwm0.fsf@debian.uxu> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1415131216 27270 80.91.229.3 (4 Nov 2014 20:00:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Nov 2014 20:00:16 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Tue Nov 04 21:00:11 2014 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XlkGt-0007Jv-2Y for gegu-info-gnus-english@m.gmane.org; Tue, 04 Nov 2014 21:00:07 +0100 Original-Received: from localhost ([::1]:42773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlkGs-0006Ct-OQ for gegu-info-gnus-english@m.gmane.org; Tue, 04 Nov 2014 15:00:06 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-Lines: 24 Original-NNTP-Posting-Host: feB02bRejf23rfBm51Mt7Q.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:GOGr1Oy34LRvqjAJF46g3up6xqE= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.gnus:88349 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:17218 Archived-At: Julien Cubizolles writes: > I can use the following replace string (for lack of > a better term) with query-replace-regexp Yes, you can do that. Check out this: (while (re-search-forward REGEXP nil t) (replace-match TO-STRING nil nil)) from the help of `replace-regexp'. So instead of the `replace-match' stuff above, you write a function that examines `match-beginning', `match-end', and `match-string', and then use that as input to your Elisp, to produce the on-the-fly TO-STRING (in the phrasing of the above Elisp). Good luck! When you get it to work, post it here :) -- underground experts united