help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

replace-regexp in lisp function


From: Sven Garbade
Subject: replace-regexp in lisp function
Date: Mon, 18 Jan 2010 10:29:07 +0100

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]