all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Using lisp code in query-replace-regexp
@ 2014-11-04 14:49 Julien Cubizolles
  2014-11-04 18:38 ` Andreas Röhler
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Cubizolles @ 2014-11-04 14:49 UTC (permalink / raw)
  To: help-gnu-emacs

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] 3+ messages in thread

end of thread, other threads:[~2014-11-04 20:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-04 14:49 Using lisp code in query-replace-regexp Julien Cubizolles
2014-11-04 18:38 ` Andreas Röhler
2014-11-04 20:58   ` Julien Cubizolles

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.