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

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

Different behaviour between M-x replace-regexp in function and in echo w


From: luca . spinacci
Subject: Different behaviour between M-x replace-regexp in function and in echo window
Date: Thu, 21 Apr 2005 11:35:09 +0200

If I use M-x replace-regexp followed by
"\(//\)[[:space:]] *" <RET> "\1 " <RET>
the behaviour is correct - replacing any space
between '//' ed comment text
Ex.
//___Text... => //_Text...
where '_' is a space

If I use the same
replace-regexp "\(//\)[[:space:]] *" "\1 "
in a function no replacing is done - Replaced 0 occurences -

(defun comment-formatting(start end)
 (interactive "*r")
  (save-excursion
    (save-restriction
      (narrow-to-region start end)
      (goto-char start)
      (replace-regexp "\(//\)[[:space:]] *" "\1 "))))

So M-x comment-formatting has differnt behaviour. Why?


Thanks in advance,
Luca.





reply via email to

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