unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / 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
[parent not found: <mailman.1632.1263815405.18930.help-gnu-emacs@gnu.org>]

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 --
2010-01-18  9:29 replace-regexp in lisp function Sven Garbade
     [not found] <mailman.1632.1263815405.18930.help-gnu-emacs@gnu.org>
2010-01-18 13:01 ` David Kastrup
2010-01-18 14:06   ` Sven Garbade
2010-01-18 14:11     ` David Kastrup
2010-01-18 13:11 ` Pascal J. Bourguignon

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 read-only IMAP folder(s) and NNTP newsgroup(s).