Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Julien Cubizolles <j.cubizolles@free.fr>
To: info-gnus-english@gnu.org
Subject: Using lisp code in query-replace-regexp
Date: Tue, 04 Nov 2014 15:36:28 +0100	[thread overview]
Message-ID: <87389zowwj.fsf@free.fr> (raw)

I can use the following replace string (for lack of a better term) with
query-replace-regexp

--8<---------------cut here---------------start------------->8---
\,(if (equal \2 nil) "+" (concat "+ " \2 " ::"))
--8<---------------cut here---------------end--------------->8---

How can I input it in a lisp function like:

--8<---------------cut here---------------start------------->8---
(defun jc-item-to-plus (Begin End)
  "Replace \\item by +"
  (interactive "r")
  (query-replace-regexp Begin End "some_standard_regexp" (if (equal \2 nil) "+" (concat "+ " \2 " ::")))
  )
--8<---------------cut here---------------end--------------->8---

Julien.





             reply	other threads:[~2014-11-04 14:36 UTC|newest]

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

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=87389zowwj.fsf@free.fr \
    --to=j.cubizolles@free.fr \
    --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).