IDLWAVE and &$ blocks [message #91425] |
Mon, 13 July 2015 12:19  |
cgguido
Messages: 195 Registered: August 2005
|
Senior Member |
|
|
Hi all,
Does anyone know how to get emacs to add/remove a bunch of '&$' at the end of a block of code, like C-c+; for commenting?
Also, how to force indentation to ignore said '&$' and continue to indent code properly?
I tried looking through the docs, but I found nothing. Possibly cos I didn't search for the right terms...
Thanks,
G
|
|
|
Re: IDLWAVE and &$ blocks [message #91448 is a reply to message #91425] |
Thu, 16 July 2015 07:26  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Monday, July 13, 2015 at 3:19:45 PM UTC-4, Gianguido Cianci wrote:
> Hi all,
>
> Does anyone know how to get emacs to add/remove a bunch of '&$' at the end of a block of code, like C-c+; for commenting?
Emacs, yes, IDLWAVE no.
You want to replace a regular expression
Type
M-x replace-regexp
(in case you don't know what M-x means, type the escape key, then the x key)
The regular expression you want to replace is,
&\$ *$
and you replace with nothing, just leave the replacement blank. The file should automatically have all "$&" strings at end of line replaced.
If you've never read regular expressions that must look pretty confusing. There is a method to the madness. The partial issue is that in regular expression notation, the dollar sign symbol actually means end of line. We have to use \$ to indicate a literal dollar sign. So these are the meanings.
'&' = literal "&"
'\$' = literal "$"
' *' = any number of space characters
'$' = end of line
So it replaces any sequence of "&$" followed by zero or more spaces at the end of line. Thus endeth the lesson.
Craig
|
|
|