all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Different behaviour between M-x replace-regexp in function and in echo window
@ 2005-04-21  9:35 luca.spinacci
  2005-04-21 10:29 ` Peter Dyballa
  0 siblings, 1 reply; 4+ messages in thread
From: luca.spinacci @ 2005-04-21  9:35 UTC (permalink / raw)



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.

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

end of thread, other threads:[~2005-04-21 13:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2365.1114076857.2895.help-gnu-emacs@gnu.org>
2005-04-21  9:54 ` Different behaviour between M-x replace-regexp in function and in echo window David Kastrup
2005-04-21 13:21 ` Different behaviour between M-x replace-regexp in function and in echowindow Peter Tury
2005-04-21  9:35 Different behaviour between M-x replace-regexp in function and in echo window luca.spinacci
2005-04-21 10:29 ` Peter Dyballa

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.