all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* replace-regexp in lisp function
@ 2010-01-18  9:29 Sven Garbade
  0 siblings, 0 replies; 5+ messages in thread
From: Sven Garbade @ 2010-01-18  9:29 UTC (permalink / raw)
  To: help-gnu-emacs

Hallo List,

I frequently use the following regular-regexp:

M-x replace-regexp <RET> \(<<\) <RET> \1cn\,(+ (line-number-at-pos) \#)

to replace "<<" with "<<cn=line number". I tried to write a function

;; add chunk number
(defun add-chunk-number ()
  (interactive)
  (query-replace-regexp "\(<<\)" "\1cn\,(+ (line-number-at-pos) \#)")
  )

to save typing, but this does not work. What did I wrong?

Thanks, Sven




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-18 14:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1632.1263815405.18930.help-gnu-emacs@gnu.org>
2010-01-18 13:01 ` replace-regexp in lisp function David Kastrup
2010-01-18 14:06   ` Sven Garbade
2010-01-18 14:11     ` David Kastrup
2010-01-18 13:11 ` Pascal J. Bourguignon
2010-01-18  9:29 Sven Garbade

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.