| [Top] | [Contents] | [Index] | [ ? ] |
IDLWAVE is a package which supports editing source code written in the Interactive Data Language (IDL), and running IDL as an inferior shell.
| 1. Introduction | What IDLWAVE is, and what it is not | |
| 2. IDLWAVE in a Nutshell | One page quick-start guide | |
| 3. Getting Started (Tutorial) | Tutorial | |
| 4. The IDLWAVE Major Mode | The mode for editing IDL programs | |
| 5. The IDLWAVE Shell | The mode for running IDL as an inferior program | |
| 6. Installation | How to Install or Upgrade | |
| 7. Acknowledgements | Who did what | |
| A. Sources of Routine Info | How does IDLWAVE know about routine XYZ | |
| B. HTML Help Browser Tips | ||
| C. Configuration Examples | The user is king | |
| D. Windows and MacOS | What still works, and how | |
| E. Troubleshooting | When good computers turn bad | |
| Index | Fast access | |
--- The Detailed Node Listing --- Getting Started (Tutorial) | ||
|---|---|---|
| 3.1 Lesson I: Development Cycle | ||
| 3.2 Lesson II: Customization | ||
| 3.3 Lesson III: User and Library Catalogs | ||
The IDLWAVE Major Mode | ||
| 4.1 Code Formatting | Making code look nice | |
| 4.2 Routine Info | Calling Sequence and Keyword List | |
| 4.3 Online Help | One key press from source to help | |
| 4.4 Completion | Completing routine names and Keywords | |
| 4.5 Routine Source | Finding routines, the easy way | |
| 4.6 Resolving Routines | Force the Shell to compile a routine | |
| 4.7 Code Templates | Frequent code constructs | |
| 4.8 Abbreviations | Abbreviations for common commands | |
| 4.9 Actions | Changing case, Padding, End checking | |
| 4.10 Documentation Header | Inserting a standard header | |
| 4.11 Motion Commands | Moving through the structure of a program | |
| 4.12 Miscellaneous Options | Things that fit nowhere else | |
Code Formatting | ||
| 4.1.1 Code Indentation | Reflecting the logical structure | |
| 4.1.2 Continued Statement Indentation | ||
| 4.1.3 Comment Indentation | Special indentation for comment lines | |
| 4.1.4 Continuation Lines and Filling | Splitting statements over lines | |
| 4.1.5 Syntax Highlighting | Font-lock support | |
| 4.1.6 Octals and Highlighting | Why "123 causes problems | |
Online Help | ||
| 4.3.1 Help with HTML Documentation | ||
| 4.3.2 Help with Source | ||
Completion | ||
| 4.4.1 Case of Completed Words | CaseOFcomPletedWords | |
| 4.4.2 Object Method Completion and Class Ambiguity | obj->Method, what? | |
| 4.4.3 Object Method Completion in the Shell | ||
| 4.4.4 Class and Keyword Inheritance | obj->Method, _EXTRA=e | |
| 4.4.5 Structure Tag Completion | Completing state.Tag | |
Actions | ||
| 4.9.1 Block Boundary Check | Is the END statement correct? | |
| 4.9.2 Padding Operators | Enforcing space around `=' etc | |
| 4.9.3 Case Changes | Enforcing upper case keywords | |
The IDLWAVE Shell | ||
| 5.1 Starting the Shell | How to launch IDL as a subprocess | |
| 5.2 Using the Shell | Interactively working with the Shell | |
| 5.3 Commands Sent to the Shell | ||
| 5.4 Debugging IDL Programs | ||
| 5.5 Examining Variables | ||
| 5.6 Custom Expression Examination | ||
Debugging IDL Programs | ||
| 5.4.1 A Tale of Two Modes | ||
| 5.4.2 Debug Key Bindings | ||
| 5.4.3 Breakpoints and Stepping | ||
| 5.4.4 Compiling Programs | ||
| 5.4.5 Walking the Calling Stack | ||
| 5.4.6 Electric Debug Mode | ||
Installation | ||
| 6.1 Installing IDLWAVE | How to install the distribution | |
| 6.2 Installing Online Help | Where to get the additional files needed | |
Sources of Routine Info | ||
| A.1 Routine Definitions | Where IDL Routines are defined. | |
| A.2 Routine Information Sources | So how does IDLWAVE know about... | |
| A.3 Catalogs | ||
| A.4 Load-Path Shadows | Routines defined in several places | |
| A.5 Documentation Scan | Scanning the IDL Manuals | |
Catalogs | ||
| A.3.1 Library Catalogs | ||
| A.3.2 User Catalog | ||
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
IDLWAVE is a package which supports editing source files written in the Interactive Data Language (IDL(1)), and running IDL as an inferior shell(2). It is a feature-rich replacement for the IDLDE development environment included with IDL, and uses the full power of Emacs to make editing and running IDL programs easier, quicker, and more structured.
IDLWAVE consists of two main parts: a major mode for editing IDL
source files (idlwave-mode) and a mode for running the IDL
program as an inferior shell (idlwave-shell-mode). Although
one mode can be used without the other, both work together closely to
form a complete development environment. Here is a brief summary of
what IDLWAVE does:
Here are a number of screenshots showing IDLWAVE in action:
IDLWAVE is the distant successor to the `idl.el' and
`idl-shell.el' files written by Chris Chase. The modes and files
had to be renamed because of a name space conflict with CORBA's
idl-mode, defined in Emacs in the file `cc-mode.el'.
In this manual, each section ends with a list of related user options. Don't be confused by the sheer number of options available -- in most cases the default settings are just fine. The variables are listed here to make sure you know where to look if you want to change anything. For a full description of what a particular variable does and how to configure it, see the documentation string of that variable (available with C-h v). Some configuration examples are also given in the appendix.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
TAB | Indent the current line relative to context. |
C-M-\ | Re-indent all lines in the current region. |
C-M-q | Re-indent all lines in the current routine. |
C-u TAB | Re-indent all lines in the current statement. |
M-RET | Start a continuation line, splitting the current line at point. |
M-q | Fill the current comment paragraph. |
C-c ? | Display calling sequence and keywords for the procedure or function call at point. |
M-? | Load context sensitive online help for nearby routine, keyword, etc. |
M-TAB | Complete a procedure name, function name or keyword in the buffer. |
C-c C-i | Update IDLWAVE's knowledge about functions and procedures. |
C-c C-v | Visit the source code of a procedure/function. |
C-u C-c C-v | Visit the source code of a procedure/function in this buffer. |
C-c C-h | Insert a standard documentation header. |
C-c RET | Insert a new timestamp and history item in the documentation header. |
C-c C-s | Start IDL as a subprocess and/or switch to the shell buffer. |
Up, M-p | Cycle back through IDL command history. |
Down,M-n | Cycle forward. |
TAB | Complete a procedure name, function name or keyword in the shell buffer. |
C-c C-d C-c | Save and compile the source file in the current buffer. |
C-c C-d C-x | Go to next syntax error. |
C-c C-d C-v | Switch to electric debug mode. |
C-c C-d C-b | Set a breakpoint at the nearest viable source line. |
C-c C-d C-d | Clear the nearest breakpoint. |
C-c C-d [ | Go to the previous breakpoint. |
C-c C-d ] | Go to the next breakpoint. |
C-c C-d C-p | Print the value of the expression near point in IDL. |
;; Change the indentation preferences
;; Start autoloading routine info after 2 idle seconds
(setq idlwave-init-rinfo-when-idle-after 2)
;; Pad operators with spaces
(setq idlwave-do-actions t
idlwave-surround-by-blank t)
;; Syntax Highlighting
(add-hook 'idlwave-mode-hook 'turn-on-font-lock)
;; Automatically start the shell when needed
(setq idlwave-shell-automatic-start t)
;; Bind debugging commands with CONTROL and SHIFT modifiers
(setq idlwave-shell-debug-modifiers '(control shift))
|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| 3.1 Lesson I: Development Cycle | ||
| 3.2 Lesson II: Customization | ||
| 3.3 Lesson III: User and Library Catalogs |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The purpose of this tutorial is to guide you through a very basic development cycle using IDLWAVE. We will paste a simple program into a buffer and use the shell to compile, debug and run it. On the way we will use many of the important IDLWAVE commands. Note, however, that IDLWAVE has many more capabilities than covered here, which can be discovered by reading the entire manual, or hovering over the shoulder of your nearest IDLWAVE guru for a few days.
It is assumed that you have access to Emacs or XEmacs with the full IDLWAVE package including online help (see section Installation). We also assume that you are familiar with Emacs and can read the nomenclature of key presses in Emacs (in particular, C stands for CONTROL and M for META (often the ALT key carries this functionality)).
Open a new source file by typing:
C-x C-f tutorial.pro RET |
A buffer for this file will pop up, and it should be in IDLWAVE mode, indicated in the mode line just below the editing window. Also, the menu bar should contain `IDLWAVE'.
Now cut-and-paste the following code, also available as `tutorial.pro' in the IDLWAVE distribution.
function daynr,d,m,y
;; compute a sequence number for a date
;; works 1901-2099.
if y lt 100 then y = y+1900
if m le 2 then delta = 1 else delta = 0
m1 = m + delta*12 + 1
y1 = y * delta
return, d + floor(m1*30.6)+floor(y1*365.25)+5
end
function weekday,day,month,year
;; compute weekday number for date
nr = daynr(day,month,year)
return, nr mod 7
end
pro plot_wday,day,month
;; Plot the weekday of a date in the first 10 years of this century.
years = 2000,+indgen(10)
wdays = intarr(10)
for i=0,n_elements(wdays)-1 do begin
wdays[i] = weekday(day,month,years[i])
end
plot,years,wdays,YS=2,YT="Wday (0=Sunday)"
end
|
The indentation probably looks funny, since it's different from the settings you use, so use the TAB key in each line to automatically line it up (or, more quickly, select the entire buffer with C-x h, and indent the whole region with C-M-\). Notice how different syntactical elements are highlighted in different colors, if you have set up support for font-lock.
Let's check out two particular editing features of IDLWAVE. Place the
cursor after the end statement of the for loop and press
SPC. IDLWAVE blinks back to the beginning of the block and
changes the generic end to the specific endfor
automatically (as long as the variable idlwave-expand-generic-end
is turned on -- see section Lesson II: Customization). Now place the
cursor in any line you would like to split and press M-RET.
The line is split at the cursor position, with the continuation `$'
and indentation all taken care of. Use C-/ to undo the last
change.
The procedure plot_wday is supposed to plot the day of the week
of a given date for the first 10 years of the 21st century. As in
most code, there are a few bugs, which we are going to use IDLWAVE to
help us fix.
First, let's launch the IDLWAVE shell. You do this with the command
C-c C-s. The Emacs window will split or another window will popup
to display IDL running in a shell interaction buffer. Type a few
commands like print,!PI to convince yourself that you can work
there just as well as in a terminal, or the IDLDE. Use the arrow keys
to cycle through your command history. Are we having fun now?
Now go back to the source window and type C-c C-d C-c to compile the program. If you watch the shell buffer, you see that IDLWAVE types `.run "tutorial.pro"' for you. But the compilation fails because there is a comma in the line `years=...'. The line with the error is highlighted and the cursor positioned at the error, so remove the comma (you should only need to hit Delete!). Compile again, using the same keystrokes as before. Notice that the file is automatically saved for you. This time everything should work fine, and you should see the three routines compile.
Now we want to use the command to plot the day of the week on January
1st. We could type the full command ourselves, but why do that? Go
back to the shell window, type `plot_' and hit TAB. After
a bit of a delay (while IDLWAVE initializes its routine info database,
if necessary), the window will split to show all procedures it knows
starting with that string, and plot_wday should be one of
them. Saving the buffer alerted IDLWAVE about this new routine.
Click with the middle mouse button on plot_wday and it will be
copied to the shell buffer, or if you prefer, add `w' to
`plot_' to make it unambiguous (depending on what other routines
starting with `plot_' you have installed on your system), hit
TAB again, and the full routine name will be completed. Now
provide the two arguments:
plot_wday,1,1 |
and press RET. This fails with an error message telling
you the YT keyword to plot is ambiguous. What are the allowed
keywords again? Go back to the source window and put the cursor into
the `plot' line and press C-c ?. This shows the routine info
window for the plot routine, which contains a list of keywords, along
with the argument list. Oh, we wanted YTITLE. Fix that up.
Recompile with C-c C-d C-c. Jump back into the shell with
C-c C-s, press the UP arrow to recall the previous command
and execute again.
This time we get a plot, but it is pretty ugly -- the points are all
connected with a line. Hmm, isn't there a way for plot to use
symbols instead? What was that keyword? Position the cursor on the
plot line after a comma (where you'd normally type a keyword), and hit
M-Tab. A long list of plot's keywords appears. Aha,
there it is, PSYM. Middle click to insert it. An `='
sign is included for you too. Now what were the values of PSYM
supposed to be? With the cursor on or after the keyword, press
M-? for online help (alternatively, you could have right clicked
on the colored keyword itself in the completion list). A browser will
pop up showing the HTML documentation for the PYSM keyword.
OK, let's use diamonds=4. Fix this, recompile (you know the command
by now: C-c C-d C-c), go back to the shell (if it's vanished,
you know what to do: C-c C-s) and execute again. Now things
look pretty good.
Let's try a different day -- how about April fool's day?
plot_wday,1,4 |
Oops, this looks very wrong. All April Fool's days cannot be Fridays!
We've got a bug in the program, perhaps in the daynr function.
Let's put a breakpoint on the last line there. Position the cursor on
the `return, d+...' line and press C-c C-d C-b. IDL sets a
breakpoint (as you see in the shell window), and the break line is
indicated. Back to the shell buffer, re-execute the previous command.
IDL stops at the line with the breakpoint. Now hold down the SHIFT
key and click with the middle mouse button on a few variables there:
`d', `y', `m', `y1', etc. Maybe d isn't
the correct type. CONTROL-SHIFT middle-click on it for help. Well,
it's an integer, so that's not the problem. Aha, `y1' is zero,
but it should be the year, depending on delta. Shift click
`delta' to see that it's 0. Below, we see the offending line:
`y1=y*delta...' the multiplication should have been a minus sign!
Hit q to exit the debugging mode, and fix the line to read:
y1 = y - delta |
Now remove all breakpoints: C-c C-d C-a. Recompile and rerun the command. Everything should now work fine. How about those leap years? Change the code to plot 100 years and see that every 28 years, the sequence of weekdays repeats.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Emacs is probably the most customizable piece of software ever written, and it would be a shame if you did not make use of this to adapt IDLWAVE to your own preferences. Customizing Emacs or IDLWAVE is accomplished by setting Lisp variables in the `.emacs' file in your home directory -- but do not be dismayed; for the most part, you can just copy and work from the examples given here.
Let's first use a boolean variable. These are variables which you turn on or off, much like a checkbox. A value of `t' means on, a value of `nil' means off. Copy the following line into your `.emacs' file, exit and restart Emacs.
(setq idlwave-reserved-word-upcase t) |
When this option is turned on, each reserved word you type into an IDL source buffer will be converted to upper case when you press SPC or RET right after the word. Try it out! `if' changes to `IF', `begin' to `BEGIN'. If you don't like this behavior, remove the option again from your `.emacs' file and restart Emacs.
You likely have your own indentation preferences for IDL code. For
example, some may prefer to indent the main block of an IDL program
slightly from the margin and use only 3 spaces as indentation between
BEGIN and END. Try the following lines in `.emacs':
(setq idlwave-main-block-indent 1) (setq idlwave-block-indent 3) (setq idlwave-end-offset -3) |
Restart Emacs, and re-indent the program we developed in the first part of this tutorial with C-c h and C-M-\. You may want to keep these lines in `.emacs', with values adjusted to your likings. If you want to get more information about any of these variables, type, e.g., C-h v idlwave-main-block-indent RET. To find which variables can be customized, look for items marked `User Option:' throughout this manual.
If you cannot seem to master this Lisp customization in `.emacs',
there is another, more user-friendly way to customize all the IDLWAVE
variables. You can access it through the IDLWAVE menu in one of the
`.pro' buffers, menu item Customize->Browse IDLWAVE
Group. Here you'll be presented with all the various variables grouped
into categories. You can navigate the hierarchy (e.g. `IDLWAVE
Code Formatting->Idlwave Abbrev And Indent Action->Idlwave Expand
Generic End' to turn on END expansion), read about the variables,
change them, and `Save for Future Sessions'. Few of these variables
need customization, but you can exercise considerable control over
IDLWAVE's functionality with them.
You may also find the key bindings used for the debugging commands too long and complicated. Often we have heard complaints along the lines of, "Do I really have to go through the finger gymnastics of C-c C-d C-c to run a simple command?" Due to Emacs rules and conventions, shorter bindings cannot be set by default, but you can easily enable them. First, there is a way to assign all debugging commands in a single sweep to another simpler combination. The only problem is that we have to use something which Emacs does not need for other important commands. One good option is to execute debugging commands by holding down CONTROL and SHIFT while pressing a single character: C-S-b for setting a breakpoint, C-S-c for compiling the current source file, C-S-a for deleting all breakpoints (try it, it's easier). You can enable this with:
(setq idlwave-shell-debug-modifiers '(shift control)) |
If you have a special keyboard with, for example, a SUPER key, you could even shorten that:
(setq idlwave-shell-debug-modifiers '(super)) |
to get compilation on S-c. Often, a modifier key like SUPER or HYPER is bound or can be bound to an otherwise unused key on your keyboard -- consult your system documentation.
You can also assign specific commands to keys. This you must do in the mode-hook, a special function which is run when a new IDLWAVE buffer gets set up. The possibilities for key customization are endless. Here we set function keys f4-f8 to common debugging commands.
;; First for the source buffer
(add-hook 'idlwave-mode-hook
(lambda ()
(local-set-key [f4] 'idlwave-shell-retall)
(local-set-key [f5] 'idlwave-shell-break-here)
(local-set-key [f6] 'idlwave-shell-clear-current-bp)
(local-set-key [f7] 'idlwave-shell-cont)
(local-set-key [f8] 'idlwave-shell-clear-all-bp)))
;; Then for the shell buffer
(add-hook 'idlwave-shell-mode-hook
(lambda ()
(local-set-key [f4] 'idlwave-shell-retall)
(local-set-key [f5] 'idlwave-shell-break-here)
(local-set-key [f6] 'idlwave-shell-clear-current-bp)
(local-set-key [f7] 'idlwave-shell-cont)
(local-set-key [f8] 'idlwave-shell-clear-all-bp)))
|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
We have already used the routine info display in the first part of this tutorial. This was the invoked using C-c ?, and displays information about the IDL routine near the cursor position. Wouldn't it be nice to have the same kind of information available for your own routines and for the huge amount of code in major libraries like JHUPL or the IDL-Astro library? In many cases, you may already have this information. Files named `.idlwave_catalog' in library directories contain scanned information on the routines in that directory; many popular libraries ship with these "library catalogs" pre-scanned. Users can scan their own routines in one of two ways: either using the supplied tool to scan directories and build their own `.idlwave_catalog' files, or using the built-in method to create a single "user catalog", which we'll show here. See section Catalogs, for more information on choosing which method to use.
To build a user catalog, select Routine Info/Select Catalog
Directories from the IDLWAVE entry in the menu bar. If necessary,
start the shell first with C-c C-s (see section Starting the Shell).
IDLWAVE will find out about the IDL !PATH variable and offer a
list of directories on the path. Simply select them all (or whichever
you want -- directories with existing library catalogs will not be
selected by default) and click on the `Scan&Save' button. Then
go for a cup of coffee while IDLWAVE collects information for each and
every IDL routine on your search path. All this information is
written to the file `.idlwave/idlusercat.el' in your home
directory and will from now on automatically load whenever you use
IDLWAVE. You may find it necessary to rebuild the catalog on occasion
as your local libraries change, or build a library catalog for those
directories instead. Invoke routine info (C-c ?) or completion
(M-TAB) on any routine or partial routine name you know to
be located in the library. E.g., if you have scanned the IDL-Astro
library:
a=readfM-TAB |
expands to `readfits('. Then try
a=readfits(C-c ? |
and you get:
Usage: Result = READFITS(filename, header, heap) ... |
I hope you made it until here. Now you are set to work with IDLWAVE.
On the way you will want to change other things, and to learn more
about the possibilities not discussed in this short tutorial. Read
the manual, look at the documentation strings of interesting variables
(with C-h v idlwave<-variable-name> RET) and ask the
remaining questions on the newsgroup comp.lang.idl-pvwave.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The IDLWAVE major mode supports editing IDL source files. In this chapter we describe the main features of the mode and how to customize them.
| 4.1 Code Formatting | Making code look nice | |
| 4.2 Routine Info | Calling Sequence and Keyword List | |
| 4.3 Online Help | One key press from source to help | |
| 4.4 Completion | Completing routine names and Keywords | |
| 4.5 Routine Source | Finding routines, the easy way | |
| 4.6 Resolving Routines | Force the Shell to compile a routine | |
| 4.7 Code Templates | Frequent code constructs | |
| 4.8 Abbreviations | Abbreviations for common commands | |
| 4.9 Actions | Changing case, Padding, End checking | |
| 4.10 Documentation Header | Inserting a standard header | |
| 4.11 Motion Commands | Moving through the structure of a program | |
| 4.12 Miscellaneous Options | Things that fit nowhere else |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| 4.1.1 Code Indentation | Reflecting the logical structure | |
| 4.1.2 Continued Statement Indentation | ||
| 4.1.3 Comment Indentation | Special indentation for comment lines | |
| 4.1.4 Continuation Lines and Filling | Splitting statements over lines | |
| 4.1.5 Syntax Highlighting | Font-lock support | |
| 4.1.6 Octals and Highlighting | Why "123 causes problems |
The IDL language, with its early roots in FORTRAN, modern implementation in C, and liberal borrowing of features of many vector and other languages along its 25+ year history, has inherited an unusual mix of syntax elements. Left to his or her own devices, a novice IDL programmer will often conjure code which is very difficult to read and impossible to adapt. Much can be gleaned from studying available IDL code libraries for coding style pointers, but, due to the variety of IDL syntax elements, replicating this style can be challenging at best. Luckily, IDLWAVE understands the structure of IDL code very well, and takes care of almost all formatting issues for you. After configuring it to match your coding standards, you can rely on it to help keep your code neat and organized.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Like all Emacs programming modes, IDLWAVE performs code indentation.
The TAB key indents the current line relative to context.
LFD insert a newline and indents the new line. The indentation is
governed by a number of variables. IDLWAVE indents blocks (between
PRO/FUNCTION/BEGIN and END), and
continuation lines.
To re-indent a larger portion of code (e.g. when working with foreign
code written with different conventions), use C-M-\
(indent-region) after marking the relevant code. Useful marking
commands are C-x h (the entire file) or C-M-h (the current
subprogram). The command C-M-q reindents the entire current
routine. See section Actions, for information how to impose additional
formatting conventions on foreign code.
2)
Extra indentation for the main block of code. That is the block between the FUNCTION/PRO statement and the END statement for that program unit.
3)
Extra indentation applied to block lines. If you change this, you
probably also want to change idlwave-end-offset.
-3)
Extra indentation applied to block END lines. A value equal to negative
idlwave-block-indent will make END lines line up with the block
BEGIN lines.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Continuation lines (following a line ending with $) can receive a
fixed indentation offset from the main level, but in several situations
IDLWAVE can use a special form of indentation which aligns continued
statements more naturally. Special indentation is calculated for
continued routine definition statements and calls, enclosing parentheses
(like function calls, structure/class definitions, explicit structures
or lists, etc.), and continued assignments. An attempt is made to line
up with the first non-whitespace character after the relevant opening
punctuation mark (,,(,{,[,=). For
lines without any non-comment characters on the line with the opening
punctuation, the continued line(s) are aligned just past the
punctuation. An example:
function foo, a, b, $
c, d
bar = sin( a + b + $
c + d)
end
|
The only drawback to this special continued statement indentation is that it consumes more space, e.g., for long function names or left hand sides of an assignment:
function thisfunctionnameisverylongsoitwillleavelittleroom, a, b, $
c, d
|
You can instruct IDLWAVE when to avoid using this special continuation
indentation by setting the variable
idlwave-max-extra-continuation-indent, which specifies the
maximum additional indentation beyond the basic indent to be
tolerated, otherwise defaulting to a fixed-offset from the enclosing
indent (the size of which offset is set in
idlwave-continuation-indent). As a special case, continuations
of routine calls without any arguments or keywords will not
align the continued line, under the assumption that you continued
because you needed the space.
Also, since the indentation level can be somewhat dynamic in continued
statements with special continuation indentation, especially if
idlwave-max-extra-continuation-indent is small, the key
C-u TAB will re-indent all lines in the current statement.
Note that idlwave-indent-to-open-paren, if non-nil,
overrides the idlwave-max-extra-continuation-indent limit, for
parentheses only, forcing them always to line up.
2)
Extra indentation applied to normal continuation lines.
20)
The maximum additional indentation (over the basic continuation-indent)
that will be permitted for special continues. To effectively disable
special continuation indentation, set to 0. To enable it
constantly, set to a large number (like 100). Note that the
indentation in a long continued statement never decreases from line to
line, outside of nested parentheses statements.
t)
Non-nil means indent continuation lines to innermost open
parenthesis, regardless of whether the
idlwave-max-extra-continuation-indent limit is satisfied.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In IDL, lines starting with a `;' are called comment lines. Comment lines are indented as follows:
| The indentation of lines starting with three semicolons remains unchanged. |
| Lines starting with two semicolons are indented like the surrounding code. |
| Lines starting with a single semicolon are indented to a minimum column. |
The indentation of comments starting in column 0 is never changed.
The indentation of a comment starting with this regexp will not be changed.
A comment anchored at the beginning of line.
A comment that starts with this regexp is indented as if it is a part of IDL code.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In IDL, a newline character terminates a statement unless preceded by a
`$'. If you would like to start a continuation line, use
M-RET, which calls the command idlwave-split-line.
It inserts the continuation character `$', terminates the line and
indents the new line. The command M-RET can also be invoked
inside a string to split it at that point, in which case the `+'
concatenation operator is used.
When filling comment paragraphs, IDLWAVE overloads the normal filling
functions and uses a function which creates the hanging paragraphs
customary in IDL routine headers. When auto-fill-mode is turned
on (toggle with C-c C-a), comments will be auto-filled. If the
first line of a paragraph contains a match for
idlwave-hang-indent-regexp (a dash-space by default), subsequent
lines are positioned to line up after it, as in the following example.
;================================= ; x - an array containing ; lots of interesting numbers. ; ; y - another variable where ; a hanging paragraph is used ; to describe it. ;================================= |
You can also refill a comment at any time paragraph with M-q. Comment delimiting lines as in the above example, consisting of one or more `;' followed by one or more of the characters `+=-_*', are kept in place, as is.
t)
Non-nil means auto fill will only operate on comment lines.
t)
Non-nil means auto fill will split strings with the IDL `+'
operator.
t)
Non-nil means idlwave-split-line will split strings with
`+'.
t)
Non-nil means comment paragraphs are indented under the hanging
indent given by idlwave-hang-indent-regexp match in the first
line of the paragraph.
"- ")
Regular expression matching the position of the hanging indent in the first line of a comment paragraph.
nil)
Non-nil means use last match on line for
idlwave-indent-regexp.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Highlighting of keywords, comments, strings etc. can be accomplished
with font-lock. If you are using global-font-lock-mode
(in Emacs), or have font-lock turned on in any other buffer in
XEmacs, it should also automatically work in IDLWAVE buffers. If you'd
prefer invoking font-lock individually by mode, you can enforce it in
idlwave-mode with the following line in your `.emacs':
(add-hook 'idlwave-mode-hook 'turn-on-font-lock) |
IDLWAVE supports 3 increasing levels of syntax highlighting.
The variable font-lock-maximum-decoration determines which level
is selected. Individual categories of special tokens can be selected
for highlighting using the variable
idlwave-default-font-lock-items.
Items which should be fontified on the default fontification level 2.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A rare syntax highlighting problem results from an extremely unfortunate
notation for octal numbers in IDL: "123. This unpaired quotation
mark is very difficult to parse, given that it can be mixed on a single
line with any number of strings. Emacs will incorrectly identify this
as a string, and the highlighting of following lines of code can be
distorted, since the string is never terminated.
One solution to this involves terminating the mistakenly identified string yourself by providing a closing quotation mark in a comment:
string("305B) + $ ;" <--- for font-lock
' is an Angstrom.'
|
A far better solution is to abandon this notation for octals altogether, and use the more sensible alternative IDL provides:
string('305'OB) + ' is an Angstrom.'
|
This simultaneously solves the font-lock problem and is more
consistent with the notation for hexadecimal numbers, e.g. 'C5'XB.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
IDL comes bundled with more than one thousand procedures, functions
and object methods, and large libraries typically contain hundreds or
even thousands more (each with a few to tens of keywords and
arguments). This large command set can make it difficult to remember
the calling sequence and keywords for the routines you use, but
IDLWAVE can help. It builds up routine information from a wide
variety of sources; IDLWAVE in fact knows far more about the
`.pro' routines on your system than IDL itself! It maintains a
list of all built-in routines, with calling sequences and
keywords(3). It also scans Emacs buffers
for routine definitions, queries the IDLWAVE-Shell for information
about routines currently compiled there, and automatically locates
library and user-created catalogs. This information is updated
automatically, and so should usually be current. To force a global
update and refresh the routine information, use C-c C-i
(idlwave-update-routine-info).
To display the information about a routine, press C-c ?, which
calls the command idlwave-routine-info. When the current cursor
position is on the name or in the argument list of a procedure or
function, information will be displayed about the routine. For example,
consider the indicated cursor positions in the following line:
plot,x,alog(x+5*sin(x) + 2), | | | | | | | | 1 2 3 4 5 6 7 8 |
On positions 1,2 and 8, information about the `plot' procedure will be shown. On positions 3,4, and 7, the `alog' function will be described, while positions 5 and 6 will investigate the `sin' function.
When you ask for routine information about an object method, and the
method exists in several classes, IDLWAVE queries for the class of the
object, unless the class is already known through a text property on the
`->' operator (see section Object Method Completion and Class Ambiguity), or by having been explicity included in the call
(e.g. a->myclass::Foo).
The description displayed contains the calling sequence, the list of keywords and the source location of this routine. It looks like this:
Usage: XMANAGER, NAME, ID
Keywords: BACKGROUND CATCH CLEANUP EVENT_HANDLER GROUP_LEADER
JUST_REG MODAL NO_BLOCK
Source: SystemLib [LCSB] /soft1/idl53/lib/xmanager.pro
|
If a definition of this routine exists in several files accessible to IDLWAVE, several `Source' lines will point to the different files. This may indicate that your routine is shadowing a system library routine, which may or may not be what you want (see section Load-Path Shadows). The information about the calling sequence and keywords is derived from the first source listed. Library routines are available only if you have scanned your local IDL directories or are using pre-scanned libraries (see section Catalogs). The source entry consists of a source category, a set of flags and the path to the source file. The following default categories exist:
System | A system routine of unknown origin. When the system library has been scanned as part of a catalog (see section Catalogs), this category will automatically split into the next two. |
Builtin | A builtin system routine with no source code available. |
SystemLib | A library system routine in the official lib directory `!DIR/lib'. |
Obsolete | A library routine in the official lib directory `!DIR/lib/obsolete'. |
Library | A routine in a file on IDL's search path |
Other | Any other routine with a file not known to be on the search path. |
Unresolved | An otherwise unkown routine the shell lists as unresolved (referenced, but not compiled). |
Any routines discovered in library catalogs (see section Library Catalogs), will display the category assigned during creation,
e.g. `NasaLib'. For routines not discovered in this way, you can
create additional categories based on the routine's filename using the
variable idlwave-special-lib-alist.
The flags [LCSB] indicate the source of the information IDLWAVE
has regarding the file: from a library catalog ([L---]),
from a user catalog ([-C--], from the IDL Shell
([--S-]) or from an Emacs buffer ([---B]).
Combinations are possible (a compiled library routine visited in a
buffer might read [L-SB]). If a file contains multiple
definitions of the same routine, the file name will be prefixed with
`(Nx)' where `N' is the number of definitions.
Some of the text in the `*Help*' routine info buffer will be active (it is highlighted when the mouse moves over it). Typically, clicking with the right mouse button invokes online help lookup, and clicking with the middle mouse button inserts keywords or visits files:
Usage | If online help is installed, a click with the right mouse button on the Usage: line will access the help for the routine (see section Online Help). |
Keyword | Online help about keywords is also available with the
right mouse button. Clicking on a keyword with the middle
mouse button will insert this keyword in the buffer from where
|
Source | Clicking with the middle mouse button on a `Source' line finds the source file of the routine and visits it in another window. Another click on the same line switches back to the buffer from which C-c ? was called. If you use the right mouse button, the source will not be visited by a buffer, but displayed in the online help window. |
Classes | The Classes line is only included in the routine info window if the current class inherits from other classes. You can click with the middle mouse button to display routine info about the current method in other classes on the inheritance chain, if such a method exists there. |
t)
Non-nil means resize the Routine-info `*Help*' window to
fit the content.
Alist of regular expressions matching special library directories.
5)
Maximum number of source files displayed in the Routine Info window.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For IDL system routines, extensive documentation is supplied with IDL. IDLWAVE can access the HTML version of this documentation very quickly and accurately, based on the local context. This can be much faster than using the IDL online help application, because IDLWAVE usually gets you to the right place in the documentation directly -- e.g. a specific keyword of a routine -- without any additional browsing and scrolling.
For this online help to work, an HTML version of the IDL documentation
is required. Beginning with IDL 6.2, HTML documentation is distributed
directly with IDL, along with an XML-based catalog of routine
information. By default, IDLWAVE automatically attempts to convert this
XML catalog into a format Emacs can more easily understand, and caches
this information in your idlwave_config_directory
(`~/.idlwave/', by default). It also re-scans the XML catalog if
it is newer than the current cached version. You can force rescan with
the menu entry IDLWAVE->Routine Info->Rescan XML Help Catalog.
Before IDL 6.2, the HTML help was not distributed with IDL, and was not part of the standalone IDLWAVE distribution, but had to be downloaded separately. This is no longer necessary: all help and routine information is supplied with IDL versions 6.2 and later.
There are a variety of options for displaying the HTML help: see below. Help for routines without HTML documentation is also available, by using the routine documentation header and/or routine source.
In any IDL program (or, as with most IDLWAVE commands, in the IDL
Shell), press M-? (idlwave-context-help), or click with
S-Mouse-3 to access context sensitive online help. The following
locations are recognized context for help:
Routine names | The name of a routine (function, procedure, method). |
Keyword Parameters | A keyword parameter of a routine. |
System Variables | System variables like |
System Variable Tags | System variables tags like |
IDL Statements | Statements like |
IDL Controls | Control structures like |
Class names | A class name in an |
Class Init Keywords | Beyond the class name in an |
Executive Command | An executive command like |
Structure Tags | Structure tags like |
Class Tags | Class tags like |
Default | The routine that would be selected for routine info display. |
Note that the OBJ_NEW function is special in that the help
displayed depends on the cursor position. If the cursor is on the
`OBJ_NEW', this function is described. If it is on the class
name inside the quotes, the documentation for the class is pulled up.
If the cursor is after the class name, anywhere in the argument
list, the documentation for the corresponding Init method and
its keywords is targeted.
Apart from an IDLWAVE buffer or shell, there are two more places from which online help can be accessed.
In both cases, a blue face indicates that the item is documented in the IDL manual, but an attempt will be made to visit non-blue items directly in the originating source file.
| 4.3.1 Help with HTML Documentation | ||
| 4.3.2 Help with Source |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Help using the HTML documentation is invoked with the built-in Emacs
command browse-url, which displays the relevant help topic in a
browser of your choosing. Beginning with version 6.2, IDL comes with
the help browser IDL Assistant, which it uses by default for
displaying online help on all supported platforms. This browser
offers topical searches, an index, and is also now the default and
recommended IDLWAVE help browser. The variable
idlwave-help-use-assistant controls whether this browser is
used. Note that, due to limitations in the Assistant, invoking help
within IDLWAVE and ? topic within IDL will result in two
running copies of Assistant.
Aside from the IDL Assistant, there are many possible browsers to choose
among, with differing advantages and disadvantages. The variable
idlwave-help-browser-function controls which browser help is sent
to (as long as idlwave-help-use-assistant is not set). This
function is used to set the variable browse-url-browser-function
locally for IDLWAVE help only. Customize the latter variable to see
what choices of browsers your system offers. Certain browsers like
w3 (bundled with many versions of Emacs) and w3m
(http://emacs-w3m.namazu.org/) are run within Emacs, and use
Emacs buffers to display the HTML help. This can be convenient,
especially on small displays, and images can even be displayed in-line
on newer Emacs versions. However, better formatting results are often
achieved with external browsers, like Mozilla. IDLWAVE assumes any
browser function containing "w3" is displayed in a local buffer. If you
are using another Emacs-local browser for which this is not true, set
the variable idlwave-help-browser-is-local.
With IDL 6.2 or later, it is important to ensure that the variable
idlwave-system-directory is set (see section Catalogs). One easy way
to ensure this is to run the IDL Shell (C-c C-s). It will be
queried for this directory, and the results will be cached to file for
subsequent use.
See section HTML Help Browser Tips, for more information on selecting and configuring a browser for use with IDL's HTML help system.
Relative directory of the system-supplied HTML help directory,
considered with respect to idlwave-system-directory. Relevant
for IDL 6.2 and greater. Should not change.
The directory where the `idl_html_help' HTML directory live.
Obsolete and ignored for IDL 6.2 and greater
(idlwave-html-system-help-location is used instead).
t
If set, use the IDL Assistant if possible for online HTML help,
otherwise use the browser function specified in
idlwave-help-browser-function.
The browser function to use to display IDLWAVE HTML help. Should be
one of the functions available for setting
browse-url-browser-function, which see.
Is the browser selected in idlwave-help-browser-function run in a
local Emacs buffer or window? Defaults to t if the function
contains "-w3".
The face for links to IDLWAVE online help.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For routines which are not documented in an HTML manual (for example
personal or library routines), the source code itself is used as help
text. If the requested information can be found in a (more or less)
standard DocLib file header, IDLWAVE shows the header (scrolling down to
a keyword, if appropriate). Otherwise the routine definition statement
(pro/function) is shown. The doclib header sections which
are searched for include `NAME' and `KEYWORDS'. Localization
support can be added by customizing the idlwave-help-doclib-name
and idlwave-help-doclib-keyword variables.
Help is also available for class structure tags (self.TAG), and
generic structure tags, if structure tag completion is enabled
(see section Structure Tag Completion). This is implemented by visiting the
tag within the class or structure definition source itself. Help is not
available on built-in system class tags.
The help window is normally displayed in the same frame, but can be popped-up in a separate frame. The following commands can be used to navigate inside the help system for source files:
SPACE | Scroll forward one page. |
RET | Scroll forward one line. |
DEL | Scroll back one page. |
h | Jump to DocLib Header of the routine whose source is displayed as help. |
H | Jump to the first DocLib Header in the file. |
. (Dot) | Jump back and forth between the routine definition (the
|
F | Fontify the buffer like source code. See the variable |
q | Kill the help window. |
nil)
Non-nil means use a separate frame for Online Help if possible.
The frame parameters for the special Online Help frame.
20)
Maximum number of items per pane in pop-up menus.
Function to call for help if the normal help fails.
nil)
Non-nil means fontify source code displayed as help.
t)
Non-nil means try to find help in routine header when
displaying source file.
"name")
The case-insensitive heading word in doclib headers to locate the
name section. Can be a regexp, e.g. "\\(name\\|nom\\)".
"KEYWORD")
The case-insensitive heading word in doclib headers to locate the keywords section. Can be a regexp.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
IDLWAVE offers completion for class names, routine names, keywords,
system variables, system variable tags, class structure tags, regular
structure tags and file names. As in many programming modes, completion
is bound to M-TAB (or simply TAB in the IDLWAVE
Shell -- see section Using the Shell). Completion uses exactly the same
internal information as routine info, so when necessary (rarely) it can
be updated with C-c C-i (idlwave-update-routine-info).
The completion function is context sensitive and figures out what to complete based on the location of the point. Here are example lines and what M-TAB would try to complete when the cursor is on the position marked with a `_':
plo_ Procedure x = a_ Function plot,xra_ Keyword of |
The only place where completion is ambiguous is procedure/function keywords versus functions. After `plot,x,_', IDLWAVE will always assume a keyword to `plot'. However, a function is also a possible completion here. You can force completion of a function name at such a location by using a prefix arg: C-u M-TAB.
Giving two prefix arguments (C-u C-u M-TAB) prompts for a regular expression to search among the commands to be completed. As an example, completing a blank line in this way will allow you to search for a procedure matching a regexp.
If the list of completions is too long to fit in the `*Completions*' window, the window can be scrolled by pressing M-TAB repeatedly. Online help (if installed) for each possible completion is available by clicking with Mouse-3 on the item. Items for which system online help (from the IDL manual) is available will be emphasized (e.g. colored blue). For other items, the corresponding source code or DocLib header will be used as the help text.
Completion is not a blocking operation -- you are free to continue editing, enter commands, or simply ignore the `*Completions*' buffer during a completion operation. If, however, the most recent command was a completion, C-g will remove the buffer and restore the window configuration. You can also remove the buffer at any time with no negative consequences.
t)
Non-nil means completion automatically adds `=' after
completed keywords.
t)
Non-nil means completion automatically adds `(' after
completed function. A value of `2' means also add the closing
parenthesis and position the cursor between the two.
t)
Non-nil means restore window configuration after successful
completion.
t)
Non-nil means highlight completions for which system help is
available.
| 4.4.1 Case of Completed Words | CaseOFcomPletedWords | |
| 4.4.2 Object Method Completion and Class Ambiguity | obj->Method, what? | |
| 4.4.3 Object Method Completion in the Shell | ||
| 4.4.4 Class and Keyword Inheritance | obj->Method, _EXTRA=e | |
| 4.4.5 Structure Tag Completion | Completing state.Tag |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
IDL is a case-insensitive language, so casing is a matter of style
only. IDLWAVE helps maintain a consistent casing style for completed
items. The case of the completed words is determined by what is
already in the buffer. As an exception, when the partial word being
completed is all lower case, the completion will be lower case as
well. If at least one character is upper case, the string will be
completed in upper case or mixed case, depending on the value of the
variable idlwave-completion-case. The default is to use upper
case for procedures, functions and keywords, and mixed case for object
class names and methods, similar to the conventions in the IDL
manuals. For instance, to enable mixed-case completion for routines
in addition to classes and methods, you need an entry such as
(routine . preserve) in that variable. To enable total control
over the case of completed items, independent of buffer context, set
idlwave-completion-force-default-case to non-nil.
Association list setting the case (UPPER/lower/Capitalized/MixedCase...) of completed words.
nil)
Non-nil means completion will always honor the settings in
idlwave-completion-case. When nil (the default), entirely lower
case strings will always be completed to lower case, no matter what the
settings in idlwave-completion-case.
nil)
Non-nil means the empty string is considered lower case for
completion.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
An object method is not uniquely determined without the object's class.
Since the class is almost always omitted in the calling source (as
required to obtain the true benefits of object-based programming),
IDLWAVE considers all available methods in all classes as possible
method name completions. The combined list of keywords of the current
method in all known classes which contain that method will be
considered for keyword completion. In the `*Completions*' buffer,
the matching classes will be shown next to each item (see option
idlwave-completion-show-classes). As a special case, the class
of an object called `self' is always taken to be the class of the
current routine, when in an IDLWAVE buffer. All inherits classes are
considered as well.
You can also call idlwave-complete with a prefix arg: C-u
M-TAB. IDLWAVE will then prompt you for the class in order to
narrow down the number of possible completions. The variable
idlwave-query-class can be configured to make such prompting the
default for all methods (not recommended), or selectively for very
common methods for which the number of completing keywords would be too
large (e.g. Init,SetProperty,GetProperty).
After you have specified the class for a particular statement (e.g. when
completing the method), IDLWAVE can remember it for the rest of the
editing session. Subsequent completions in the same statement
(e.g. keywords) can then reuse this class information. This works by
placing a text property on the method invocation operator `->',
after which the operator will be shown in a different face (bold by
default). The variable idlwave-store-inquired-class can be used
to turn it off or on.
1)
Non-nil means show up to that many classes in
`*Completions*' buffer when completing object methods and
keywords.
t)
Non-nil means fontify the classes in completions buffer.
nil)
Association list governing query for object classes during completion.
t)
Non-nil means store class of a method call as text property on
`->'.
Face to highlight object operator arrows `->' which carry a saved class text property.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In the IDLWAVE Shell (see section The IDLWAVE Shell), objects on which
methods are being invoked have a special property: they must exist as
variables, and so their class can be determined (for instance, using the
obj_class() function). In the Shell, when attempting completion,
routine info, or online help within a method routine, a query is sent to
determine the class of the object. If this query is successful, the
class found will be used to select appropriate completions, routine
info, or help. If unsuccessful, information from all known classes will
be used (as in the buffer).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Class inheritance affects which methods are called in IDL. An object of
a class which inherits methods from one or more superclasses can
override that method by defining its own method of the same name, extend
the method by calling the method(s) of its superclass(es) in its
version, or inherit the method directly by making no modifications.
IDLWAVE examines class definitions during completion and routine
information display, and records all inheritance information it finds.
This information is displayed if appropriate with the calling sequence
for methods (see section Routine Info), as long as variable
idlwave-support-inheritance is non-nil.
In many class methods, keyword inheritance (_EXTRA and
_REF_EXTRA) is used hand-in-hand with class inheritance and
method overriding. E.g., in a SetProperty method, this technique
allows a single call obj->SetProperty to set properties up the
entire class inheritance chain. This is often referred to as
chaining, and is characterized by chained method calls like
self->MySuperClass::SetProperty,_EXTRA=e.
IDLWAVE can accomodate this special synergy between class and keyword
inheritance: if _EXTRA or _REF_EXTRA is detected among a
method's keyword parameters, all keywords of superclass versions of
the method being considered can be included in completion. There is
of course no guarantee that this type of keyword chaining actually
occurrs, but for some methods it's a very convenient assumption. The
variable idlwave-keyword-class-inheritance can be used to
configure which methods have keyword inheritance treated in this
simple, class-driven way. By default, only Init and
(Get|Set)Property are. The completion buffer will label
keywords based on their originating class.
t)
Non-nil means consider inheritance during completion, online help etc.
A list of regular expressions to match methods for which simple class-driven keyword inheritance will be used for Completion.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In many programs, especially those involving widgets, large structures
(e.g. the `state' structure) are used to communicate among
routines. It is very convenient to be able to complete structure tags,
in the same way as for instance variables (tags) of the `self'
object (see section Object Method Completion and Class Ambiguity). Add-in
code for structure tag completion is available in the form of a loadable
completion module: `idlw-complete-structtag.el'. Tag completion in
structures is highly ambiguous (much more so than `self'
completion), so idlw-complete-structtag makes an unusual and very
specific assumption: the exact same variable name is used to refer to
the structure in all parts of the program. This is entirely unenforced
by the IDL language, but is a typical convention. If you consistently
refer to the same structure with the same variable name
(e.g. `state'), structure tags which are read from its definition
in the same file can be used for completion.
Structure tag completion is not enabled by default. To enable it, simply add the following to your `.emacs':
(add-hook 'idlwave-load-hook
(lambda () (require 'idlw-complete-structtag)))
|
Once enabled, you'll also be able to access online help on the structure tags, using the usual methods (see section Online Help). In addition, structure variables in the shell will be queried for tag names, similar to the way object variables in the shell are queried for method names. So, e.g.:
IDL> st.[Tab] |
will complete with all structure fields of the structure
st.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In addition to clicking on a Source: line in the routine info
window, there is another way to quickly visit the source file of a
routine. The command C-c C-v (idlwave-find-module) asks
for a module name, offering the same default as
idlwave-routine-info would have used, taken from nearby buffer
contents. In the minibuffer, specify a complete routine name (including
any class part). IDLWAVE will display the source file in another
window, positioned at the routine in question. You can also limit this
to a routine in the current buffer only, with completion, and a
context-sensitive default, by using a single prefix (C-u C-c C-v)
or the convenience binding C-c C-t.
Since getting the source of a routine into a buffer is so easy with
IDLWAVE, too many buffers visiting different IDL source files are
sometimes created. The special command C-c C-k
(idlwave-kill-autoloaded-buffers) can be used to easily remove
these buffers.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The key sequence C-c = calls the command idlwave-resolve
and sends the line `RESOLVE_ROUTINE, 'routine_name'' to IDL
in order to resolve (compile) it. The default routine to be resolved is
taken from context, but you get a chance to edit it. Usually this is
not necessary, since IDL automatically discovers routines on its path.
idlwave-resolve is one way to get a library module within reach
of IDLWAVE's routine info collecting functions. A better way is to
keep routine information available in catalogs (see section Catalogs).
Routine info on modules will then be available without the need to
compile the modules first, and even without a running shell.
See section Sources of Routine Info, for more information on the ways IDLWAVE collects data about routines, and how to update this information.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |