Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Using lisp code in query-replace-regexp
@ 2014-11-04 14:36 Julien Cubizolles
  0 siblings, 0 replies; 4+ messages in thread
From: Julien Cubizolles @ 2014-11-04 14:36 UTC (permalink / raw)
  To: info-gnus-english

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.





^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <mailman.12755.1415111824.1147.info-gnus-english@gnu.org>]

end of thread, other threads:[~2014-11-05 23:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-04 14:36 Using lisp code in query-replace-regexp Julien Cubizolles
     [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

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).