commenting [message #23794] |
Tue, 20 February 2001 08:01  |
Christopher W. O'Dell
Messages: 20 Registered: February 2001
|
Junior Member |
|
|
This is probably wishful thinking, but is there any way to
comment out a large section of code as in C,
where you don't have to insert a ';' on every line of code,
but you can use a beginning and ending comment delimiter?
I have this idea that there might be secret delimiters that
i have not yet heard about in IDL. And I'm very lazy and
have often longed for this feature.
Chris
|
|
|
Re: commenting [message #24073 is a reply to message #23794] |
Fri, 02 March 2001 11:09   |
Phillip David
Messages: 36 Registered: April 1999
|
Member |
|
|
Any GOOD editor will allow you to do things in a vertical block of text,
such as duplicate, fill, or delete. Duplicate column 1, fill the new
column 1 with ; to comment code out. Select column 1 and delete it to
uncomment the code.
I have a macro in KEdit (my favorite Windows editor) that allows me to
do what I call a "Column cursor" -- i.e., I can select a 1 character
column across multiple lines, and can perform the same operation on each
line. These operations can be insert, delete, overwrite, etc. KEdit
also has a REALLY nice feature of allowing you to display just lines
matching a certain pattern. So, for example, I can have it search
column 73 on, find all lines that contain anything, insert a carriage
return, 5 blanks, and a continuation character in FORTRAN codes with
just a few keystrokes. Of course, that's not very elegant, and F90
eliminates the need for this most of the time, but...
This combination of features (operating only on selected lines using a
column cursor) is so powerful that it's kept me from converting to emacs
or any other editor, and often allows me to do jobs in 2-3 minutes that
it would take others literally HOURS of editing to accomplish.
Phillip
"Christopher W. O'Dell" wrote:
>
> This is probably wishful thinking, but is there any way to
> comment out a large section of code as in C,
> where you don't have to insert a ';' on every line of code,
> but you can use a beginning and ending comment delimiter?
> I have this idea that there might be secret delimiters that
> i have not yet heard about in IDL. And I'm very lazy and
> have often longed for this feature.
>
> Chris
|
|
|
Re: commenting [message #24089 is a reply to message #23794] |
Thu, 08 March 2001 21:59  |
Wayne Landsman
Messages: 117 Registered: January 1997
|
Senior Member |
|
|
David Fanning wrote:
> John-David Smith (jdsmith@astro.cornell.edu) writes:
>
>> You mean like:
>>
>> [M-C-%]^\([C-u 73 .]\)\(.+\)[Ret]\1$[C-q C-j] \2[Ret]
>
> Is there a Berlitz course for this Emacs editor?
>
> Cheers,
>
My favorite apochryphal story about Emacs is that the name is really an
acronym for Escape-Meta-Alt-Control-Shift, since its apparent purpose is
to make one use those keys as much as possible.
Still, all those nice IDLWAVE mode features make me tempted to try one
more time to learn Emacs. At least now I know where the Meta key is
located...
--Wayne Landsman landsman@mpb.gsfc.nasa.gov
|
|
|
|
Re: commenting [message #24091 is a reply to message #24073] |
Thu, 08 March 2001 17:10  |
John-David T. Smith
Messages: 384 Registered: January 2000
|
Senior Member |
|
|
Phillip David wrote:
> I have a macro in KEdit (my favorite Windows editor) that allows me to
> do what I call a "Column cursor"
<snip>
> So, for example, I can have it search
> column 73 on, find all lines that contain anything, insert a carriage
> return, 5 blanks, and a continuation character in FORTRAN codes with
> just a few keystrokes. <snip> it's kept me from converting to emacs
You mean like:
[M-C-%]^\([C-u 73 .]\)\(.+\)[Ret]\1$[C-q C-j] \2[Ret]
JD
|
|
|