IDLWAVE 3.15
[bpt/emacs.git] / man / idlwave.texi
1 \input texinfo @c -*-texinfo-*-
2 @c %**start of header
3 @setfilename ../info/idlwave
4 @settitle IDLWAVE User Manual
5 @dircategory Editors
6 @direntry
7 * IDLWAVE: (idlwave). Major mode and shell for IDL and WAVE/CL files.
8 @end direntry
9 @synindex ky cp
10 @syncodeindex vr cp
11 @syncodeindex fn cp
12 @set VERSION 3.15
13 @set EDITION 1.10
14 @set IDLVERSION 5.3
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
22 @c %**end of header
23 @finalout
24
25 @ifinfo
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
28 a subprocess.@refill
29
30 This is edition @value{EDITION} of the IDLWAVE User Manual for
31 IDLWAVE @value{VERSION}@refill
32
33 Copyright (c) 1999, 2000 Free Software Foundation, Inc.
34
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.
38
39 @ignore
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).
45
46 @end ignore
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.
52
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.
58 @end ifinfo
59
60 @titlepage
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}
64
65 @author by Carsten Dominik
66 @page
67 Copyright @copyright{} 1999, 2000 Free Software Foundation, Inc.
68
69 @sp 2
70 This is edition @value{EDITION} of the @cite{IDLWAVE User Manual} for
71 IDLWAVE version @value{VERSION}, @value{DATE}.@refill
72
73 @sp 2
74
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.
78
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.
84
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.
90
91 @end titlepage
92 @page
93
94 @ifinfo
95 @node Top, Introduction, (dir), (dir)
96
97 IDLWAVE is a package to support editing command files for the
98 Interactive Data Language (IDL), and for running IDL as an inferior
99 shell. @refill
100
101 @end ifinfo
102
103 @menu
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
113
114 @detailmenu
115
116 --- The Detailed Node Listing ---
117
118 The IDLWAVE Major Mode
119
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
128
129 Code Formatting
130
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
135
136 Actions
137
138 * Block Boundary Check:: Is the END correct
139 * Padding Operators:: Enforcing space around `=' etc
140 * Case Changes:: Enforcing upper case keywords
141
142 The IDLWAVE Shell
143
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
147
148 Debugging IDL Programs
149
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?
153
154 Installation
155
156 * Installing IDLWAVE:: How to install the distribution
157 * Upgrading from idl.el:: Necessary configuration changes
158
159 Sources of Routine Info
160
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
165 @end detailmenu
166 @end menu
167
168 @node Introduction, IDLWAVE in a Nutshell, Top, Top
169 @chapter Introduction
170 @cindex Introduction
171 @cindex CORBA (Common Object Request Broker Architecture)
172 @cindex cc-mode.el
173 @cindex Feature overview
174
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).
181
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
187 switch.
188
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
193
194 Here is a brief summary of what IDLWAVE does.
195
196 @itemize @bullet
197 @item
198 Code indentation and formatting.
199 @item
200 Font-lock support on three levels.
201 @item
202 Display of calling sequence and keywords of more than 1000 IDL
203 routines.
204 @item
205 Context sensitive completion of routine names and keywords.
206 @item
207 Insertion of code templates.
208 @item
209 Actions to enforce coding standards during typing.
210 @item
211 Block structure check.
212 @item
213 Documentation support.
214 @item
215 Running IDL as inferior process.
216 @item
217 Shell with history search, command line editing and completion.
218 @item
219 Compilation, execution and debugging of programs directly from the source
220 buffer.
221 @item
222 Examining expressions with a mouse click.
223 @end itemize
224
225 @ifnottex
226 @cindex Screenshots
227 Here are a number of screenshots showing IDLWAVE in action.
228 @itemize @bullet
229 @item
230 @uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/font-lock.gif,
231 XEmacs 21.1 with formatted and fontified code}
232 @item
233 @uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/rinfo.gif,
234 XEmacs 21.1 displaying routine info}
235 @item
236 @uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/complete.gif,
237 XEmacs 21.1 completing a keyword}
238 @item
239 @uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/shell.gif,
240 XEmacs 21.1 with debugging toolbar; execution stopped at a breakpoint}
241 @end itemize
242 @end ifnottex
243
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.
251
252 @node IDLWAVE in a Nutshell, The IDLWAVE Major Mode, Introduction, Top
253 @chapter IDLWAVE in a Nutshell
254 @cindex Quick-Start
255 @cindex Getting Started
256 @cindex IDLWAVE in a Nutshell
257 @cindex Nutshell, IDLWAVE in a
258
259 @subheading Editing IDL Programs
260
261 @multitable @columnfractions .15 .85
262 @item @key{TAB}
263 @tab Indent the current line relative to context.
264 @item @kbd{M-C-\}
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.
268 @item @kbd{M-q}
269 @tab Fill the current comment paragraph.
270 @item @kbd{C-c ?}
271 @tab Display calling sequence, keywords of the procedure/function call
272 at point.
273 @item @kbd{M-@key{TAB}}
274 @tab Complete a procedure name, function name or keyword in the buffer.
275 @item @kbd{C-c C-i}
276 @tab Update IDLWAVE's knowledge about functions and procedures.
277 @item @kbd{C-c C-v}
278 @tab Find the source code of a procedure/function.
279 @item @kbd{C-c C-h}
280 @tab Insert a standard documentation header.
281 @item @kbd{C-c C-m}
282 @tab Insert a new timestamp and history item in the documentation header.
283 @end multitable
284
285 @subheading Running the IDLWAVE Shell, Debugging Programs
286
287 @multitable @columnfractions .15 .85
288 @item @kbd{C-c C-s}
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.
292 @item @kbd{M-p}
293 @tab Cycle back through IDL command history matching command line input.
294 @item @kbd{M-n}
295 @tab Cycle forward.
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.
308 @end multitable
309
310 @subheading Commonly used Settings in @file{.emacs}
311 @lisp
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)
323
324 ;; Automatically start the shell when needed, in dedicated frame
325 (setq idlwave-shell-automatic-start t
326 idlwave-shell-use-dedicated-frame t)
327
328 ;; Specify a file where library info can be stored.
329 (setq idlwave-libinfo-file "~/idlinfo.el")
330 @end lisp
331
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}
336
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
339 customize them.
340
341 @menu
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
350 @end menu
351
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
356
357 @menu
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
362 @end menu
363
364 @node Code Indentation, Comment Indentation, Code Formatting, Code Formatting
365 @subsection Code Indentation
366 @cindex Code indentation
367 @cindex Indentation
368
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.
373
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.
382
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
386 unit.@refill
387 @end defopt
388
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
392 @end defopt
393
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
397 BEGIN lines.@refill
398 @end defopt
399
400 @defopt idlwave-continuation-indent (@code{2})
401 Extra indentation applied to continuation lines and insided unbalanced
402 parenthesis.@refill
403 @end defopt
404
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
411
412 In IDL, lines starting with a @samp{;} are called @emph{comment lines}.
413 Comment lines are indented as follows:
414
415 @multitable @columnfractions .1 .90
416 @item @code{;;;}
417 @tab The indentation of lines starting with three semicolons remains
418 unchanged.
419 @item @code{;;}
420 @tab Lines starting with two semicolons are indented like the surrounding code.
421 @item @code{;}
422 @tab Lines starting with a single semicolon are indent to a minimum column.
423 @end multitable
424
425 The indentation of comments starting in column 0 is never changed.
426
427 @defopt idlwave-no-change-comment
428 The indentation of a comment that starts with this regular
429 expression will not be changed.
430 @end defopt
431
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
435 @end defopt
436
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
440 @end defopt
441
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
447 @cindex Filling
448 @cindex @code{auto-fill-mode}
449 @cindex Hanging paragraphs
450
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
463 @kbd{C-c C-a}.
464
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
471 following example.
472
473 @example
474 ; INPUTS
475 ; x - an array containing
476 ; lots of interesting numbers.
477 ;
478 ; y - another variable where
479 ; a hanging paragraph is used
480 ; to describe it.
481 @end example
482
483 You also refill a comment paragraph with @kbd{M-q}.
484
485 @defopt idlwave-fill-comment-line-only (@code{t})
486 Non-@code{nil} means auto fill will only operate on comment lines.
487 @end defopt
488
489 @defopt idlwave-auto-fill-split-string (@code{t})
490 Non-@code{nil} means auto fill will split strings with the IDL @samp{+}
491 operator.
492 @end defopt
493
494 @defopt idlwave-split-line-string (@code{t})
495 Non-@code{nil} means @code{idlwave-split-line} will split strings with
496 @samp{+}.
497 @end defopt
498
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
503 @end defopt
504
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
508 @end defopt
509
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
513 @end defopt
514
515 @node Syntax Highlighting, , Continuation Lines, Code Formatting
516 @subsection Syntax Highlighting
517 @cindex Syntax highlighting
518 @cindex Font lock
519
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
524
525 @lisp
526 (add-hook 'idlwave-mode-hook 'turn-on-font-lock)
527 @end lisp
528
529 IDLWAVE supports 3 levels of syntax highlighting. The variable
530 @code{font-lock-maximum-decoration} determines which level is selected.
531
532 @defopt idlwave-default-font-lock-items
533 Items which should be fontified on the default fontification level
534 2.@refill
535 @end defopt
536
537 @node Routine Info, Completion, Code Formatting, The IDLWAVE Major Mode
538 @section Routine Info
539 @cindex Routine info
540
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
553
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
559
560 @example
561 plot,x,alog(x+5*sin(x) + 2),
562 1 2 3 4 5 6 7 8
563 @end example
564
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
571 object.
572
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:
579
580 @example
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
584 @end example
585
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
593
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
601
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.
614
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.
620
621 @xref{Sources of Routine Info}, for in-depth information where IDLWAVE
622 collects data about routines, and how to update this information.
623
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
627 buffer.@refill
628 @end defopt
629
630 @defopt idlwave-query-shell-for-routine-info (@code{t})
631 Non-@code{nil} means query the shell for info about compiled routines.
632 @end defopt
633
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
637 @end defopt
638
639
640 @node Completion, Code Templates, Routine Info, The IDLWAVE Major Mode
641 @section Completion
642 @cindex Completion
643
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
650
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
654 @samp{*}.
655
656 @example
657 plo* @r{Procedure}
658 x = a* @r{Function}
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}}
666 @end example
667
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
673
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
683
684 @defopt idlwave-completion-case
685 Association list setting the case (UPPER/lower/Capitalized/...) of completed
686 words.@refill
687 @end defopt
688
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.
693 @end defopt
694
695 @defopt idlwave-complete-empty-string-as-lower-case (@code{nil})
696 Non-@code{nil} means, the empty string is considered lower case for
697 completion.@refill
698 @end defopt
699
700 @defopt idlwave-keyword-completion-adds-equal (@code{t})
701 Non-@code{nil} means, completion automatically adds @samp{=} after
702 completed keywords.@refill
703 @end defopt
704
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
709 @end defopt
710
711 @defopt idlwave-completion-restore-window-configuration (@code{t})
712 Non-@code{nil} means, restore window configuration after successful
713 completion.@refill
714 @end defopt
715
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
727
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
740
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
744 @end defopt
745
746 @defopt idlwave-completion-fontify-classes (@code{t})
747 Non-@code{nil} means, fontify the classes in completions buffer.
748 @end defopt
749
750 @defopt idlwave-query-class (@code{nil})
751 Association list governing query for object classes during completion.@refill
752 @end defopt
753
754 @defopt idlwave-store-inquired-class (@code{nil})
755 Non-@code{nil} means, store class of a method call as text property on
756 @samp{->}.@refill
757 @end defopt
758
759 @defopt idlwave-class-arrow-face
760 Face to highlight object operator arrows @samp{->} which carry a class
761 property.@refill
762 @end defopt
763
764 @node Code Templates, Actions, Completion, The IDLWAVE Major Mode
765 @section Code Templates
766 @cindex Code templates
767 @cindex Abbreviations
768 @cindex Templates
769
770 IDLWAVE can insert IDL code templates into the buffer. For a few
771 templates, this is done with direct keybindings:
772
773 @multitable @columnfractions .15 .85
774 @item @kbd{C-c C-c}
775 @tab @code{CASE} statement template
776 @item @kbd{C-c C-f}
777 @tab @code{FOR} loop template
778 @item @kbd{C-c C-r}
779 @tab @code{REPEAT} loop template
780 @item @kbd{C-c C-w}
781 @tab @code{WHILE} loop template
782 @end multitable
783
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}.
790
791 @multitable @columnfractions .15 .85
792 @item @code{\pr}
793 @tab @code{PROCEDURE} template
794 @item @code{\fu}
795 @tab @code{FUNCTION} template
796 @item @code{\c}
797 @tab @code{CASE} statement template
798 @item @code{\f}
799 @tab @code{FOR} loop template
800 @item @code{\r}
801 @tab @code{REPEAT} loop template
802 @item @code{\w}
803 @tab @code{WHILE} loop template
804 @item @code{\i}
805 @tab @code{IF} statement template
806 @item @code{\elif}
807 @tab @code{IF-ELSE} statement template
808 @item @code{\b}
809 @tab @code{BEGIN}
810 @end multitable
811
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
815
816 @defopt idlwave-abbrev-start-char
817 A single character string used to start abbreviations in abbrev
818 mode.@refill
819 @end defopt
820
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.
824 @end defopt
825
826 @node Actions, Doc Header, Code Templates, The IDLWAVE Major Mode
827 @section Actions
828 @cindex Actions
829 @cindex Coding standards, enforcing
830
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
837 helpful.@refill
838
839 Action can be applied in three ways:
840 @itemize @bullet
841 @item
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
846 case.@refill
847 @item
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
851 @item
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
860 @end itemize
861
862 @defopt idlwave-do-actions (@code{nil})
863 Non-@code{nil} means performs actions when indenting.
864 @end defopt
865
866 @menu
867 * Block Boundary Check:: Is the END correct
868 * Padding Operators:: Enforcing space around `=' etc
869 * Case Changes:: Enforcing upper case keywords
870 @end menu
871
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
879
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
885
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
890
891 @defopt idlwave-show-block (@code{t})
892 Non-@code{nil} means point blinks to block beginning for
893 @code{idlwave-show-begin}.@refill
894 @end defopt
895
896 @defopt idlwave-expand-generic-end (@code{nil})
897 Non-@code{nil} means expand generic END to ENDIF/ENDELSE/ENDWHILE etc.
898 @end defopt
899
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
904
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
916
917 @lisp
918 (add-hook 'idlwave-mode-hook
919 (lambda ()
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))))
923 @end lisp
924
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
929 @end defopt
930
931 @defopt idlwave-pad-keyword (@code{t})
932 Non-@code{nil} means pad @samp{=} for keywords like assignments.@refill
933 @end defopt
934
935 @node Case Changes, , Padding Operators, Actions
936 @subsection Case Changes
937 @cindex Case changes
938
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
945
946 @lisp
947 (add-hook 'idlwave-mode-hook
948 (lambda ()
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)))
957 @end lisp
958
959 For more information, see the documentation string for the function
960 @code{idlwave-action-and-binding}.
961
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}.
965 @end defopt
966
967 @defopt idlwave-reserved-word-upcase (@code{nil})
968 Non-@code{nil} means, reserved words will be made upper case via abbrev
969 expansion.
970 @end defopt
971
972
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.
980
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.
987
988 @defopt idlwave-file-header
989 The doc-header template or a path to a file containing it.
990 @end defopt
991
992 @defopt idlwave-timestamp-hook
993 The hook function used to update the timestamp of a function.
994 @end defopt
995
996 @defopt idlwave-doc-modifications-keyword
997 The modifications keyword to use with the log documentation commands.
998 @end defopt
999
1000 @defopt idlwave-doclib-start
1001 Regexp matching the start of a document library header.
1002 @end defopt
1003
1004 @defopt idlwave-doclib-end
1005 Regexp matching the start of a document library header.
1006 @end defopt
1007
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
1013
1014 Several commands allow to move quickly through the structure of an IDL
1015 program. These are
1016
1017 @multitable @columnfractions .15 .85
1018 @item @kbd{C-M-a}
1019 @tab Beginning of subprogram
1020 @item @kbd{C-M-e}
1021 @tab End of subprogram
1022 @item @kbd{C-c @{}
1023 @tab Beginning of block (stay inside the block)
1024 @item @kbd{C-c @}}
1025 @tab End of block (stay inside the block)
1026 @item @kbd{M-C-n}
1027 @tab Forward block (on same level)
1028 @item @kbd{M-C-p}
1029 @tab Backward block (on same level)
1030 @item @kbd{M-C-d}
1031 @tab Down block (enters a block)
1032 @item @kbd{M-C-u}
1033 @tab Backward up block (leaves a block)
1034 @item @kbd{C-c C-n}
1035 @tab Next Statement
1036 @end multitable
1037
1038
1039 @node Misc Options, , Motion Commands, The IDLWAVE Major Mode
1040 @section Miscellaneous Options
1041
1042 @defopt idlwave-help-application
1043 The external application providing reference help for programming.
1044 @end defopt
1045
1046 @defopt idlwave-startup-message (@code{t})
1047 Non-@code{nil} means display a startup message when @code{idlwave-mode}'
1048 is first called.
1049 @end defopt
1050
1051 @defopt idlwave-mode-hook
1052 Normal hook. Executed when a buffer is put into @code{idlwave-mode}.
1053 @end defopt
1054
1055 @defopt idlwave-load-hook
1056 Normal hook. Executed when @file{idlwave.el} is loaded.
1057 @end defopt
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
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}
1078
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
1088
1089 @menu
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
1093 @end menu
1094
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
1101
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
1109
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
1115
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
1119
1120 @defopt idlwave-shell-explicit-file-name
1121 This is the command to run IDL.
1122 @end defopt
1123
1124 @defopt idlwave-shell-command-line-options
1125 A list of command line options for calling the IDL program.
1126 @end defopt
1127
1128 @defopt idlwave-shell-prompt-pattern
1129 Regexp to match IDL prompt at beginning of a line.
1130 @end defopt
1131
1132 @defopt idlwave-shell-process-name
1133 Name to be associated with the IDL process.
1134 @end defopt
1135
1136 @defopt idlwave-shell-automatic-start
1137 Non-@code{nil} means attempt to invoke idlwave-shell if not already
1138 running.
1139 @end defopt
1140
1141 @defopt idlwave-shell-initial-commands
1142 Initial commands, separated by newlines, to send to IDL.
1143 @end defopt
1144
1145 @defopt idlwave-shell-use-dedicated-frame (@code{nil})
1146 Non-@code{nil} means, IDLWAVE should use a special frame to display
1147 shell buffer.
1148 @end defopt
1149
1150 @defopt idlwave-shell-frame-parameters
1151 The frame parameters for a dedicated idlwave-shell frame.
1152 @end defopt
1153
1154 @defopt idlwave-shell-temp-pro-prefix
1155 The prefix for temporary IDL files used when compiling regions.@refill
1156 @end defopt
1157
1158 @defopt idlwave-shell-mode-hook
1159 Hook for customizing @code{idlwave-shell-mode}.
1160 @end defopt
1161
1162 @node Using the Shell, Debugging IDL Programs, Starting the Shell, The IDLWAVE Shell
1163 @section Using the Shell
1164 @cindex comint
1165 @cindex Shell, basic commands
1166
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
1171
1172 @multitable @columnfractions .12 .88
1173 @item @kbd{M-p}
1174 @tab Cycle backwards in input history matching input
1175 @item @kbd{M-n}
1176 @tab Cycle forwards
1177 @item @kbd{M-r}
1178 @tab Previous input matching a regexp
1179 @item @kbd{M-s}
1180 @tab Next input that matches a regexp
1181 @item @kbd{return}
1182 @tab Send input or copy line to current prompt
1183 @item @kbd{C-c C-a}
1184 @tab Beginning of line; skip prompt
1185 @item @kbd{C-c C-u}
1186 @tab Kill input to beginning of line
1187 @item @kbd{C-c C-w}
1188 @tab Kill word before cursor
1189 @item @kbd{C-c C-c}
1190 @tab Send ^C
1191 @item @kbd{C-c C-z}
1192 @tab Send ^Z
1193 @item @kbd{C-c C-\}
1194 @tab Send ^\
1195 @item @kbd{C-c C-o}
1196 @tab Delete last batch of process output
1197 @item @kbd{C-c C-r}
1198 @tab Show last batch of process output
1199 @item @kbd{C-c C-l}
1200 @tab List input history
1201 @end multitable
1202
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
1207
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}
1216 @item @kbd{C-c ?}
1217 @tab Routine Info display (@code{idlwave-routine-info})
1218 @item @kbd{M-?}
1219 @tab IDL online help on routine (@code{idlwave-routine-info-from-idlhelp})
1220 @item @kbd{C-c C-i}
1221 @tab Update routine info from buffers and shell
1222 (@code{idlwave-update-routine-info})
1223 @item @kbd{C-c C-v}
1224 @tab Find the source file of a routine (@code{idlwave-find-module})
1225 @item @kbd{C-c =}
1226 @tab Compile a library routine (@code{idlwave-resolve})
1227 @end multitable
1228
1229 @defopt idlwave-shell-file-name-chars
1230 The characters allowed in file names, as a string. Used for file name
1231 completion.@refill
1232 @end defopt
1233
1234 @node Debugging IDL Programs, , Using the Shell, The IDLWAVE Shell
1235 @section Debugging IDL Programs
1236 @cindex Debugging
1237 @cindex Keybindings for debugging
1238 @cindex Toolbar
1239
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
1246
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.
1254
1255 @defopt idlwave-shell-prefix-key
1256 The prefix key for the debugging map
1257 @code{idlwave-shell-mode-prefix-map}.@refill
1258 @end defopt
1259
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}.
1263 @end defopt
1264
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}.
1268 @end defopt
1269
1270 @defopt idlwave-shell-use-toolbar (@code{t})
1271 Non-@code{nil} means, use the debugging toolbar in all IDL related
1272 buffers.@refill
1273 @end defopt
1274
1275
1276 @menu
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?
1280 @end menu
1281
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
1288
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
1294 re-compiled.
1295
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
1304
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
1309 @end defopt
1310
1311 @defopt idlwave-shell-overlay-arrow
1312 The overlay arrow to display at source lines where execution
1313 halts.@refill
1314 @end defopt
1315
1316 @defopt idlwave-shell-stop-line-face
1317 The face which highlights the source line where IDL is
1318 stopped.@refill
1319 @end defopt
1320
1321 @node Breakpoints and Stepping, Examining Variables, Compiling Programs, Debugging IDL Programs
1322 @subsection Breakpoints and Stepping
1323 @cindex Breakpoints
1324 @cindex Stepping
1325
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
1336
1337 Once the program has stopped somewhere, you can step through it. Here
1338 is a summary of the breakpoint and stepping commands:
1339
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})
1369 @end multitable
1370
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}.
1375 @end defopt
1376
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
1380 @end defopt
1381
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
1389
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
1397 point.
1398
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:
1403
1404 @lisp
1405 (add-hook 'idlwave-shell-mode-hook
1406 (lambda()
1407 (define-key idlwave-mode-map [(shift mouse-2)]
1408 'idlwave-shell-mouse-print)))
1409 @end lisp
1410
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
1421
1422 @itemize @bullet
1423 @item
1424 Array expressions must use the @samp{[ ]} index delimiters. Identifiers
1425 with a @samp{( )} will be interpreted as function calls.
1426 @item
1427 Variable names in the expression may not start with an underscore
1428 @samp{_}.
1429 @item
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.
1434 @end itemize
1435
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.
1440 @end defopt
1441
1442 @defopt idlwave-shell-print-expression-function (@code{nil})
1443 A function to handle special display of evaluated expressions.
1444 @end defopt
1445
1446 @node Installation, Acknowledgement, The IDLWAVE Shell, Top
1447 @chapter Installation
1448 @cindex Installation
1449 @cindex FTP site
1450 @cindex URL, homepage for IDLWAVE
1451 @cindex Homepage for IDLWAVE
1452
1453 @menu
1454 * Installing IDLWAVE:: How to install the distribution
1455 * Upgrading from idl.el:: Necessary configuration changes
1456 @end menu
1457
1458 @node Installing IDLWAVE, Upgrading from idl.el, Installation, Installation
1459 @section Installing IDLWAVE
1460
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
1465
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
1469
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
1475
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}.
1479
1480 @enumerate
1481 @item
1482 Change all variable and function prefixes from @samp{idl-} to @samp{idlwave-}.
1483 @item
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.
1486 @item
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
1491 @lisp
1492 (setq idlwave-shell-use-dedicated-frame t)
1493 @end lisp
1494 @item
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
1498 @end enumerate
1499
1500 @node Acknowledgement, Sources of Routine Info, Installation, Top
1501 @chapter Acknowledgement
1502 @cindex Acknowledgement
1503 @cindex Thanks
1504
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}.
1509
1510 Thanks to the following people who have contributed to the development
1511 of IDLWAVE with patches, ideas, bug reports and suggestions.
1512
1513 @itemize @minus
1514 @item
1515 Ulrik Dickow <dickow@@nbi.dk>
1516 @item
1517 Eric E. Dors <edors@@lanl.gov>
1518 @item
1519 Stein Vidar H. Haugan <s.v.h.haugan@@astro.uio.no>
1520 @item
1521 David Huenemoerder <dph@@space.mit.edu>
1522 @item
1523 Kevin Ivory <Kevin.Ivory@@linmpi.mpg.de>
1524 @item
1525 Xuyong Liu <liu@@stsci.edu>
1526 @item
1527 Simon Marshall <Simon.Marshall@@esrin.esa.it>
1528 @item
1529 Laurent Mugnier <mugnier@@onera.fr>
1530 @item
1531 Lubos Pochman <lubos@@rsinc.com>
1532 @item
1533 Patrick M. Ryan <pat@@jaameri.gsfc.nasa.gov>
1534 @item
1535 Marty Ryba <ryba@@ll.mit.edu>
1536 @item
1537 Phil Williams <williams@@irc.chmcc.org>
1538 @item
1539 J.D. Smith <jdsmith@@astrosun.tn.cornell.edu>
1540 @item
1541 Phil Sterne <sterne@@dublin.llnl.gov>
1542 @end itemize
1543
1544 @node Sources of Routine Info, Configuration Examples, Acknowledgement, Top
1545 @appendix Sources of Routine Info
1546
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.
1551
1552 @menu
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
1557 @end menu
1558
1559 @node Routine Definitions, Routine Information Sources, Sources of Routine Info, Sources of Routine Info
1560 @section Routine Definitions
1561 @cindex Routine definitions
1562
1563 Routines which can be used in an IDL program can be defined in several
1564 places:
1565
1566 @enumerate
1567 @item
1568 @emph{System routines} are defined inside IDL itself. The source
1569 code of such routines is not accessible to the user.@refill
1570 @item
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
1574 @item
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
1578 dynamically.@refill
1579 @item
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
1584 routines.@refill
1585 @end enumerate
1586
1587 @node Routine Information Sources, Library Scan, Routine Definitions, Sources of Routine Info
1588 @section Routine Information Sources
1589 @cindex Routine info sources
1590
1591 In oder to know about as many routines as possible, IDLWAVE will do the
1592 following to collect information:@refill
1593
1594 @enumerate
1595
1596 @item
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
1604
1605 @item
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
1611
1612 @item
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
1619
1620 @item
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
1625 @end enumerate
1626
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
1630 buffer.@refill
1631 @end defopt
1632
1633 @defopt idlwave-query-shell-for-routine-info (@code{t})
1634 Non-@code{nil} means query the shell for info about compiled routines.
1635 @end defopt
1636
1637
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
1642
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
1651
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
1663
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
1668
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
1677
1678 @defopt idlwave-libinfo-file
1679 File for routine information of the IDL library.
1680 @end defopt
1681
1682 @defopt idlwave-library-path
1683 IDL library path for Windows and MacOS. Not needed under Unix.
1684 @end defopt
1685
1686
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}
1692
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
1702 itself.@refill
1703
1704 @node Configuration Examples, Index, Sources of Routine Info, Top
1705 @appendix Configuration Examples
1706 @cindex Configuration examples
1707 @cindex Example configuration
1708
1709 @noindent
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?
1713
1714 @noindent
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
1718 @itemize @minus
1719 @item
1720 are not self-evident (i.e. too magic) when used by an unsuspecting user
1721 @item
1722 are too intrusive
1723 @item
1724 will not work properly on all Emacs installations out there
1725 @item
1726 break with what I think are widely used standards.
1727 @end itemize
1728
1729 @noindent To see what I mean, here is the @emph{entire} configuration I
1730 have in my @file{.emacs}:
1731
1732 @lisp
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
1740 (lambda()
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)))
1745 @end lisp
1746
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
1752
1753 @example
1754 ;;; Settings for IDLWAVE mode
1755
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
1771
1772 ;; Some setting can only be done from a mode hook. Here is an example:
1773
1774 (add-hook 'idlwave-mode-hook
1775 (lambda ()
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
1781 ;;
1782 ;; Pad with with 1 space (if -n is used then make the
1783 ;; padding a minimum of n spaces.) The defaults use -1
1784 ;; instead of 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))
1789 ;;
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))
1793 ;;
1794 ;; Pad only after `->', remove any space before the arrow
1795 (idlwave-action-and-binding "->" '(idlwave-surround 0 -1 nil 2))
1796 ;;;
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.
1805 ))
1806
1807 ;;; Settings for IDLWAVE SHELL mode
1808
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
1815 @end example
1816
1817 @node Index, , Configuration Examples, Top
1818 @unnumbered Index
1819 @printindex cp
1820
1821 @summarycontents
1822 @contents
1823 @bye
1824