comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDLWAVE and &$ blocks
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IDLWAVE and &$ blocks [message #91425] Mon, 13 July 2015 12:19 Go to next message
cgguido is currently offline  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 Go to previous message
Craig Markwardt is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Hello
Next Topic: Distance calculation for lots of stars

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 07:14:13 PDT 2025

Total time taken to generate the page: 0.00556 seconds