Re: How to Auto Insert IDL 7 Template [message #58011] |
Wed, 09 January 2008 11:36  |
Ryan.
Messages: 77 Registered: March 2006
|
Member |
|
|
On Jan 9, 1:44 pm, "Douglas G. Dirks" <ddi...@ittvis.com> wrote:
> David Fanning wrote:
>> Ryan. writes:
>
>>> Does anyone know how to get the 'Auto Insert' Feature to work in IDL
>>> 7? I've set them in Window->Preferences->IDL->Templates to "ON" but
>>> can't figure out how it works. Is there some special keystroke I
>>> need?
>
>> Start to type the template, then type CNTL-space. You should
>> have the option of filling in with the appropriate template.
>
>> Cheers,
>
>> David
>
> Hi Ryan,
>
> David's response is, of course, correct -- and admirable in its brevity.
> To amplify just a little...
>
> Templates are a subset of what Eclipse (and thus the IDL Workbench)
> calls "Content Assist." To insert a content assist item, you press
> Ctrl-Space. One of two things will happen:
>
> - If you have already typed all of the name of the item you want
> to insert (or enough to identify it uniquely), the entire thing
> will just be inserted.
> - If you have typed less than enough to uniquely identify any item,
> a list pops up and you can choose what you want to insert.
>
> So, if you've got a template named, say, "SuperCoolTemplate," you can
> start by typing (for example) "su" and then pressing Ctrl-Space. If
> no other template starts with "su" your template will be inserted. If
> there are others that start with "su" you'll have to select one from
> the dialog.
>
> The same shortcut technique works with other content assist items.
> Say you're tired of typing
>
> file=DIALOG_PICKFILE()
>
> Just type
>
> file=di Ctrl-Space
>
> and scroll down to the DIALOG_PICKFILE entry, then press Enter.
>
> Note that if the item you're inserting (be it routine name or
> template) consists of a single line, you can also use this in
> the Command Line view. For example, I find myself selecting
> files from IDL's examples directory fairly often, so I made myself
> a single line template named "examples" that looks like this:
>
> FILEPATH('${file}', SUBDIRECTORY=['examples', 'data'])
>
> In the Command Line view, I can type
>
> file=exa Ctrl-Space
>
> and all that pops in automatically, with the cursor positioned
> over the variable 'file' so I can type in the name of the example
> file I want.
>
> Anyway, you can read more about templates and content assist in
> the IDL help by entering the following at the IDL command prompt:
>
> ONLINE_HELP, 'Templates'
> ONLINE_HELP, 'Getting_Help'
>
> I hope that helps,
> Doug
>
> ----------------
> Douglas G. Dirks
> IDL Documentation Group * ITT Visual Information Solutions
> 4990 Pearl East Circle * Boulder, CO 80301
> ddi...@ittvis.com
Wow, Thanks Doug. I had just started to code with emacs when IDL 7
came out so I knew something about templates but never managed to
figure out how to change them. I did find the place in IDL 7 where
they can be edited. Now my coding will go much faster =)
I don't know if I'm looking forward to the days where IDL is
intuitively obvious to all because I enjoy reading David's articles of
the idiosyncrasies of IDL. However, working with an intuitively
obvious software program will sure make the work day go much faster
and less frustrating. =)
Ryan.
|
|
|
|
|
|
Re: How to Auto Insert IDL 7 Template [message #58016 is a reply to message #58015] |
Wed, 09 January 2008 10:44   |
Douglas G. Dirks
Messages: 10 Registered: October 2006
|
Junior Member |
|
|
David Fanning wrote:
> Ryan. writes:
>
>> Does anyone know how to get the 'Auto Insert' Feature to work in IDL
>> 7? I've set them in Window->Preferences->IDL->Templates to "ON" but
>> can't figure out how it works. Is there some special keystroke I
>> need?
>
> Start to type the template, then type CNTL-space. You should
> have the option of filling in with the appropriate template.
>
> Cheers,
>
> David
Hi Ryan,
David's response is, of course, correct -- and admirable in its brevity.
To amplify just a little...
Templates are a subset of what Eclipse (and thus the IDL Workbench)
calls "Content Assist." To insert a content assist item, you press
Ctrl-Space. One of two things will happen:
- If you have already typed all of the name of the item you want
to insert (or enough to identify it uniquely), the entire thing
will just be inserted.
- If you have typed less than enough to uniquely identify any item,
a list pops up and you can choose what you want to insert.
So, if you've got a template named, say, "SuperCoolTemplate," you can
start by typing (for example) "su" and then pressing Ctrl-Space. If
no other template starts with "su" your template will be inserted. If
there are others that start with "su" you'll have to select one from
the dialog.
The same shortcut technique works with other content assist items.
Say you're tired of typing
file=DIALOG_PICKFILE()
Just type
file=di Ctrl-Space
and scroll down to the DIALOG_PICKFILE entry, then press Enter.
Note that if the item you're inserting (be it routine name or
template) consists of a single line, you can also use this in
the Command Line view. For example, I find myself selecting
files from IDL's examples directory fairly often, so I made myself
a single line template named "examples" that looks like this:
FILEPATH('${file}', SUBDIRECTORY=['examples', 'data'])
In the Command Line view, I can type
file=exa Ctrl-Space
and all that pops in automatically, with the cursor positioned
over the variable 'file' so I can type in the name of the example
file I want.
Anyway, you can read more about templates and content assist in
the IDL help by entering the following at the IDL command prompt:
ONLINE_HELP, 'Templates'
ONLINE_HELP, 'Getting_Help'
I hope that helps,
Doug
----------------
Douglas G. Dirks
IDL Documentation Group * ITT Visual Information Solutions
4990 Pearl East Circle * Boulder, CO 80301
ddirks@ittvis.com
|
|
|
|
|
Re: How to Auto Insert IDL 7 Template [message #58063 is a reply to message #58016] |
Fri, 11 January 2008 07:59  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Douglas G. Dirks writes:
> Templates are a subset of what Eclipse (and thus the IDL Workbench)
> calls "Content Assist." To insert a content assist item, you press
> Ctrl-Space. One of two things will happen:
>
> - If you have already typed all of the name of the item you want
> to insert (or enough to identify it uniquely), the entire thing
> will just be inserted.
I presume this is part of the Auto Insert business that has
to be turned on for the Templates. Do I have that right?
If so, how do I get that to work? Do I type the name of the
template? The first characters of the line of the template?
I've tried everything I can think of to do, all without
success.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|