1 \input texinfo @c -*-texinfo-*-
3 @setfilename ../info/idlwave
4 @settitle IDLWAVE User Manual
7 * IDLWAVE: (idlwave). Major mode and shell for IDL and WAVE/CL files.
15 @set NSYSROUTINES 1226
16 @set NSYSKEYWORDS 5229
17 @set DATE February 2000
18 @set AUTHOR Carsten Dominik
19 @set AUTHOR-EMAIL dominik@@astro.uva.nl
20 @set MAINTAINER Carsten Dominik
21 @set MAINTAINER-EMAIL dominik@@astro.uva.nl
26 This file documents IDLWAVE, a major mode for editing IDL and
27 WAVE/CL files with Emacs. It also implements a shell for running IDL as
30 This is edition @value{EDITION} of the IDLWAVE User Manual for
31 IDLWAVE @value{VERSION}@refill
33 Copyright (c) 1999, 2000 Free Software Foundation, Inc.
35 Permission is granted to make and distribute verbatim
36 copies of this manual provided the copyright notice and
37 this permission notice are preserved on all copies.
40 Permission is granted to process this file through TeX
41 and print the results, provided the printed document
42 carries a copying permission notice identical to this
43 one except for the removal of this paragraph (this
44 paragraph not being relevant to the printed manual).
47 Permission is granted to copy and distribute modified
48 versions of this manual under the conditions for
49 verbatim copying, provided that the entire resulting
50 derived work is distributed under the terms of a permission
51 notice identical to this one.
53 Permission is granted to copy and distribute
54 translations of this manual into another language,
55 under the above conditions for modified versions,
56 except that this permission notice may be stated in a
57 translation approved by the Free Software Foundation.
61 @title IDLWAVE User Manual
62 @subtitle Major Emacs mode and shell for IDL and WAVE/CL files
63 @subtitle Edition @value{EDITION}, @value{DATE}
65 @author by Carsten Dominik
67 Copyright @copyright{} 1999, 2000 Free Software Foundation, Inc.
70 This is edition @value{EDITION} of the @cite{IDLWAVE User Manual} for
71 IDLWAVE version @value{VERSION}, @value{DATE}.@refill
75 Permission is granted to make and distribute verbatim
76 copies of this manual provided the copyright notice and
77 this permission notice are preserved on all copies.
79 Permission is granted to copy and distribute modified
80 versions of this manual under the conditions for
81 verbatim copying, provided that the entire resulting
82 derive work is distributed under the terms of a permission
83 notice identical to this one.
85 Permission is granted to copy and distribute
86 translations of this manual into another language,
87 under the above conditions for modified versions,
88 except that this permission notice may be stated in a
89 translation approved by the Free Software Foundation.
95 @node Top, Introduction, (dir), (dir)
97 IDLWAVE is a package to support editing command files for the
98 Interactive Data Language (IDL), and for running IDL as an inferior
104 * Introduction:: What IDLWAVE is and what not
105 * IDLWAVE in a Nutshell:: One page quick-start guide
106 * The IDLWAVE Major Mode:: The mode to edit IDL programs
107 * The IDLWAVE Shell:: The mode to run IDL as inferior program
108 * Installation:: How to Install or Upgrade
109 * Acknowledgement:: Who helped
110 * Sources of Routine Info:: How does IDLWAVE know about routine XYZ
111 * Configuration Examples:: The user is king...
112 * Index:: Fast access
116 --- The Detailed Node Listing ---
118 The IDLWAVE Major Mode
120 * Code Formatting:: Making code look nice
121 * Routine Info:: Calling Sequences and Keywords
122 * Completion:: Completing routine names and Keywords
123 * Code Templates:: Abbreviations for frequent constructs
124 * Actions:: Changing case, Padding, End checking
125 * Doc Header:: Inserting a standard header
126 * Motion Commands:: Moving through the structure of a program
127 * Misc Options:: Things that fit nowhere else
131 * Code Indentation:: Reflecting the logical structure
132 * Comment Indentation:: Special indentation for comment lines
133 * Continuation Lines:: Splitting statements over lines
134 * Syntax Highlighting:: Font-lock support
138 * Block Boundary Check:: Is the END correct
139 * Padding Operators:: Enforcing space around `=' etc
140 * Case Changes:: Enforcing upper case keywords
144 * Starting the Shell:: How to launch IDL as a subprocess
145 * Using the Shell:: Interactively working with the Shell
146 * Debugging IDL Programs:: Compilation/Debugging
148 Debugging IDL Programs
150 * Compiling Programs:: Compiling buffers under the shell
151 * Breakpoints and Stepping:: Deciding where to stop and look
152 * Examining Variables:: What is the value now?
156 * Installing IDLWAVE:: How to install the distribution
157 * Upgrading from idl.el:: Necessary configuration changes
159 Sources of Routine Info
161 * Routine Definitions:: Where IDL Routines are defined.
162 * Routine Information Sources:: So how does IDLWAVE know about...
163 * Library Scan:: Scanning the Libraries for Routine Info
164 * Updating idlw-rinfo.el:: Scanning the Reference Manual
168 @node Introduction, IDLWAVE in a Nutshell, Top, Top
169 @chapter Introduction
171 @cindex CORBA (Common Object Request Broker Architecture)
173 @cindex Feature overview
175 IDLWAVE is a package to support editing command files for the
176 Interactive Data Language (IDL), and for running IDL as an inferior
177 shell. It also can be used for WAVE/CL command files, but the support
178 for these is limited. Note that this package has nothing to do with the
179 Interface Definition Language as part of the Common Object Request
180 Broker Architecture (CORBA).
182 IDLWAVE is the successor to the @file{idl.el} and @file{idl-shell.el}
183 files written by Chris Chase. The modes and files had to be renamed
184 because of a name space conflict with CORBAs @code{idl-mode}, defined in
185 Emacs in the file @file{cc-mode.el}. If you have been using the old
186 files, check @ref{Upgrading from idl.el} for information on how to
189 IDLWAVE consists of two parts: A major mode for editing command files
190 (@code{idlwave-mode}) and a mode to allow running the IDL program as an
191 inferior shell (@code{idlwave-shell-mode}). Both modes work closely
192 together and form a complete development environment.@refill
194 Here is a brief summary of what IDLWAVE does.
198 Code indentation and formatting.
200 Font-lock support on three levels.
202 Display of calling sequence and keywords of more than 1000 IDL
205 Context sensitive completion of routine names and keywords.
207 Insertion of code templates.
209 Actions to enforce coding standards during typing.
211 Block structure check.
213 Documentation support.
215 Running IDL as inferior process.
217 Shell with history search, command line editing and completion.
219 Compilation, execution and debugging of programs directly from the source
222 Examining expressions with a mouse click.
227 Here are a number of screenshots showing IDLWAVE in action.
230 @uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/font-lock.gif,
231 XEmacs 21.1 with formatted and fontified code}
233 @uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/rinfo.gif,
234 XEmacs 21.1 displaying routine info}
236 @uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/complete.gif,
237 XEmacs 21.1 completing a keyword}
239 @uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/shell.gif,
240 XEmacs 21.1 with debugging toolbar; execution stopped at a breakpoint}
244 In this manual, each section contains a list of user options related to
245 the subject. Don't be confused by the shear number of options available
246 -- in most cases the default settings are just fine. The variables are
247 listed here to make sure you know where to look if you want to change
248 things. For a full description of what a particular variable does and
249 how to configure it, see the documentation string of that variable.
250 Some configuration examples are also given in the appendix.
252 @node IDLWAVE in a Nutshell, The IDLWAVE Major Mode, Introduction, Top
253 @chapter IDLWAVE in a Nutshell
255 @cindex Getting Started
256 @cindex IDLWAVE in a Nutshell
257 @cindex Nutshell, IDLWAVE in a
259 @subheading Editing IDL Programs
261 @multitable @columnfractions .15 .85
263 @tab Indent the current line relative to context.
265 @tab Re-indent all lines in the current region.
266 @item @kbd{M-@key{RET}}
267 @tab Start a continuation line. Or split the current line at point.
269 @tab Fill the current comment paragraph.
271 @tab Display calling sequence, keywords of the procedure/function call
273 @item @kbd{M-@key{TAB}}
274 @tab Complete a procedure name, function name or keyword in the buffer.
276 @tab Update IDLWAVE's knowledge about functions and procedures.
278 @tab Find the source code of a procedure/function.
280 @tab Insert a standard documentation header.
282 @tab Insert a new timestamp and history item in the documentation header.
285 @subheading Running the IDLWAVE Shell, Debugging Programs
287 @multitable @columnfractions .15 .85
289 @tab Start IDL as a subprocess and/or switch to the interaction buffer.
290 @item @kbd{C-u C-c C-s}
291 @tab Start the shell in a separate frame.
293 @tab Cycle back through IDL command history matching command line input.
296 @item @kbd{M-@key{TAB}}
297 @tab Complete a procedure name, function name or keyword in the shell buffer.
298 @item @kbd{C-c C-d C-c}
299 @tab Save and compile the source file in the current buffer.
300 @item @kbd{C-c C-d C-x}
301 @tab Goto next syntax error.
302 @item @kbd{C-c C-d C-b}
303 @tab Set a breakpoint at the current source line.
304 @item @kbd{C-c C-d C-d}
305 @tab Clear the current breakpoint.
306 @item @kbd{C-c C-d C-p}
307 @tab Ask IDL to print the value of the expression near point.
310 @subheading Commonly used Settings in @file{.emacs}
312 ;; Change the indentation preferences
313 (setq idlwave-main-block-indent 2 ; default 0
314 idlwave-block-indent 2 ; default 4
315 idlwave-end-offset -2) ; default -4
316 ;; Pad some operators with spaces
317 (setq idlwave-do-actions t
318 idlwave-surround-by-blank t)
319 ;; Automatically expand END to ENDIF, ENDELSE, ...
320 (setq idlwave-expand-generic-end t)
321 ;; Syntax Highlighting
322 (add-hook 'idlwave-mode-hook 'turn-on-font-lock)
324 ;; Automatically start the shell when needed, in dedicated frame
325 (setq idlwave-shell-automatic-start t
326 idlwave-shell-use-dedicated-frame t)
328 ;; Specify a file where library info can be stored.
329 (setq idlwave-libinfo-file "~/idlinfo.el")
332 @node The IDLWAVE Major Mode, The IDLWAVE Shell, IDLWAVE in a Nutshell, Top
333 @chapter The IDLWAVE Major Mode
334 @cindex IDLWAVE major mode
335 @cindex Major mode, @code{idlwave-mode}
337 The IDLWAVE major mode supports editing IDL and WAVE/CL command files.
338 In this chapter we describe the main features of the mode and how to
342 * Code Formatting:: Making code look nice
343 * Routine Info:: Calling Sequences and Keywords
344 * Completion:: Completing routine names and Keywords
345 * Code Templates:: Abbreviations for frequent constructs
346 * Actions:: Changing case, Padding, End checking
347 * Doc Header:: Inserting a standard header
348 * Motion Commands:: Moving through the structure of a program
349 * Misc Options:: Things that fit nowhere else
352 @node Code Formatting, Routine Info, The IDLWAVE Major Mode, The IDLWAVE Major Mode
353 @section Code Formatting
354 @cindex Code formatting
355 @cindex Formatting, of code
358 * Code Indentation:: Reflecting the logical structure
359 * Comment Indentation:: Special indentation for comment lines
360 * Continuation Lines:: Splitting statements over lines
361 * Syntax Highlighting:: Font-lock support
364 @node Code Indentation, Comment Indentation, Code Formatting, Code Formatting
365 @subsection Code Indentation
366 @cindex Code indentation
369 Like all Emacs programming modes, IDLWAVE performs code indentation.
370 The @key{TAB} key indents the current line relative to context.
371 @key{LFD} insert a newline and indents the new line. The indentation is
372 governed by a number of variables.
374 @cindex Foreign code, adapting
375 @cindex Indentation, of foreign code
376 To re-indent a larger portion of code (e.g. when working with foreign code
377 written with different conventions), use @kbd{M-C-\}
378 (@code{indent-region}) after marking the relevant code. Useful marking
379 commands are @kbd{C-x h} (the entire file) or @kbd{M-C-h} (the
380 current subprogram). @xref{Actions}, for information how to impose
381 additional formatting conventions on foreign code.
383 @defopt idlwave-main-block-indent (@code{0})
384 Extra indentation for the main block of code. That is the block between
385 the FUNCTION/PRO statement and the END statement for that program
389 @defopt idlwave-block-indent (@code{4})
390 Extra indentation applied to block lines. If you change this, you
391 probably also want to change @code{idlwave-end-offset}.@refill
394 @defopt idlwave-end-offset (@code{-4})
395 Extra indentation applied to block END lines. A value equal to negative
396 @code{idlwave-block-indent} will make END lines line up with the block
400 @defopt idlwave-continuation-indent (@code{2})
401 Extra indentation applied to continuation lines and insided unbalanced
405 @node Comment Indentation, Continuation Lines, Code Indentation, Code Formatting
406 @subsection Comment Indentation
407 @cindex Comment indentation
408 @cindex Hanging paragraphs
409 @cindex Paragraphs, filling
410 @cindex Paragraphs, hanging
412 In IDL, lines starting with a @samp{;} are called @emph{comment lines}.
413 Comment lines are indented as follows:
415 @multitable @columnfractions .1 .90
417 @tab The indentation of lines starting with three semicolons remains
420 @tab Lines starting with two semicolons are indented like the surrounding code.
422 @tab Lines starting with a single semicolon are indent to a minimum column.
425 The indentation of comments starting in column 0 is never changed.
427 @defopt idlwave-no-change-comment
428 The indentation of a comment that starts with this regular
429 expression will not be changed.
432 @defopt idlwave-begin-line-comment
433 A comment anchored at the beginning of line. A comment matched by this
434 regular expression will not have its indentation changed.@refill
437 @defopt idlwave-code-comment
438 A comment that starts with this regular expression on a line by itself
439 is indented as if it is a part of IDL code.@refill
442 @node Continuation Lines, Syntax Highlighting, Comment Indentation, Code Formatting
443 @subsection Continuation Lines and Filling
444 @cindex Continuation lines
445 @cindex Line splitting
446 @cindex Splitting, of lines
448 @cindex @code{auto-fill-mode}
449 @cindex Hanging paragraphs
451 In IDL, a newline character terminates a statement unless preceded by a
452 @samp{$}. If you would like to start a continuation line, use
453 @kbd{M-@key{RET}} which calls the command @code{idlwave-split-line}. It
454 inserts a @samp{$} to indicate that the following line is a continuation
455 of the current line, terminates the line with a newline and indents the
456 new line. The command @kbd{M-@key{RET}} can also be used in the middle
457 of a line to split the line at that point. When used inside a long
458 string constant, the string is split with the @samp{+} concatenation
459 operator. You could even use @code{auto-fill-mode} to automatically
460 break code lines into several lines while you type. For this, set the
461 variable @code{idlwave-fill-comment-line-only} to @code{nil} and turn on
462 @code{auto-fill-mode}. @code{auto-fill-mode} can be toggled with
465 When filling comment paragraphs, IDLWAVE overloads the normal filling
466 functions and uses a function which creates hanging paragraphs as they
467 are customary in the IDL routine headers. When @code{auto-fill-mode} is
468 turned on, comments will be auto-filled. If the first line of a
469 paragraph is matched by @code{idlwave-hang-indent-regexp}, subsequent
470 lines are indented to after the position of this match, as in the
475 ; x - an array containing
476 ; lots of interesting numbers.
478 ; y - another variable where
479 ; a hanging paragraph is used
483 You also refill a comment paragraph with @kbd{M-q}.
485 @defopt idlwave-fill-comment-line-only (@code{t})
486 Non-@code{nil} means auto fill will only operate on comment lines.
489 @defopt idlwave-auto-fill-split-string (@code{t})
490 Non-@code{nil} means auto fill will split strings with the IDL @samp{+}
494 @defopt idlwave-split-line-string (@code{t})
495 Non-@code{nil} means @code{idlwave-split-line} will split strings with
499 @defopt idlwave-hanging-indent
500 Non-@code{nil} means comment paragraphs are indented under the hanging
501 indent given by @code{idlwave-hang-indent-regexp} match in the first
502 line of the paragraph.@refill
505 @defopt idlwave-hang-indent-regexp
506 Regular expression matching the position of the hanging indent
507 in the first line of a comment paragraph.@refill
510 @defopt idlwave-use-last-hang-indent (@code{nil})
511 Non-@code{nil} means use last match on line for
512 @code{idlwave-indent-regexp}.@refill
515 @node Syntax Highlighting, , Continuation Lines, Code Formatting
516 @subsection Syntax Highlighting
517 @cindex Syntax highlighting
520 Highlighting of keywords, comments, strings etc. can be accomplished
521 with @code{font-lock}. To enable @code{font-lock} for IDL files, place
522 the following line into your @file{.emacs} (see
523 @ref{Configuration Examples})@refill
526 (add-hook 'idlwave-mode-hook 'turn-on-font-lock)
529 IDLWAVE supports 3 levels of syntax highlighting. The variable
530 @code{font-lock-maximum-decoration} determines which level is selected.
532 @defopt idlwave-default-font-lock-items
533 Items which should be fontified on the default fontification level
537 @node Routine Info, Completion, Code Formatting, The IDLWAVE Major Mode
538 @section Routine Info
541 IDL defines more than one thousand procedures, functions and object
542 methods. This large command set makes it difficult to remember the
543 calling sequence and keywords of a command. IDLWAVE contains a list of
544 all builtin routines with calling sequences and keywords@footnote{This
545 list was created by scanning the IDL manual and might contain (very few)
546 errors. Please report any detected errors to the maintainer, so that
547 they can be fixed.}. It also scans Emacs buffers and library files for
548 routine definitions and queries the IDLWAVE-Shell for the properties of
549 modules currently compiled under the shell. When you have edited a
550 buffer or compiled additional routines under the shell, use @kbd{C-c
551 C-i} (@code{idlwave-update-routine-info}) to update IDLWAVE's idea about
552 these routines.@refill
554 To display the information about a routine, press @kbd{C-c ?} which
555 calls the command @code{idlwave-routine-info}. When the current cursor
556 position is on the name or in the argument list of a procedure or
557 function, information will be displayed about the routine. For example,
558 consider the cursor positions in the following line
561 plot,x,alog(x+5*sin(x) + 2),
565 @cindex Object methods
566 On positions 1,2 and 8, information about the @samp{plot} procedure will
567 be shown. On positions 3,4, and 7, the @samp{alog} function will be
568 described, while positions 5 and 6 will select the @samp{sin} function.
569 When you ask for routine information about an object method, and the
570 method exists in several classes, IDLWAVE queries for the class of the
573 @cindex Calling sequences
574 @cindex Keywords of a routine
575 The description displayed contains the calling sequence, the list of
576 keywords and the origin of this information (@emph{system routine},
577 @emph{library routine}, @emph{Emacs buffer}, or @emph{compiled
578 module}). It looks like this:
581 Usage: MAP_PROJ_INFO, iproj
582 Keywords: CIRCLE CURRENT CYLINDRICAL NAME UV_LIMITS WIDTH
583 Origin: buffer visiting /soft1/idl/lib/map_set.pro
586 Some of the text in the @file{*Help*} buffer will be active (it
587 highlights when you move the mouse over it). Clicking with the middle
588 mouse button on any of the active fields will try to find the source file of
589 the routine and display it in another window. Another click on the same
590 line will switch back to the buffer from which @kbd{C-c ?} was
591 called. Clicking with the right mouse button on an active field will
592 search the IDL online help for this item.@refill
594 @cindex Routine source file
595 @cindex Module source file
596 Another way to find the source file of a routine is the command @kbd{C-c
597 C-v} (@code{idlwave-find-module}). It asks for a module name, offering
598 the same default as @code{idlwave-routine-info} would have used. In the
599 minibuffer, specify a complete routine name (including the class part).
600 IDLWAVE will display the source file in another window.@refill
602 @cindex @code{RESOLVE_ROUTINE}
603 @cindex Compiling library modules
604 @cindex Routines, resolving
605 @cindex Online help, for IDL routines
606 The two other commands that work with the routine at point need a
607 running IDLWAVE shell. The key sequence @kbd{M-?} calls the command
608 @code{idlwave-routine-info-from-idlhelp}. This sends the command line
609 @samp{ONLINE_HELP, '@var{routine_name}'} to IDL in order to display the
610 documentation of the routine in the IDL online documentation. The key
611 sequence @kbd{C-c =} calls the command @code{idlwave-resolve} and sends
612 the line @samp{RESOLVE_ROUTINE, '@var{routine_name}'} to IDL in order to
613 resolve (compile) it.
615 @code{idlwave-resolve} is one way to get a library module within reach
616 of IDLWAVE's routine info collecting functions. A better way is to
617 prescan (parts of) the library (@pxref{Library Scan}). Routine info on
618 library modules will then be available without the need to compile the
619 modules first, and even without a running shell.
621 @xref{Sources of Routine Info}, for in-depth information where IDLWAVE
622 collects data about routines, and how to update this information.
624 @defopt idlwave-scan-all-buffers-for-routine-info (@code{t})
625 Non-@code{nil} means, scan all buffers for IDL programs when updating
626 info. When this variable is @code{nil}, it only parses the current
630 @defopt idlwave-query-shell-for-routine-info (@code{t})
631 Non-@code{nil} means query the shell for info about compiled routines.
634 @defopt idlwave-resize-routine-help-window (@code{t})
635 Non-@code{nil} means, resize the Routine-info @file{*Help*} window to
636 fit the content.@refill
640 @node Completion, Code Templates, Routine Info, The IDLWAVE Major Mode
644 IDLWAVE offers completion for routine names and keywords. As in many
645 programming modes, completion is bound to @kbd{M-@key{TAB}}.
646 Completion uses the same internal information as routine info,
647 so in order to update IDLWAVE's idea about your own routines after you
648 have edited or compiled them, press @kbd{C-c C-i}
649 (@code{idlwave-update-routine-info}).@refill
651 The completion function is context sensitive and figures out what to
652 complete at point. Here are example lines and what @kbd{M-@key{TAB}}
653 would try to complete when the cursor is on the position marked with a
659 plot,xra* @r{Keyword of @code{plot} procedure}
660 plot,x,y,/x* @r{Keyword of @code{plot} procedure}
661 plot,min(* @r{Keyword of @code{min} function}
662 obj -> a* @r{Object method (procedure)}
663 a(2,3) = obj -> a* @r{Object method (function)}
664 x = obj_new('IDL* @r{Class name}
665 x = obj_new('MyCl',a* @r{Keyword to @code{Init} method in class @code{MyCl}}
668 @cindex Scrolling the @file{*Completions*} window
669 @cindex Completion, scrolling
670 If the list of completions is too long to fit in the
671 @file{*Completions*} window, the window can be scrolled by pressing
672 @kbd{M-@key{TAB}} repeatedly.@refill
674 @cindex Case of completed words
675 The case of the completed words is determined by what is already in the
676 buffer. When the partial word being completed is all lower case, the
677 completion will be lower case as well. If at least one character is
678 upper case, the string will be completed in upper case or mixed case.
679 The default is to use upper case for procedures, functions and keywords,
680 and mixed case for object class names and methods, similar to the
681 conventions in the IDL manuals. These defaults can be changed with the
682 variable @code{idlwave-completion-case}.@refill
684 @defopt idlwave-completion-case
685 Association list setting the case (UPPER/lower/Capitalized/...) of completed
689 @defopt idlwave-completion-force-default-case (@code{nil})
690 Non-@code{nil} means, completion will always honor the settings in
691 @code{idlwave-completion-case}. When nil (the default), lower case
692 strings will be completed to lower case.
695 @defopt idlwave-complete-empty-string-as-lower-case (@code{nil})
696 Non-@code{nil} means, the empty string is considered lower case for
700 @defopt idlwave-keyword-completion-adds-equal (@code{t})
701 Non-@code{nil} means, completion automatically adds @samp{=} after
702 completed keywords.@refill
705 @defopt idlwave-function-completion-adds-paren (@code{t})
706 Non-@code{nil} means, completion automatically adds @samp{(} after
707 completed function. A value of `2' means, also add the closing
708 parenthesis and position cursor between the two.@refill
711 @defopt idlwave-completion-restore-window-configuration (@code{t})
712 Non-@code{nil} means, restore window configuration after successful
716 @subsubheading Object Method Completion and Class Ambiguity
717 @cindex Object methods
718 @cindex Class ambiguity
719 An object method is not uniquely determined without the object's class.
720 Since the class part is usually omitted in the source code, IDLWAVE
721 considers all available methods in all classes as possible completions
722 of an object method name. For keywords, the combined keywords of the
723 current method in all available classes will be considered. In the
724 @file{*Completions*} buffer, the classes allowed for each completion
725 will be shown next to the item (see option
726 @code{idlwave-completion-show-classes}).@refill
728 You can also call @code{idlwave-complete} with a prefix arg: @kbd{C-u
729 M-@key{TAB}}. IDLWAVE will then prompt you for the class in order to
730 narrow down the number of possible completions. The variable
731 @code{idlwave-query-class} can be configured to make this behavior the
732 default (not really recommended). After you have specified the class
733 for a particular statement (e.g. when completing the method), IDLWAVE
734 can remember it for the rest of the editing session. Subsequent
735 completions in the same statement (e.g. keywords) can then reuse this
736 class information. Remembering the class works by placing a text
737 property in the object operator @samp{->}. This is not enabled by
738 default - the variable @code{idlwave-store-inquired-class} can be used
739 to turn it on.@refill
741 @defopt idlwave-completion-show-classes (@code{1})
742 Non-@code{nil} means, show classes in @file{*Completions*} buffer when
743 completing object methods and keywords.@refill
746 @defopt idlwave-completion-fontify-classes (@code{t})
747 Non-@code{nil} means, fontify the classes in completions buffer.
750 @defopt idlwave-query-class (@code{nil})
751 Association list governing query for object classes during completion.@refill
754 @defopt idlwave-store-inquired-class (@code{nil})
755 Non-@code{nil} means, store class of a method call as text property on
759 @defopt idlwave-class-arrow-face
760 Face to highlight object operator arrows @samp{->} which carry a class
764 @node Code Templates, Actions, Completion, The IDLWAVE Major Mode
765 @section Code Templates
766 @cindex Code templates
767 @cindex Abbreviations
770 IDLWAVE can insert IDL code templates into the buffer. For a few
771 templates, this is done with direct keybindings:
773 @multitable @columnfractions .15 .85
775 @tab @code{CASE} statement template
777 @tab @code{FOR} loop template
779 @tab @code{REPEAT} loop template
781 @tab @code{WHILE} loop template
784 Otherwise, special abbreviations are used. Emacs abbreviations are
785 expanded by typing text into the buffer and pressing @key{SPC} or
786 @key{RET}. The special abbreviations used to insert code templates all
787 start with a @samp{\} (the backslash). Here are a few examples of
788 predefined abbreviations. For a full list, use @kbd{M-x
789 idlwave-list-abbrevs}.
791 @multitable @columnfractions .15 .85
793 @tab @code{PROCEDURE} template
795 @tab @code{FUNCTION} template
797 @tab @code{CASE} statement template
799 @tab @code{FOR} loop template
801 @tab @code{REPEAT} loop template
803 @tab @code{WHILE} loop template
805 @tab @code{IF} statement template
807 @tab @code{IF-ELSE} statement template
812 The templates are expanded in upper or lower case, depending upon the
813 variables @code{idlwave-abbrev-change-case} and
814 @code{idlwave-reserved-word-upcase}.@refill
816 @defopt idlwave-abbrev-start-char
817 A single character string used to start abbreviations in abbrev
821 @defopt idlwave-abbrev-move (@code{t})
822 Non-@code{nil} means the abbrev hook can move point, e.g. to end up
823 between the parenthesis of a function call.
826 @node Actions, Doc Header, Code Templates, The IDLWAVE Major Mode
829 @cindex Coding standards, enforcing
831 @emph{Actions} are special commands which are executed automatically
832 while you write code in order to check the structure of the program or
833 to enforce coding standards. Most actions which have been implemented
834 in IDLWAVE are turned off by default, assuming that the average user
835 wants her code the way she writes it. But if you are a lazy typist and
836 want your code to adhere to certain standards, they can be
839 Action can be applied in three ways:
842 Some actions are applied directly while typing. For example, pressing
843 @samp{=} can run a check to make sure that this operator is surrounded
844 by spaces and insert these spaces if necessary. Pressing @key{SPC}
845 after a reserved word can call a command to change the word to upper
848 When a line is re-indented with @key{TAB}, actions can be applied to the
849 entire line. To enable this, the variable @code{idlwave-do-actions}
850 must be non-@code{nil}.@refill
852 @cindex Foreign code, adapting
853 @cindex Actions, applied to foreign code
854 Action can also be applied to a larger piece of code, e.g. in order to
855 convert foreign code to your own style. To do this, mark the relevant
856 part of the code and execute @kbd{M-x expand-region-abbrevs}. Useful
857 marking commands are @kbd{C-x h} (the entire file) or @kbd{M-C-h} (the
858 current subprogram). @xref{Code Indentation}, for information how to
859 ajust the indentation of the code.@refill
862 @defopt idlwave-do-actions (@code{nil})
863 Non-@code{nil} means performs actions when indenting.
867 * Block Boundary Check:: Is the END correct
868 * Padding Operators:: Enforcing space around `=' etc
869 * Case Changes:: Enforcing upper case keywords
872 @node Block Boundary Check, Padding Operators, Actions, Actions
873 @subsection Block Boundary Check
874 @cindex Block boundary check
875 @cindex @code{END} type checking
876 @cindex @code{END}, automatic insertion
877 @cindex Block, closing
878 @cindex Closing a block
880 Whenever you type an @code{END} statement, IDLWAVE finds the
881 corresponding start of the block and the cursor blinks back to that
882 location for a second. If you have typed a specific @code{END}, like
883 @code{ENDIF} or @code{ENDCASE}, you get a warning if that kind of END
884 does not match the type of block it terminates.@refill
886 Set the variable @code{idlwave-expand-generic-end} in order to have all
887 generic @code{END} statements automatically expanded to a specific type.
888 You can also type @kbd{C-c ]} to close the current block by inserting
889 the appropriate @code{END} statement.@refill
891 @defopt idlwave-show-block (@code{t})
892 Non-@code{nil} means point blinks to block beginning for
893 @code{idlwave-show-begin}.@refill
896 @defopt idlwave-expand-generic-end (@code{nil})
897 Non-@code{nil} means expand generic END to ENDIF/ENDELSE/ENDWHILE etc.
900 @node Padding Operators, Case Changes, Block Boundary Check, Actions
901 @subsection Padding Operators
902 @cindex Padding operators with spaces
903 @cindex Operators, padding with spaces
905 Some operators can be automatically surrounded by spaces. This can
906 happen when the operator is typed, or also later when the line is
907 indented. IDLWAVE contains this setting for the operators @samp{&},
908 @samp{<}, @samp{>}, @samp{,}, @samp{=}, and @samp{->}@footnote{operators
909 longer than one character can only be padded during line indentation.},
910 but the feature is turned off by default. If you want to turn it on,
911 customize the variables @code{idlwave-surround-by-blank} and
912 @code{idlwave-do-actions}. You can also define similar actions for
913 other operators by using the function @code{idlwave-action-and-binding}
914 in the mode hook. For example, to enforce space padding of the @samp{+}
915 and @samp{*} operators, try this in @file{.emacs}@refill
918 (add-hook 'idlwave-mode-hook
920 (setq idlwave-surround-by-blank t) ; Turn this type of actions on
921 (idlwave-action-and-binding "*" '(idlwave-surround 1 1))
922 (idlwave-action-and-binding "+" '(idlwave-surround 1 1))))
925 @defopt idlwave-surround-by-blank (@code{nil})
926 Non-@code{nil} means, enable @code{idlwave-surround}. If non-nil,
927 @samp{=}, @samp{<}, @samp{>}, @samp{&}, @samp{,}, @samp{->} are
928 surrounded with spaces by @code{idlwave-surround}.@refill
931 @defopt idlwave-pad-keyword (@code{t})
932 Non-@code{nil} means pad @samp{=} for keywords like assignments.@refill
935 @node Case Changes, , Padding Operators, Actions
936 @subsection Case Changes
939 Actions can be used to change the case of reserved words or expanded
940 abbreviations by customizing the variables
941 @code{idlwave-abbrev-change-case} and
942 @code{idlwave-reserved-word-upcase}. If you want to change the case of
943 additional words automatically, put something like the following into
944 your @file{.emacs} file:@refill
947 (add-hook 'idlwave-mode-hook
949 ;; Capitalize system vars
950 (idlwave-action-and-binding idlwave-sysvar '(capitalize-word 1) t)
951 ;; Capitalize procedure name
952 (idlwave-action-and-binding "\\<\\(pro\\|function\\)\\>[ \t]*\\<"
953 '(capitalize-word 1) t)
954 ;; Capitalize common block name
955 (idlwave-action-and-binding "\\<common\\>[ \t]+\\<"
956 '(capitalize-word 1) t)))
959 For more information, see the documentation string for the function
960 @code{idlwave-action-and-binding}.
962 @defopt idlwave-abbrev-change-case (@code{nil})
963 Non-@code{nil} means all abbrevs will be forced to either upper or lower
964 case. Legal values are @code{nil}, @code{t}, and @code{down}.
967 @defopt idlwave-reserved-word-upcase (@code{nil})
968 Non-@code{nil} means, reserved words will be made upper case via abbrev
973 @node Doc Header, Motion Commands, Actions, The IDLWAVE Major Mode
974 @section Documentation Header
975 @cindex Documentation header
976 @cindex Modification timestamp
977 @cindex Header, for file documentation
978 @cindex Timestamp, in doc header.
979 @cindex Changelog, in doc header.
981 The command @kbd{C-c C-h} inserts a standard routine header into the
982 buffer, with the usual fields for documentation. One of the keywords is
983 @samp{MODIFICATION HISTORY} under which the changes to a routine can be
984 recorded. The command @kbd{C-c C-m} jumps to the @samp{MODIFICATION
985 HISTORY} of the current routine or file and inserts the user
986 name with a timestamp.
988 @defopt idlwave-file-header
989 The doc-header template or a path to a file containing it.
992 @defopt idlwave-timestamp-hook
993 The hook function used to update the timestamp of a function.
996 @defopt idlwave-doc-modifications-keyword
997 The modifications keyword to use with the log documentation commands.
1000 @defopt idlwave-doclib-start
1001 Regexp matching the start of a document library header.
1004 @defopt idlwave-doclib-end
1005 Regexp matching the start of a document library header.
1008 @node Motion Commands, Misc Options, Doc Header, The IDLWAVE Major Mode
1009 @section Motion Commands
1010 @cindex Motion commands
1011 @cindex Program structure, moving through
1012 @cindex Code structure, moving through
1014 Several commands allow to move quickly through the structure of an IDL
1017 @multitable @columnfractions .15 .85
1019 @tab Beginning of subprogram
1021 @tab End of subprogram
1023 @tab Beginning of block (stay inside the block)
1025 @tab End of block (stay inside the block)
1027 @tab Forward block (on same level)
1029 @tab Backward block (on same level)
1031 @tab Down block (enters a block)
1033 @tab Backward up block (leaves a block)
1039 @node Misc Options, , Motion Commands, The IDLWAVE Major Mode
1040 @section Miscellaneous Options
1042 @defopt idlwave-help-application
1043 The external application providing reference help for programming.
1046 @defopt idlwave-startup-message (@code{t})
1047 Non-@code{nil} means display a startup message when @code{idlwave-mode}'
1051 @defopt idlwave-mode-hook
1052 Normal hook. Executed when a buffer is put into @code{idlwave-mode}.
1055 @defopt idlwave-load-hook
1056 Normal hook. Executed when @file{idlwave.el} is loaded.
1074 @node The IDLWAVE Shell, Installation, The IDLWAVE Major Mode, Top
1075 @chapter The IDLWAVE Shell
1076 @cindex IDLWAVE shell
1077 @cindex Major mode, @code{idlwave-shell-mode}
1079 The IDLWAVE shell is an Emacs major mode which allows to run the IDL
1080 program as an inferior process of Emacs. It can be used to work with
1081 IDL interactively, to compile and run IDL programs in Emacs buffers and
1082 to debug these programs. The IDLWAVE shell uses @file{comint}, an Emacs
1083 packages which handles the communication with the IDL program.
1084 Unfortunately IDL for Windows and MacOS does not allow the interaction
1085 with Emacs@footnote{Please inform the maintainer if you come up with a way
1086 to make the IDLWAVE shell work on these systems.} - so the IDLWAVE shell
1087 only works under Unix.@refill
1090 * Starting the Shell:: How to launch IDL as a subprocess
1091 * Using the Shell:: Interactively working with the Shell
1092 * Debugging IDL Programs:: Compilation/Debugging
1095 @node Starting the Shell, Using the Shell, The IDLWAVE Shell, The IDLWAVE Shell
1096 @section Starting the Shell
1097 @cindex Starting the shell
1098 @cindex Shell, starting
1099 @cindex Dedicated frame, for shell buffer
1100 @cindex Frame, for shell buffer
1102 The IDLWAVE shell can be started with the command @kbd{M-x
1103 idlwave-shell}. In @code{idlwave-mode} the function is bound to
1104 @kbd{C-c C-s}. It creates a buffer @file{*idl*} which is used to
1105 interact with the shell. If the shell is already running, @kbd{C-c C-s}
1106 will simple switch to the shell buffer. The command @kbd{C-c C-l}
1107 (@code{idlwave-shell-recenter-shell-window}) displays the
1108 shell window without selecting it.@refill
1110 In order to create a separate frame for the IDLWAVE shell buffer, call
1111 @code{idlwave-shell} with a prefix argument: @kbd{C-u C-c C-s} or
1112 @kbd{C-u C-c C-l}. If you always want a dedicated frame for the shell
1113 window, configure the variable
1114 @code{idlwave-shell-use-dedicated-frame}.@refill
1116 The shell can also be started automatically when another command tries
1117 to send a command to it. To enable auto start, set the variable
1118 @code{idlwave-shell-automatic-start} to @code{t}.@refill
1120 @defopt idlwave-shell-explicit-file-name
1121 This is the command to run IDL.
1124 @defopt idlwave-shell-command-line-options
1125 A list of command line options for calling the IDL program.
1128 @defopt idlwave-shell-prompt-pattern
1129 Regexp to match IDL prompt at beginning of a line.
1132 @defopt idlwave-shell-process-name
1133 Name to be associated with the IDL process.
1136 @defopt idlwave-shell-automatic-start
1137 Non-@code{nil} means attempt to invoke idlwave-shell if not already
1141 @defopt idlwave-shell-initial-commands
1142 Initial commands, separated by newlines, to send to IDL.
1145 @defopt idlwave-shell-use-dedicated-frame (@code{nil})
1146 Non-@code{nil} means, IDLWAVE should use a special frame to display
1150 @defopt idlwave-shell-frame-parameters
1151 The frame parameters for a dedicated idlwave-shell frame.
1154 @defopt idlwave-shell-temp-pro-prefix
1155 The prefix for temporary IDL files used when compiling regions.@refill
1158 @defopt idlwave-shell-mode-hook
1159 Hook for customizing @code{idlwave-shell-mode}.
1162 @node Using the Shell, Debugging IDL Programs, Starting the Shell, The IDLWAVE Shell
1163 @section Using the Shell
1165 @cindex Shell, basic commands
1167 The IDLWAVE shell works in the same fashion as other shell modes in
1168 Emacs. It provides command history, command line editing and job
1169 control. Here is a list of commonly used commands, see the Emacs
1170 documentation on @file{comint} for additional information.@refill
1172 @multitable @columnfractions .12 .88
1174 @tab Cycle backwards in input history matching input
1178 @tab Previous input matching a regexp
1180 @tab Next input that matches a regexp
1182 @tab Send input or copy line to current prompt
1184 @tab Beginning of line; skip prompt
1186 @tab Kill input to beginning of line
1188 @tab Kill word before cursor
1196 @tab Delete last batch of process output
1198 @tab Show last batch of process output
1200 @tab List input history
1203 In addition to these standard @file{comint} commands,
1204 @code{idlwave-shell-mode} has some bindings which correspond to similar
1205 commands in @code{idlwave-mode}. See @ref{Routine Info} and
1206 @ref{Completion} for more information on these commands.@refill
1208 @cindex Completion in the shell
1209 @cindex Routine info in the shell
1210 @multitable @columnfractions .12 .88
1211 @item @kbd{@key{TAB}}
1212 @tab Completion of file names, routine names and keywords
1213 (@code{idlwave-shell-complete})@refill
1214 @item @kbd{M-@key{TAB}}
1215 @tab Same as @key{TAB}
1217 @tab Routine Info display (@code{idlwave-routine-info})
1219 @tab IDL online help on routine (@code{idlwave-routine-info-from-idlhelp})
1221 @tab Update routine info from buffers and shell
1222 (@code{idlwave-update-routine-info})
1224 @tab Find the source file of a routine (@code{idlwave-find-module})
1226 @tab Compile a library routine (@code{idlwave-resolve})
1229 @defopt idlwave-shell-file-name-chars
1230 The characters allowed in file names, as a string. Used for file name
1234 @node Debugging IDL Programs, , Using the Shell, The IDLWAVE Shell
1235 @section Debugging IDL Programs
1237 @cindex Keybindings for debugging
1240 Programs can be compiled, run, and debugged directly from the source
1241 buffer in Emacs. The IDLWAVE shell installs keybindings both in the
1242 shell buffer and in all IDL code buffers of the current Emacs session.
1243 On Emacs versions which support this, it also installs a debugging
1244 toolbar. The display of the toolbar can be toggled with @kbd{C-c C-d
1245 C-t} (@code{idlwave-shell-toggle-toolbar}).@refill
1247 The debugging keybindings are by default on the prefix key @kbd{C-c
1248 C-d}, so for example setting a breakpoint is done with @kbd{C-c C-d
1249 C-b}. If you find this too much work and your ALT key is still
1250 available, turn on the variable
1251 @code{idlwave-shell-activate-alt-keybindings} in order to get breakpoint
1252 setting on @kbd{A-b}. In the remainder of this chapter we will assume
1253 that the @kbd{C-c C-d} bindings are active.
1255 @defopt idlwave-shell-prefix-key
1256 The prefix key for the debugging map
1257 @code{idlwave-shell-mode-prefix-map}.@refill
1260 @defopt idlwave-shell-activate-prefix-keybindings (@code{t})
1261 Non-@code{nil} means, debug commands will be bound to the prefix
1262 key, like @kbd{C-c C-d C-b}.
1265 @defopt idlwave-shell-activate-alt-keybindings (@code{nil})
1266 Non-@code{nil} means, debug commands will be bound to alternate
1267 keys, like @kbd{A-b}.
1270 @defopt idlwave-shell-use-toolbar (@code{t})
1271 Non-@code{nil} means, use the debugging toolbar in all IDL related
1277 * Compiling Programs:: Compiling buffers under the shell
1278 * Breakpoints and Stepping:: Deciding where to stop and look
1279 * Examining Variables:: What is the value now?
1282 @node Compiling Programs, Breakpoints and Stepping, Debugging IDL Programs, Debugging IDL Programs
1283 @subsection Compiling Programs
1284 @cindex Compiling programs
1285 @cindex Programs, compiling
1286 @cindex Default command line, executing
1287 @cindex Executing a default command line
1289 In order to compile the current buffer under the IDLWAVE shell, press
1290 @kbd{C-c C-d C-c} (@code{idlwave-save-and-run}). This first saves the
1291 current buffer and then send the command @samp{.run path/to/file} to the
1292 shell. You can laso execute @kbd{C-c C-d C-c} from the shell buffer, in
1293 which case the most recently compiled buffer will be saved and
1296 When developing or debugging a program, it is often necessary to execute
1297 the same command line many times. A convenient way to do this is
1298 @kbd{C-c C-d C-y} (@code{idlwave-shell-execute-default-command-line}).
1299 This command first resets IDL from a state of interrupted execution by
1300 closing all files and returning to the main interpreter level. Then a
1301 default command line is send to the shell. To edit the default command
1302 line, call @code{idlwave-shell-execute-default-command-line} with a
1303 prefix argument: @kbd{C-u C-c C-d C-y}.@refill
1305 @defopt idlwave-shell-mark-stop-line (@code{t})
1306 Non-@code{nil} means, mark the source code line where IDL is currently
1307 stopped. The value decides about the preferred method. Legal values
1308 are @code{nil}, @code{t}, @code{arrow}, and @code{face}.@refill
1311 @defopt idlwave-shell-overlay-arrow
1312 The overlay arrow to display at source lines where execution
1316 @defopt idlwave-shell-stop-line-face
1317 The face which highlights the source line where IDL is
1321 @node Breakpoints and Stepping, Examining Variables, Compiling Programs, Debugging IDL Programs
1322 @subsection Breakpoints and Stepping
1326 You can set breakpoints and step through a program with IDLWAVE.
1327 Setting a breakpoint in the current line of the source buffer is done
1328 with @kbd{C-c C-d C-b} (@code{idlwave-shell-break-here}). With a prefix
1329 arg of 1, the breakpoint gets a @code{/ONCE} keyword, meaning that it
1330 will be deleted after first use. With a numeric prefix greater than
1331 one, the breakpoint will only be active the @code{nth} time it is hit.
1332 To clear the breakpoint in the current line, use @kbd{C-c C-d C-d}
1333 (@code{idlwave-clear-current-bp}). To clear all breakpoints, use
1334 @kbd{C-c C-d C-a} (@code{idlwave-clear-all-bp}). Breakpoint lines are
1335 highlighted in the source code.@refill
1337 Once the program has stopped somewhere, you can step through it. Here
1338 is a summary of the breakpoint and stepping commands:
1340 @multitable @columnfractions .2 .8
1341 @item @kbd{C-c C-d C-b}
1342 @tab Set breakpoint (@code{idlwave-shell-break-here})
1343 @item @kbd{C-c C-d C-i}
1344 @tab Set breakpoint in function named here (@code{idlwave-shell-break-in})
1345 @item @kbd{C-c C-d C-d}
1346 @tab Clear current breakpoint (@code{idlwave-shell-clear-current-bp})
1347 @item @kbd{C-c C-d C-a}
1348 @tab Clear all breakpoints (@code{idlwave-shell-clear-all-bp})
1349 @item @kbd{C-c C-d C-s}
1350 @tab Step, into function calls (@code{idlwave-shell-step})
1351 @item @kbd{C-c C-d C-n}
1352 @tab Step, over function calls (@code{idlwave-shell-stepover})
1353 @item @kbd{C-c C-d C-k}
1354 @tab Skip one statement (@code{idlwave-shell-skip})
1355 @item @kbd{C-c C-d C-u}
1356 @tab Continue to end of block (@code{idlwave-shell-up})
1357 @item @kbd{C-c C-d C-m}
1358 @tab Continue to end of function (@code{idlwave-shell-return})
1359 @item @kbd{C-c C-d C-o}
1360 @tab Continue past end of function (@code{idlwave-shell-out})
1361 @item @kbd{C-c C-d C-h}
1362 @tab Continue to line at cursor position (@code{idlwave-shell-to-here})
1363 @item @kbd{C-c C-d C-r}
1364 @tab Continue execution to next breakpoint (@code{idlwave-shell-cont})
1365 @item @kbd{C-c C-d C-up}
1366 @tab Show higher level in calling stack (@code{idlwave-shell-stack-up})
1367 @item @kbd{C-c C-d C-down}
1368 @tab Show lower level in calling stack (@code{idlwave-shell-stack-down})
1371 @defopt idlwave-shell-mark-breakpoints (@code{t})
1372 Non-@code{nil} means, mark breakpoints in the source file buffers. The
1373 value indicates the preferred method. Legal values are @code{nil},
1374 @code{t}, @code{face}, and @code{glyph}.
1377 @defopt idlwave-shell-breakpoint-face
1378 The face for breakpoint lines in the source code if
1379 @code{idlwave-shell-mark-breakpoints} has the value @code{face}.@refill
1382 @node Examining Variables, , Breakpoints and Stepping, Debugging IDL Programs
1383 @subsection Examining Variables
1384 @cindex @code{PRINT} expressions
1385 @cindex @code{HELP}, on expressions
1386 @cindex Expressions, printing
1387 @cindex Expressions, help
1388 @cindex Mouse binding to print expressions
1390 When execution is stopped you can examine the values of variables. The
1391 command @kbd{C-c C-d C-p} prints the expression at point, while @kbd{C-c
1392 C-d ?} shows help on this expression. The expression at point is an
1393 array expression or a function call, or the contents of a pair of
1394 parenthesis. The selected expression becomes highlighted in the source
1395 code for a short time. Calling the above commands with a prefix
1396 argument will prompt for an expression instead of using the one at
1399 I find it very convenient to bind these functions to a mouse event, so
1400 that simply clicking on an expression prints its value. The following
1401 code binds printing an expression to a click with mouse button 2 while
1402 holding down the @key{SHIFT} key:
1405 (add-hook 'idlwave-shell-mode-hook
1407 (define-key idlwave-mode-map [(shift mouse-2)]
1408 'idlwave-shell-mouse-print)))
1411 Printing of expressions also works on higher levels of the calling
1412 stack. This means that you can examine the values of variables and
1413 expressions inside the routine which called the current routine etc.
1414 Use the commands @kbd{C-c C-d C-@key{UP}}
1415 (@code{idlwave-shell-stack-up}) and @kbd{C-c C-d C-@key{DOWN}}
1416 (@code{idlwave-shell-stack-down}) or the corresponding toolbar buttons
1417 to move through the calling stack. The mode line will indicate the
1418 routine and the calling stack level which define the context for
1419 printing expressions. The following restrictions apply for all levels
1420 except the current:@refill
1424 Array expressions must use the @samp{[ ]} index delimiters. Identifiers
1425 with a @samp{( )} will be interpreted as function calls.
1427 Variable names in the expression may not start with an underscore
1430 @cindex ROUTINE_NAMES, IDL procedure
1431 Printing values of expressions on higher levels of the calling stack
1432 uses the @emph{unsupported} IDL routine @code{ROUTINE_NAMES}, which may
1433 or may not be available in future versions of IDL.
1436 @defopt idlwave-shell-expression-face
1437 The face for @code{idlwave-shell-expression-overlay}.
1438 Allows you to choose the font, color and other properties for
1439 the expression printed by IDL.
1442 @defopt idlwave-shell-print-expression-function (@code{nil})
1443 A function to handle special display of evaluated expressions.
1446 @node Installation, Acknowledgement, The IDLWAVE Shell, Top
1447 @chapter Installation
1448 @cindex Installation
1450 @cindex URL, homepage for IDLWAVE
1451 @cindex Homepage for IDLWAVE
1454 * Installing IDLWAVE:: How to install the distribution
1455 * Upgrading from idl.el:: Necessary configuration changes
1458 @node Installing IDLWAVE, Upgrading from idl.el, Installation, Installation
1459 @section Installing IDLWAVE
1461 IDLWAVE is part of Emacs 21.1 and later. It is also an XEmacs packages
1462 and can be installed from
1463 @uref{ftp://ftp.xemacs.org/pub/xemacs/packages/,the XEmacs ftp site}
1464 with the normal package management system on XEmacs 21.@refill
1466 You can also download IDLWAVE and install it yourself from
1467 @uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave, the maintainers
1468 webpage}. Follow the instructions in the INSTALL file.@refill
1470 @node Upgrading from idl.el, , Installing IDLWAVE, Installation
1471 @section Upgrading from the old @b{@file{idl.el}} file
1472 @cindex Upgrading from old @b{@file{idl.el}}
1473 @cindex Renaming old variables
1474 @cindex Old variables, renaming
1476 If you have been using the old @file{idl.el} and @file{idl-shell.el}
1477 files and would like to use IDLWAVE, you need to update your
1478 customization in @file{.emacs}.
1482 Change all variable and function prefixes from @samp{idl-} to @samp{idlwave-}.
1484 Remove the now invalid @code{autoload} and @code{auto-mode-alist} forms
1485 pointing to the @file{idl.el} and @file{idl-shell.el} files.
1487 If you have been using the hook function recommended in earlier versions
1488 to get a separate frame for the IDL shell, remove that command from your
1489 @code{idlwave-shell-mode-hook}. Instead, set the variable
1490 @code{idlwave-shell-use-dedicated-frame} with
1492 (setq idlwave-shell-use-dedicated-frame t)
1495 The key sequence @kbd{M-@key{TAB}} no longer inserts a TAB character,
1496 but (as in many other Emacs modes) does completion. Inserting a TAB is
1497 now bound to @kbd{C-c @key{SPC}}.@refill
1500 @node Acknowledgement, Sources of Routine Info, Installation, Top
1501 @chapter Acknowledgement
1502 @cindex Acknowledgement
1505 @file{idl.el} and @file{idl-shell.el} were written by
1506 @uref{mailto:chase@@att.com, Chris Chase}. The package
1507 was extended and renamed to IDLWAVE by the current maintainer
1508 @uref{mailto:dominik@@strw.leidenuniv.nl, Carsten Dominik}.
1510 Thanks to the following people who have contributed to the development
1511 of IDLWAVE with patches, ideas, bug reports and suggestions.
1515 Ulrik Dickow <dickow@@nbi.dk>
1517 Eric E. Dors <edors@@lanl.gov>
1519 Stein Vidar H. Haugan <s.v.h.haugan@@astro.uio.no>
1521 David Huenemoerder <dph@@space.mit.edu>
1523 Kevin Ivory <Kevin.Ivory@@linmpi.mpg.de>
1525 Xuyong Liu <liu@@stsci.edu>
1527 Simon Marshall <Simon.Marshall@@esrin.esa.it>
1529 Laurent Mugnier <mugnier@@onera.fr>
1531 Lubos Pochman <lubos@@rsinc.com>
1533 Patrick M. Ryan <pat@@jaameri.gsfc.nasa.gov>
1535 Marty Ryba <ryba@@ll.mit.edu>
1537 Phil Williams <williams@@irc.chmcc.org>
1539 J.D. Smith <jdsmith@@astrosun.tn.cornell.edu>
1541 Phil Sterne <sterne@@dublin.llnl.gov>
1544 @node Sources of Routine Info, Configuration Examples, Acknowledgement, Top
1545 @appendix Sources of Routine Info
1547 In @ref{Routine Info} and @ref{Completion} it was shown how IDLWAVE
1548 displays the calling sequence and keywords of routines, and how it
1549 completes routine names and keywords. For these features to work,
1550 IDLWAVE must know about the accessible routines.
1553 * Routine Definitions:: Where IDL Routines are defined.
1554 * Routine Information Sources:: So how does IDLWAVE know about...
1555 * Library Scan:: Scanning the Libraries for Routine Info
1556 * Updating idlw-rinfo.el:: Scanning the IDL Manuals
1559 @node Routine Definitions, Routine Information Sources, Sources of Routine Info, Sources of Routine Info
1560 @section Routine Definitions
1561 @cindex Routine definitions
1563 Routines which can be used in an IDL program can be defined in several
1568 @emph{System routines} are defined inside IDL itself. The source
1569 code of such routines is not accessible to the user.@refill
1571 Routines @emph{part of the current program} are defined in a file which
1572 is explicitly compiled by the user. This file may be located on the IDL
1573 search path, but this is not certain.@refill
1575 @emph{Library routines} are defined in special files which are located
1576 somewhere on IDL's search path. When a library routine is called for
1577 the first time, IDL will find the source file and compile it
1580 External routines written in other languages (like Fortran or C) can be
1581 called with @code{CALL_EXTERNAL}, linked into IDL via @code{LINKIMAGE},
1582 or included as dynamically loaded modules (DLMs). Currently IDLWAVE
1583 cannot provide routine info and completion for external
1587 @node Routine Information Sources, Library Scan, Routine Definitions, Sources of Routine Info
1588 @section Routine Information Sources
1589 @cindex Routine info sources
1591 In oder to know about as many routines as possible, IDLWAVE will do the
1592 following to collect information:@refill
1597 It has a @emph{builtin list} with the properties of the builtin IDL
1598 routines. IDLWAVE @value{VERSION} is distributed with a list of
1599 @value{NSYSROUTINES} routines and @value{NSYSKEYWORDS} keywords,
1600 reflecting IDL version @value{IDLVERSION}. This list has been created
1601 by scanning the IDL manuals and is stored in the file
1602 @file{idlw-rinfo.el}. @xref{Updating idlw-rinfo.el}, for
1603 information how to regenerate this file for new versions of IDL.@refill
1606 It @emph{scans} all @emph{buffers} of the current Emacs session for
1607 routine definitions. This is done automatically when routine
1608 information or completion is first requested by the user. The command
1609 @kbd{C-c C-i} (@code{idlwave-update-routine-info}) can be used at any
1610 time to rescan all buffers.@refill
1613 If you have an IDLWAVE-Shell running as inferior process of the current
1614 Emacs session, IDLWAVE will @emph{query the shell} for compiled routines
1615 and their arguments. This happens automatically when routine
1616 information or completion is first requested by the user. The command
1617 @kbd{C-c C-i} (@code{idlwave-update-routine-info}) can be used to ask
1618 the shell again at any time.@refill
1621 IDLWAVE can scan all or selected library files and store the result in a
1622 file which will be automatically loaded just like
1623 @file{idlw-rinfo.el}. @xref{Library Scan}, for information how to
1624 scan library files.@refill
1627 @defopt idlwave-scan-all-buffers-for-routine-info (@code{t})
1628 Non-@code{nil} means, scan all buffers for IDL programs when updating
1629 info. When this variable is @code{nil}, it only parses the current
1633 @defopt idlwave-query-shell-for-routine-info (@code{t})
1634 Non-@code{nil} means query the shell for info about compiled routines.
1638 @node Library Scan, Updating idlw-rinfo.el, Routine Information Sources, Sources of Routine Info
1639 @section Library Scan
1640 @cindex Library scan
1641 @cindex IDL library routine info
1643 IDLWAVE can extract routine information from library modules and store
1644 that information in a file. To do this, the variable
1645 @code{idlwave-libinfo-file} needs to contain the path to a file in an
1646 existing directory (e.g. @code{"~/idlwave_libinfo.el"}). Since the file
1647 will contain lisp code, it should end in @file{.el}. Under Windows and
1648 MacOS, you also need to specify the search path for IDL library files in
1649 the variable @code{idlwave-library-path}. Under UNIX, this path will
1650 be automatically inferred from an IDLWAVE shell.@refill
1652 The command @kbd{M-x idlwave-create-libinfo-file} can then be used to
1653 scan library files. It brings up a widget in which you can select some
1654 or all directories on the search path. Pressing the @w{@samp{[Scan & Save]}}
1655 button in the widget will scan all files in the selected directories and
1656 write the resulting routine information into the file
1657 @code{idlwave-libinfo-file}. In order to update the library information
1658 from the same directories, call the command
1659 @code{idlwave-update-routine-info} with a double prefix argument:
1660 @kbd{C-u C-u C-c C-i}. This will rescan files in the previously
1661 selected directories, write an updated version of the libinfo file and
1662 rebuild IDLWAVEs internal lists.@refill
1664 A note of caution: Depending on your local installation, the IDL
1665 library can be very large. Parsing it for routine information will take
1666 time and loading this information into Emacs can require a
1667 significant amount of memory.@refill
1669 A routine which is both in the library listing and compiled under the
1670 shell will show up twice in the @file{*Completions*} listing. This is
1671 usually not a serious problem. However, if you have scanned the part of
1672 the library relevant for you, and if you are not compiling files which
1673 are not on the library search path, the information about compiled
1674 routines is in fact unnecessary. In this case, you can turn off the
1675 shell query for compiled routines with the variable
1676 @code{idlwave-query-shell-for-routine-info}.@refill
1678 @defopt idlwave-libinfo-file
1679 File for routine information of the IDL library.
1682 @defopt idlwave-library-path
1683 IDL library path for Windows and MacOS. Not needed under Unix.
1687 @node Updating idlw-rinfo.el, , Library Scan, Sources of Routine Info
1688 @section Updating @file{idlw-rinfo.el}
1689 @cindex @file{get_rinfo}
1690 @cindex @file{idlw-rinfo.el}
1691 @cindex Perl program, to create @file{idlw-rinfo.el}
1693 The file @file{idlw-rinfo.el} contains the routine information for
1694 the routines build into IDL. This constant depends upon the version of
1695 IDL. If you are lucky, the maintainer of IDLWAVE will always have
1696 access to the newest version of IDL and provide updates of
1697 @file{idlw-rinfo.el} reflecting the currently released version of
1698 IDL. The IDLWAVE package also contains a Perl program @file{get_rinfo}
1699 which constructs this file by scanning selected files from the IDL
1700 documentation. The program needs @file{pdftotext} by Derek B. Noonburg.
1701 Instructions on how to use @file{get_rinfo} are in the program
1704 @node Configuration Examples, Index, Sources of Routine Info, Top
1705 @appendix Configuration Examples
1706 @cindex Configuration examples
1707 @cindex Example configuration
1710 @b{Question:} So now you have all these complicated configuration
1711 options in your package, but which ones do @emph{you} as the maintainer
1712 actually set in your own configuration?
1715 @b{Answer:} Hardly any. As the maintainer, I set the default of most
1716 options to what I think is best. However, the default settings do not
1717 turn on features which
1720 are not self-evident (i.e. too magic) when used by an unsuspecting user
1724 will not work properly on all Emacs installations out there
1726 break with what I think are widely used standards.
1729 @noindent To see what I mean, here is the @emph{entire} configuration I
1730 have in my @file{.emacs}:
1733 (setq idlwave-shell-activate-alt-keybindings t
1734 idlwave-expand-generic-end t
1735 idlwave-store-inquired-class t
1736 idlwave-shell-automatic-start t
1737 idlwave-libinfo-file "~/lib/idl/libinfo.el"
1738 idlwave-main-block-indent 2)
1739 (add-hook 'idlwave-shell-mode-hook
1741 (define-key idlwave-mode-map [(shift button1)]
1742 'idlwave-shell-mouse-print)
1743 (define-key idlwave-mode-map [(shift button2)]
1744 'idlwave-shell-mouse-help)))
1747 However, if you are an Emacs power-user and want IDLWAVE to work
1748 completely differently, the options allow you to change almost every
1749 aspect of it. Here is an example of a much more extensive configuration
1750 of IDLWAVE. To say it again - this is not what I recommend, but the
1751 user is King!@refill
1754 ;;; Settings for IDLWAVE mode
1756 (setq idlwave-block-indent 3) ; Indentation settings
1757 (setq idlwave-main-block-indent 3)
1758 (setq idlwave-end-offset -3)
1759 (setq idlwave-continuation-indent 1)
1760 (setq idlwave-begin-line-comment "^;[^;]") ; Leave ";" but not ";;"
1761 ; anchored at start of line.
1762 (setq idlwave-surround-by-blank t) ; Turn on padding ops =,<,>
1763 (setq idlwave-pad-keyword nil) ; Remove spaces for keyword '='
1764 (setq idlwave-expand-generic-end t) ; convert END to ENDIF etc...
1765 (setq idlwave-reserved-word-upcase t) ; Make reserved words upper case
1766 ; (with abbrevs only)
1767 (setq idlwave-abbrev-change-case nil) ; Don't force case of expansions
1768 (setq idlwave-hang-indent-regexp ": ") ; Change from "- " for auto-fill
1769 (setq idlwave-show-block nil) ; Turn off blinking to begin
1770 (setq idlwave-abbrev-move t) ; Allow abbrevs to move point
1772 ;; Some setting can only be done from a mode hook. Here is an example:
1774 (add-hook 'idlwave-mode-hook
1776 (setq abbrev-mode 1) ; Turn on abbrevs (-1 for off)
1777 (setq case-fold-search nil) ; Make searches case sensitive
1778 ;; Run other functions here
1779 (font-lock-mode 1) ; Turn on font-lock mode
1780 (idlwave-auto-fill-mode 0) ; Turn off auto filling
1782 ;; Pad with with 1 space (if -n is used then make the
1783 ;; padding a minimum of n spaces.) The defaults use -1
1785 (idlwave-action-and-binding "=" '(idlwave-expand-equal 1 1))
1786 (idlwave-action-and-binding "<" '(idlwave-surround 1 1))
1787 (idlwave-action-and-binding ">" '(idlwave-surround 1 1 '(?-)))
1788 (idlwave-action-and-binding "&" '(idlwave-surround 1 1))
1790 ;; Only pad after comma and with exactly 1 space
1791 (idlwave-action-and-binding "," '(idlwave-surround nil 1))
1792 (idlwave-action-and-binding "&" '(idlwave-surround 1 1))
1794 ;; Pad only after `->', remove any space before the arrow
1795 (idlwave-action-and-binding "->" '(idlwave-surround 0 -1 nil 2))
1797 ;; Set some personal bindings
1798 ;; (In this case, makes `,' have the normal self-insert behavior.)
1799 (local-set-key "," 'self-insert-command)
1800 ;; Create a newline, indenting the original and new line.
1801 ;; A similar function that does _not_ reindent the original
1802 ;; line is on "\C-j" (The default for emacs programming modes).
1803 (local-set-key "\n" 'idlwave-newline)
1804 ;; (local-set-key "\C-j" 'idlwave-newline) ; My preference.
1807 ;;; Settings for IDLWAVE SHELL mode
1809 (setq idlwave-shell-overlay-arrow "=>") ; default is ">"
1810 (setq idlwave-shell-use-dedicated-frame t) ; Make a dedicated frame
1811 (setq idlwave-shell-prompt-pattern "^WAVE> ") ; default is "^IDL> "
1812 (setq idlwave-shell-explicit-file-name "wave")
1813 (setq idlwave-shell-process-name "wave")
1814 (setq idlwave-shell-use-toolbar nil) ; No toolbar
1817 @node Index, , Configuration Examples, Top