Hi,

you can use
M-x replace-regexp "\(//\s \)\s *" "\1"

Note:
1. it doesn't insert a space if it is missing like in "//comment".
2. it uses "\s " what means "any character whose syntax is whitespace". See:
C-h s. ...

Br,
P


<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> I would like to format my comment lines
> replacing all spaces and tabs between
> '//' and the comment text with only one space.
> Ex.
> //____Text.... => //_Text
>
> where '_' is a space.
>
> I use replace-regexp "[^ a-zA-Z0-9/\.]" " "
> on a selection of my code but it
> doesn't work very well because replaces
> characters in the comment text
> - for instance replaces )(!-, etc. -.
>
> Any suggestion?
>
> Thank you very much.
> Luca
>
>
>


_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to