Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: info-gnus-english@gnu.org
Subject: Re: Using lisp code in query-replace-regexp
Date: Tue, 04 Nov 2014 20:57:27 +0100	[thread overview]
Message-ID: <87d292pwm0.fsf@debian.uxu> (raw)
In-Reply-To: <mailman.12755.1415111824.1147.info-gnus-english@gnu.org>

Julien Cubizolles <j.cubizolles@free.fr> 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

       reply	other threads:[~2014-11-04 19:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.12755.1415111824.1147.info-gnus-english@gnu.org>
2014-11-04 19:57 ` Emanuel Berg [this message]
2014-11-05 12:46   ` Julien Cubizolles
     [not found]   ` <mailman.12880.1415191645.1147.info-gnus-english@gnu.org>
2014-11-05 23:41     ` Emanuel Berg
2014-11-04 14:36 Julien Cubizolles

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=87d292pwm0.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=info-gnus-english@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).