aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ.D. Smith2004-11-17 05:56:18 +0000
committerJ.D. Smith2004-11-17 05:56:18 +0000
commit12b86f0e396d5451068cd4c31f85b8c72e476e36 (patch)
treebe30f56e2116b95d4b35b3a08973baf0dd6eca0f
parent52a244ebe2bad252967dc1cb72038b43ecc56278 (diff)
downloademacs-12b86f0e396d5451068cd4c31f85b8c72e476e36.tar.gz
emacs-12b86f0e396d5451068cd4c31f85b8c72e476e36.zip
Updated to IDLWAVE version 5.5. See idlwave.org.
-rw-r--r--man/idlwave.texi2318
1 files changed, 1511 insertions, 807 deletions
diff --git a/man/idlwave.texi b/man/idlwave.texi
index 9c803790171..c0878f1a206 100644
--- a/man/idlwave.texi
+++ b/man/idlwave.texi
@@ -1,34 +1,38 @@
1\input texinfo @c -*-texinfo-*- 1\input texinfo @c -*-texinfo-*-
2@c %**start of header 2@c %**start of header
3@setfilename ../info/idlwave 3@setfilename idlwave
4@settitle IDLWAVE User Manual 4@settitle IDLWAVE User Manual
5@dircategory Emacs
6@direntry
7* IDLWAVE: (idlwave). Major mode and shell for IDL files.
8@end direntry
5@synindex ky cp 9@synindex ky cp
6@syncodeindex vr cp 10@syncodeindex vr cp
7@syncodeindex fn cp 11@syncodeindex fn cp
8@set VERSION 4.15 12@set VERSION 5.5
9@set EDITION 4.15 13@set EDITION 5.5
10@set IDLVERSION 5.5 14@set IDLVERSION 6.1
11@set NSYSROUTINES 1324 15@set NSYSROUTINES 1850
12@set NSYSKEYWORDS 6129 16@set NSYSKEYWORDS 7685
13@set DATE September 2002 17@set DATE November, 2004
14@set AUTHOR J.D. Smith & Carsten Dominik 18@set AUTHOR J.D. Smith & Carsten Dominik
15@set AUTHOR-EMAIL dominik@@astro.uva.nl 19@set AUTHOR-EMAIL jdsmith@@as.arizona.edu
16@set MAINTAINER J.D. Smith 20@set MAINTAINER J.D. Smith
17@set MAINTAINER-EMAIL jdsmith@@as.arizona.edu 21@set MAINTAINER-EMAIL jdsmith@@as.arizona.edu
18@set IDLWAVE-HOMEPAGE http://idlwave.org/ 22@set IDLWAVE-HOMEPAGE http://idlwave.org/
19@c %**end of header 23@c %**end of header
24@finalout
20 25
21@copying 26@ifinfo
22This file documents IDLWAVE, a major mode for editing IDL files with 27This file documents IDLWAVE, a major mode for editing IDL files with
23Emacs, and interacting with an IDL shell run as a subprocess. 28Emacs, and interacting with an IDL shell run as a subprocess.
24 29
25This is edition @value{EDITION} of the IDLWAVE User Manual for IDLWAVE 30This is edition @value{EDITION} of the IDLWAVE User Manual for IDLWAVE
26@value{VERSION} 31@value{VERSION}
27 32
28Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software Foundation, 33Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004 Free Software
29Inc. 34Foundation, Inc.
30 35
31@quotation
32Permission is granted to copy, distribute and/or modify this document 36Permission is granted to copy, distribute and/or modify this document
33under the terms of the GNU Free Documentation License, Version 1.1 or 37under the terms of the GNU Free Documentation License, Version 1.1 or
34any later version published by the Free Software Foundation; with no 38any later version published by the Free Software Foundation; with no
@@ -45,27 +49,38 @@ This document is part of a collection distributed under the GNU Free
45Documentation License. If you want to distribute this document 49Documentation License. If you want to distribute this document
46separately from the collection, you can do so by adding a copy of the 50separately from the collection, you can do so by adding a copy of the
47license to the document, as described in section 6 of the license. 51license to the document, as described in section 6 of the license.
48@end quotation 52@end ifinfo
49@end copying
50
51@dircategory Emacs
52@direntry
53* IDLWAVE: (idlwave). Major mode and shell for IDL files.
54@end direntry
55
56@finalout
57 53
58@titlepage 54@titlepage
59@title IDLWAVE User Manual 55@title IDLWAVE User Manual
60@subtitle Emacs major mode and shell for IDL 56@subtitle Emacs major mode and shell for IDL
61@subtitle Edition @value{EDITION}, @value{DATE} 57@subtitle Edition @value{EDITION}, @value{DATE}
62 58
63@author by Carsten Dominik & J.D. Smith 59@author by J.D. Smith & Carsten Dominik
64@page 60@page
65This is edition @value{EDITION} of the @cite{IDLWAVE User Manual} for 61This is edition @value{EDITION} of the @cite{IDLWAVE User Manual} for
66IDLWAVE version @value{VERSION}, @value{DATE}. 62IDLWAVE version @value{VERSION}, @value{DATE}.
63@sp 2
64Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004 Free Software
65Foundation, Inc.
66@sp 2
67@cindex Copyright, of IDLWAVE 67@cindex Copyright, of IDLWAVE
68@insertcopying 68Permission is granted to copy, distribute and/or modify this document
69under the terms of the GNU Free Documentation License, Version 1.1 or
70any later version published by the Free Software Foundation; with no
71Invariant Sections, with the Front-Cover texts being ``A GNU
72Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
73license is included in the section entitled ``GNU Free Documentation
74License'' in the Emacs manual.
75
76(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
77this GNU Manual, like GNU software. Copies published by the Free
78Software Foundation raise funds for GNU development.''
79
80This document is part of a collection distributed under the GNU Free
81Documentation License. If you want to distribute this document
82separately from the collection, you can do so by adding a copy of the
83license to the document, as described in section 6 of the license.
69@end titlepage 84@end titlepage
70@contents 85@contents
71 86
@@ -75,23 +90,24 @@ IDLWAVE version @value{VERSION}, @value{DATE}.
75 90
76@node Top, Introduction, (dir), (dir) 91@node Top, Introduction, (dir), (dir)
77 92
78IDLWAVE is a package which supports editing source for the 93IDLWAVE is a package which supports editing source code written in the
79Interactive Data Language (IDL), and running IDL as an inferior 94Interactive Data Language (IDL), and running IDL as an inferior shell.
80shell.
81 95
82@end ifnottex 96@end ifnottex
83 97
84@menu 98@menu
85* Introduction:: What IDLWAVE is and what it's not 99* Introduction:: What IDLWAVE is, and what it is not
86* IDLWAVE in a Nutshell:: One page quick-start guide 100* IDLWAVE in a Nutshell:: One page quick-start guide
87* Getting Started:: Tutorial 101* Getting Started:: Tutorial
88* The IDLWAVE Major Mode:: The mode to edit IDL programs 102* The IDLWAVE Major Mode:: The mode for editing IDL programs
89* The IDLWAVE Shell:: The mode to run IDL as an inferior program 103* The IDLWAVE Shell:: The mode for running IDL as an inferior program
90* Installation:: How to Install or Upgrade 104* Installation:: How to Install or Upgrade
91* Acknowledgements:: Who did what 105* Acknowledgements:: Who did what
92* Sources of Routine Info:: How does IDLWAVE know about routine XYZ 106* Sources of Routine Info:: How does IDLWAVE know about routine XYZ
93* Configuration Examples:: The user is king... 107* HTML Help Browser Tips::
108* Configuration Examples:: The user is king
94* Windows and MacOS:: What still works, and how 109* Windows and MacOS:: What still works, and how
110* Troubleshooting:: When good computers turn bad
95* Index:: Fast access 111* Index:: Fast access
96 112
97@detailmenu 113@detailmenu
@@ -99,9 +115,9 @@ shell.
99 115
100Getting Started (Tutorial) 116Getting Started (Tutorial)
101 117
102* Lesson I -- Development Cycle:: 118* Lesson I -- Development Cycle::
103* Lesson II -- Customization:: 119* Lesson II -- Customization::
104* Lesson III -- Library Catalog:: 120* Lesson III -- User Catalog::
105 121
106The IDLWAVE Major Mode 122The IDLWAVE Major Mode
107 123
@@ -121,17 +137,22 @@ The IDLWAVE Major Mode
121Code Formatting 137Code Formatting
122 138
123* Code Indentation:: Reflecting the logical structure 139* Code Indentation:: Reflecting the logical structure
124* Continued Statement Indentation:: 140* Continued Statement Indentation::
125* Comment Indentation:: Special indentation for comment lines 141* Comment Indentation:: Special indentation for comment lines
126* Continuation Lines:: Splitting statements over lines 142* Continuation Lines:: Splitting statements over lines
127* Syntax Highlighting:: Font-lock support 143* Syntax Highlighting:: Font-lock support
128* Octals and Highlighting:: Why "123 causes problems 144* Octals and Highlighting:: Why "123 causes problems
129 145
146Online Help
147
148* Help with HTML Documentation::
149* Help with Source::
150
130Completion 151Completion
131 152
132* Case of Completed Words:: CaseOFcomPletedWords 153* Case of Completed Words:: CaseOFcomPletedWords
133* Object Method Completion and Class Ambiguity:: obj->Method, what? 154* Object Method Completion and Class Ambiguity:: obj->Method, what?
134* Object Method Completion in the Shell:: 155* Object Method Completion in the Shell::
135* Class and Keyword Inheritance:: obj->Method, _EXTRA=e 156* Class and Keyword Inheritance:: obj->Method, _EXTRA=e
136* Structure Tag Completion:: Completing state.Tag 157* Structure Tag Completion:: Completing state.Tag
137 158
@@ -145,32 +166,38 @@ The IDLWAVE Shell
145 166
146* Starting the Shell:: How to launch IDL as a subprocess 167* Starting the Shell:: How to launch IDL as a subprocess
147* Using the Shell:: Interactively working with the Shell 168* Using the Shell:: Interactively working with the Shell
148* Commands Sent to the Shell:: 169* Commands Sent to the Shell::
149* Debugging IDL Programs:: 170* Debugging IDL Programs::
150* Examining Variables:: 171* Examining Variables::
151* Custom Expression Examination:: 172* Custom Expression Examination::
152 173
153Debugging IDL Programs 174Debugging IDL Programs
154 175
155* Debug Key Bindings:: 176* A Tale of Two Modes::
156* Compiling Programs:: 177* Debug Key Bindings::
157* Breakpoints and Stepping:: 178* Breakpoints and Stepping::
158* Walking the Calling Stack:: 179* Compiling Programs::
180* Walking the Calling Stack::
181* Electric Debug Mode::
159 182
160Installation 183Installation
161 184
162* Installing IDLWAVE:: How to install the distribution 185* Installing IDLWAVE:: How to install the distribution
163* Installing Online Help:: Where to get the additional files needed 186* Installing Online Help:: Where to get the additional files needed
164* Upgrading from idl.el:: Necessary configuration changes
165 187
166Sources of Routine Info 188Sources of Routine Info
167 189
168* Routine Definitions:: Where IDL Routines are defined. 190* Routine Definitions:: Where IDL Routines are defined.
169* Routine Information Sources:: So how does IDLWAVE know about... 191* Routine Information Sources:: So how does IDLWAVE know about...
170* Library Catalog:: Scanning the Libraries for Routine Info 192* Catalogs::
171* Load-Path Shadows:: Routines defined in several places 193* Load-Path Shadows:: Routines defined in several places
172* Documentation Scan:: Scanning the IDL Manuals 194* Documentation Scan:: Scanning the IDL Manuals
173 195
196Catalogs
197
198* Library Catalogs::
199* User Catalog::
200
174@end detailmenu 201@end detailmenu
175@end menu 202@end menu
176 203
@@ -185,38 +212,44 @@ Sources of Routine Info
185@cindex @file{idl-shell.el} 212@cindex @file{idl-shell.el}
186@cindex Feature overview 213@cindex Feature overview
187 214
188IDLWAVE is a package which supports editing source files for the 215IDLWAVE is a package which supports editing source files written in
189Interactive Data Language (IDL@footnote{IDL is a registered trademark of 216the Interactive Data Language (IDL@footnote{IDL is a registered
190Research Systems, Inc., a Kodak Company}), and for running IDL as an 217trademark of Research Systems, Inc., a Kodak Company}), and running
191inferior shell@footnote{Note that this package has nothing to do with 218IDL as an inferior shell@footnote{Note that this package has nothing
192the Interface Definition Language, part of the Common Object Request 219to do with the Interface Definition Language, part of the Common
193Broker Architecture (CORBA)}. It can also be used for editing source 220Object Request Broker Architecture (CORBA)}@footnote{IDLWAVE can also
194files for the related WAVE/CL language, but with only limited 221be used for editing source files for the related WAVE/CL language, but
195support. 222with only limited support.}. It is a feature-rich replacement for the
196 223IDLDE development environment bundled with IDL, and uses the full
197IDLWAVE consists of two main parts: a major mode for editing IDL source 224power of Emacs to make editing and running IDL programs easier,
198files files (@code{idlwave-mode}) and a mode for running the IDL program 225quicker, and more structured.
199as an inferior shell (@code{idlwave-shell-mode}). Although one mode can 226
200be used without the other, both work together closely to form a complete 227IDLWAVE consists of two main parts: a major mode for editing IDL
201development environment. Here is a brief summary of what IDLWAVE does: 228source files (@code{idlwave-mode}) and a mode for running the IDL
229program as an inferior shell (@code{idlwave-shell-mode}). Although
230one mode can be used without the other, both work together closely to
231form a complete development environment. Here is a brief summary of
232what IDLWAVE does:
202 233
203@itemize @bullet 234@itemize @bullet
204@item 235@item
205Code indentation and formatting. 236Smart code indentation and automatic-formatting.
206@item 237@item
207Three level syntax highlighting support. 238Three level syntax highlighting support.
208@item 239@item
209Context-sensitive display of calling sequences and keywords for more 240Context-sensitive display of calling sequences and keywords for more
210than 1000 native IDL routines, extendible to any number of additional 241than 1000 native IDL routines, extendible to any additional number of
211routines in your local IDL libraries. 242local routines, and already available with many pre-scanned libraries.
212@item 243@item
213Routine name space conflict search, likelihood-of-use ranking. 244Routine name space conflict search with likelihood-of-use ranking.
214@item 245@item
215Fast, context-sensitive online help. 246Fast, context-sensitive online HTML help, or source-header help for
247undocumented routines.
216@item 248@item
217Context sensitive completion of routine names and keywords. 249Context sensitive completion of routine names, keywords, system
250variables, class names and much more.
218@item 251@item
219Easy insertion of code templates. 252Easy insertion of code templates and abbreviations of common constructs.
220@item 253@item
221Automatic corrections to enforce a variety of customizable coding 254Automatic corrections to enforce a variety of customizable coding
222standards. 255standards.
@@ -231,8 +264,8 @@ Running IDL as an inferior Shell with history search, command line
231editing and all the completion and routine info capabilities present in 264editing and all the completion and routine info capabilities present in
232IDL source buffers. 265IDL source buffers.
233@item 266@item
234Compilation, execution and interactive debugging of programs directly 267Compilation, execution and interactive single-keystroke debugging of
235from the source buffer. 268programs directly from the source buffer.
236@item 269@item
237Quick, source-guided navigation of the calling stack, with variable 270Quick, source-guided navigation of the calling stack, with variable
238inspection, etc. 271inspection, etc.
@@ -261,12 +294,10 @@ stopped at a breakpoint}
261@end itemize 294@end itemize
262@end ifnottex 295@end ifnottex
263 296
264IDLWAVE is the successor to the @file{idl.el} and @file{idl-shell.el} 297IDLWAVE is the distant successor to the @file{idl.el} and
265files written by Chris Chase. The modes and files had to be renamed 298@file{idl-shell.el} files written by Chris Chase. The modes and files
266because of a name space conflict with CORBA's @code{idl-mode}, defined in 299had to be renamed because of a name space conflict with CORBA's
267Emacs in the file @file{cc-mode.el}. If you have been using the old 300@code{idl-mode}, defined in Emacs in the file @file{cc-mode.el}.
268files, check @ref{Upgrading from idl.el} for information on how to
269switch.
270 301
271In this manual, each section ends with a list of related user options. 302In this manual, each section ends with a list of related user options.
272Don't be confused by the sheer number of options available --- in most 303Don't be confused by the sheer number of options available --- in most
@@ -307,6 +338,8 @@ at point.
307@tab Update IDLWAVE's knowledge about functions and procedures. 338@tab Update IDLWAVE's knowledge about functions and procedures.
308@item @kbd{C-c C-v} 339@item @kbd{C-c C-v}
309@tab Visit the source code of a procedure/function. 340@tab Visit the source code of a procedure/function.
341@item @kbd{C-u C-c C-v}
342@tab Visit the source code of a procedure/function in this buffer.
310@item @kbd{C-c C-h} 343@item @kbd{C-c C-h}
311@tab Insert a standard documentation header. 344@tab Insert a standard documentation header.
312@item @kbd{C-c @key{RET}} 345@item @kbd{C-c @key{RET}}
@@ -322,16 +355,22 @@ at point.
322@tab Cycle back through IDL command history. 355@tab Cycle back through IDL command history.
323@item @kbd{M-n} 356@item @kbd{M-n}
324@tab Cycle forward. 357@tab Cycle forward.
325@item @kbd{M-@key{TAB}} 358@item @kbd{@key{TAB}}
326@tab Complete a procedure name, function name or keyword in the shell buffer. 359@tab Complete a procedure name, function name or keyword in the shell buffer.
327@item @kbd{C-c C-d C-c} 360@item @kbd{C-c C-d C-c}
328@tab Save and compile the source file in the current buffer. 361@tab Save and compile the source file in the current buffer.
329@item @kbd{C-c C-d C-x} 362@item @kbd{C-c C-d C-x}
330@tab Goto next syntax error. 363@tab Go to next syntax error.
364@item @kbd{C-c C-d C-v}
365@tab Switch to electric debug mode.
331@item @kbd{C-c C-d C-b} 366@item @kbd{C-c C-d C-b}
332@tab Set a breakpoint at the nearest viable source line. 367@tab Set a breakpoint at the nearest viable source line.
333@item @kbd{C-c C-d C-d} 368@item @kbd{C-c C-d C-d}
334@tab Clear the nearest breakpoint. 369@tab Clear the nearest breakpoint.
370@item @kbd{C-c C-d [}
371@tab Go to the previous breakpoint.
372@item @kbd{C-c C-d ]}
373@tab Go to the next breakpoint.
335@item @kbd{C-c C-d C-p} 374@item @kbd{C-c C-d C-p}
336@tab Print the value of the expression near point in IDL. 375@tab Print the value of the expression near point in IDL.
337@end multitable 376@end multitable
@@ -353,8 +392,6 @@ at point.
353(setq idlwave-shell-automatic-start t) 392(setq idlwave-shell-automatic-start t)
354;; Bind debugging commands with CONTROL and SHIFT modifiers 393;; Bind debugging commands with CONTROL and SHIFT modifiers
355(setq idlwave-shell-debug-modifiers '(control shift)) 394(setq idlwave-shell-debug-modifiers '(control shift))
356;; Specify the online help files' location.
357(setq idlwave-help-directory "~/.idlwave")
358@end lisp 395@end lisp
359 396
360@ifhtml 397@ifhtml
@@ -367,20 +404,21 @@ at point.
367@cindex Getting Started 404@cindex Getting Started
368 405
369@menu 406@menu
370* Lesson I -- Development Cycle:: 407* Lesson I -- Development Cycle::
371* Lesson II -- Customization:: 408* Lesson II -- Customization::
372* Lesson III -- Library Catalog:: 409* Lesson III -- User Catalog::
373@end menu 410@end menu
374 411
375@node Lesson I -- Development Cycle, Lesson II -- Customization, Getting Started, Getting Started 412@node Lesson I -- Development Cycle, Lesson II -- Customization, Getting Started, Getting Started
376@section Lesson I: Development Cycle 413@section Lesson I: Development Cycle
377 414
378The purpose of this tutorial is to guide you through a very basic 415The purpose of this tutorial is to guide you through a very basic
379development cycle using IDLWAVE. We will paste a simple program into a 416development cycle using IDLWAVE. We will paste a simple program into
380buffer and use the shell to compile, debug and run it. On the way we 417a buffer and use the shell to compile, debug and run it. On the way
381will use many of the important IDLWAVE commands. Note however that 418we will use many of the important IDLWAVE commands. Note, however,
382there are many more capabilities in IDLWAVE than covered here, which can 419that IDLWAVE has many more capabilities than covered here, which can
383be discovered by reading the entire manual. 420be discovered by reading the entire manual, or hovering over the
421shoulder of your nearest IDLWAVE guru for a few days.
384 422
385It is assumed that you have access to Emacs or XEmacs with the full 423It is assumed that you have access to Emacs or XEmacs with the full
386IDLWAVE package including online help (@pxref{Installation}). We also 424IDLWAVE package including online help (@pxref{Installation}). We also
@@ -395,9 +433,9 @@ Open a new source file by typing:
395@kbd{C-x C-f tutorial.pro @key{RET}} 433@kbd{C-x C-f tutorial.pro @key{RET}}
396@end example 434@end example
397 435
398A buffer for this file will pop up, and it should be in IDLWAVE mode, as 436A buffer for this file will pop up, and it should be in IDLWAVE mode,
399shown in the mode line just below the editing window. Also, the menu 437indicated in the mode line just below the editing window. Also, the
400bar should contain entries @samp{IDLWAVE} and @samp{Debug}. 438menu bar should contain @samp{IDLWAVE}.
401 439
402Now cut-and-paste the following code, also available as 440Now cut-and-paste the following code, also available as
403@file{tutorial.pro} in the IDLWAVE distribution. 441@file{tutorial.pro} in the IDLWAVE distribution.
@@ -412,13 +450,13 @@ function daynr,d,m,y
412 y1 = y * delta 450 y1 = y * delta
413 return, d + floor(m1*30.6)+floor(y1*365.25)+5 451 return, d + floor(m1*30.6)+floor(y1*365.25)+5
414end 452end
415 453
416function weekday,day,month,year 454function weekday,day,month,year
417 ;; compute weekday number for date 455 ;; compute weekday number for date
418 nr = daynr(day,month,year) 456 nr = daynr(day,month,year)
419 return, nr mod 7 457 return, nr mod 7
420end 458end
421 459
422pro plot_wday,day,month 460pro plot_wday,day,month
423 ;; Plot the weekday of a date in the first 10 years of this century. 461 ;; Plot the weekday of a date in the first 10 years of this century.
424 years = 2000,+indgen(10) 462 years = 2000,+indgen(10)
@@ -431,31 +469,35 @@ end
431@end example 469@end example
432 470
433The indentation probably looks funny, since it's different from the 471The indentation probably looks funny, since it's different from the
434settings you use, so use the @key{TAB} key in each line to automatically 472settings you use, so use the @key{TAB} key in each line to
435line it up (or more quickly @emph{select} the entire buffer with 473automatically line it up (or, more quickly, @emph{select} the entire
436@kbd{C-x h}, and indent the whole region with @kbd{C-M-\}). Notice how 474buffer with @kbd{C-x h}, and indent the whole region with
437different syntactical elements are highlighted in different colors, if 475@kbd{C-M-\}). Notice how different syntactical elements are
438you have set up support for font-lock. 476highlighted in different colors, if you have set up support for
477font-lock.
439 478
440Let's check out two particular editing features of IDLWAVE. Place the 479Let's check out two particular editing features of IDLWAVE. Place the
441cursor after the @code{end} statement of the @code{for} loop and press 480cursor after the @code{end} statement of the @code{for} loop and press
442@key{SPC}. IDLWAVE blinks back to the beginning of the block and 481@key{SPC}. IDLWAVE blinks back to the beginning of the block and
443changes the generic @code{end} to the specific @code{endfor} 482changes the generic @code{end} to the specific @code{endfor}
444automatically. Now place the cursor in any line you would like to split 483automatically (as long as the variable @code{idlwave-expand-generic-end}
445and press @kbd{M-@key{RET}}. The line is split at the cursor position, 484is turned on --- @pxref{Lesson II -- Customization}). Now place the
446with the continuation @samp{$} and indentation all taken care of. Use 485cursor in any line you would like to split and press @kbd{M-@key{RET}}.
447@kbd{C-/} to undo the last change. 486The line is split at the cursor position, with the continuation @samp{$}
448 487and indentation all taken care of. Use @kbd{C-/} to undo the last
449The procedure @code{plot_wday} is supposed to plot the weekday of a 488change.
450given date for the first 10 years of the 21st century. As in most code, 489
451there are a few bugs, which we are going to use IDLWAVE to help us fix. 490The procedure @code{plot_wday} is supposed to plot the day of the week
491of a given date for the first 10 years of the 21st century. As in
492most code, there are a few bugs, which we are going to use IDLWAVE to
493help us fix.
452 494
453First, let's launch the IDLWAVE shell. You do this with the command 495First, let's launch the IDLWAVE shell. You do this with the command
454@kbd{C-c C-s}. The Emacs window will split and display IDL running in a 496@kbd{C-c C-s}. The Emacs window will split or another window will popup
455shell interaction buffer. Type a few commands like @code{print,!PI} to 497to display IDL running in a shell interaction buffer. Type a few
456convince yourself that you can work there just as well as in a terminal, 498commands like @code{print,!PI} to convince yourself that you can work
457or the IDLDE. Use the arrow keys to cycle through your command history. 499there just as well as in a terminal, or the IDLDE. Use the arrow keys
458Are we having fun now? 500to cycle through your command history. Are we having fun now?
459 501
460Now go back to the source window and type @kbd{C-c C-d C-c} to compile 502Now go back to the source window and type @kbd{C-c C-d C-c} to compile
461the program. If you watch the shell buffer, you see that IDLWAVE types 503the program. If you watch the shell buffer, you see that IDLWAVE types
@@ -469,44 +511,47 @@ see the three routines compile.
469 511
470Now we want to use the command to plot the day of the week on January 512Now we want to use the command to plot the day of the week on January
4711st. We could type the full command ourselves, but why do that? Go 5131st. We could type the full command ourselves, but why do that? Go
472back to the shell window, type @samp{plot_} and hit @key{TAB}. After a 514back to the shell window, type @samp{plot_} and hit @key{TAB}. After
473bit of a delay (while IDLWAVE initializes its routine info database, if 515a bit of a delay (while IDLWAVE initializes its routine info database,
474necessary), the window will split to show all procedures it knows 516if necessary), the window will split to show all procedures it knows
475starting with that string, and @w{@code{plot_wday}} should be one of 517starting with that string, and @w{@code{plot_wday}} should be one of
476them. Saving the buffer alerted IDLWAVE about this new routine. Click 518them. Saving the buffer alerted IDLWAVE about this new routine.
477with the middle mouse button on @code{plot_wday} and it will be copied 519Click with the middle mouse button on @code{plot_wday} and it will be
478to the shell buffer, or if you prefer, add @samp{w} to @samp{plot_} to 520copied to the shell buffer, or if you prefer, add @samp{w} to
479make it unambiguous, hit @key{TAB} again, and the full routine name will 521@samp{plot_} to make it unambiguous (depending on what other routines
480be completed. Now provide the two arguments: 522starting with @samp{plot_} you have installed on your system), hit
523@key{TAB} again, and the full routine name will be completed. Now
524provide the two arguments:
481 525
482@example 526@example
483plot_wday,1,1 527plot_wday,1,1
484@end example 528@end example
485 529
486and press @key{RET}. This fails with an error message telling you the 530@noindent and press @key{RET}. This fails with an error message telling
487@code{YT} keyword to plot is ambiguous. What are the allowed keywords 531you the @code{YT} keyword to plot is ambiguous. What are the allowed
488again? Go back to the source window and put the cursor into the `plot' 532keywords again? Go back to the source window and put the cursor into
489line, and press @kbd{C-c ?}. This shows the routine info window for the 533the `plot' line and press @kbd{C-c ?}. This shows the routine info
490plot routine, which contains a list of keywords, along with the argument 534window for the plot routine, which contains a list of keywords, along
491list. Oh, we wanted @code{YTITLE}. Fix that up. Recompile with 535with the argument list. Oh, we wanted @code{YTITLE}. Fix that up.
492@kbd{C-c C-d C-c}. Jump back into the shell with @kbd{C-c C-s}, press 536Recompile with @kbd{C-c C-d C-c}. Jump back into the shell with
493the @key{UP} arrow to recall the previous command and execute again. 537@kbd{C-c C-s}, press the @key{UP} arrow to recall the previous command
538and execute again.
494 539
495This time we get a plot, but it is pretty ugly --- the points are all 540This time we get a plot, but it is pretty ugly --- the points are all
496connected with a line. Hmm, isn't there a way for @code{plot} to use 541connected with a line. Hmm, isn't there a way for @code{plot} to use
497symbols instead? What was that keyword? Position the cursor on the 542symbols instead? What was that keyword? Position the cursor on the
498plot line after a comma (where you'd normally type a keyword), and hit 543plot line after a comma (where you'd normally type a keyword), and hit
499@kbd{M-@key{Tab}}. A long list of plot's keywords appears. Aha, there 544@kbd{M-@key{Tab}}. A long list of plot's keywords appears. Aha,
500it is, @code{PSYM}. Middle click to insert it. An @samp{=} sign is 545there it is, @code{PSYM}. Middle click to insert it. An @samp{=}
501included for you too. Now what were the values of @code{PSYM} supposed 546sign is included for you too. Now what were the values of @code{PSYM}
502to be? With the cursor on or after the keyword, press @kbd{M-?} for 547supposed to be? With the cursor on or after the keyword, press
503online help (alternatively, you could have right clicked on the colored 548@kbd{M-?} for online help (alternatively, you could have right clicked
504keyword itself in the completion list). The online help window will pop 549on the colored keyword itself in the completion list). A browser will
505up showing the documentation for the @code{PYSM} keyword. OK, let's use 550pop up showing the HTML documentation for the @code{PYSM} keyword.
506diamonds=4. Fix this, recompile (you know the command by now: @kbd{C-c 551OK, let's use diamonds=4. Fix this, recompile (you know the command
507C-d C-c}, go back to the shell (if it's vanished, you know the command 552by now: @kbd{C-c C-d C-c}), go back to the shell (if it's vanished,
508to recall it by now: @kbd{C-c C-s}) and execute again. Now things look 553you know what to do: @kbd{C-c C-s}) and execute again. Now things
509pretty good. 554look pretty good.
510 555
511Let's try a different day --- how about April fool's day? 556Let's try a different day --- how about April fool's day?
512 557
@@ -518,16 +563,17 @@ Oops, this looks very wrong. All April fool's days cannot be Fridays!
518We've got a bug in the program, perhaps in the @code{daynr} function. 563We've got a bug in the program, perhaps in the @code{daynr} function.
519Let's put a breakpoint on the last line there. Position the cursor on 564Let's put a breakpoint on the last line there. Position the cursor on
520the @samp{return, d+...} line and press @kbd{C-c C-d C-b}. IDL sets a 565the @samp{return, d+...} line and press @kbd{C-c C-d C-b}. IDL sets a
521breakpoint (as you see in the shell window), and the line is highlighted 566breakpoint (as you see in the shell window), and the break line is
522in some way. Back to the shell buffer, re-execute the previous command. 567indicated. Back to the shell buffer, re-execute the previous command.
523IDL stops at the line with the breakpoint. Now hold down the SHIFT key 568IDL stops at the line with the breakpoint. Now hold down the SHIFT
524and click with the middle mouse button on a few variables there: 569key and click with the middle mouse button on a few variables there:
525@samp{d}, @samp{y}, @samp{m}, @samp{y1}, etc. Maybe @code{d} isn't the 570@samp{d}, @samp{y}, @samp{m}, @samp{y1}, etc. Maybe @code{d} isn't
526correct type. CONTROL-SHIFT middle-click on it for help. Well, it's an 571the correct type. CONTROL-SHIFT middle-click on it for help. Well,
527integer, so that's not the problem. Aha, @samp{y1} is zero, but it 572it's an integer, so that's not the problem. Aha, @samp{y1} is zero,
528should be the year, depending on delta. Shift click @samp{delta} to see 573but it should be the year, depending on delta. Shift click
529that it's 0. Below, we see the offending line: @samp{y1=y*delta...} the 574@samp{delta} to see that it's 0. Below, we see the offending line:
530multiplication should have been a minus sign! So fix the line to read: 575@samp{y1=y*delta...} the multiplication should have been a minus sign!
576Hit @kbd{q} to exit the debugging mode, and fix the line to read:
531 577
532@example 578@example
533y1 = y - delta 579y1 = y - delta
@@ -538,15 +584,15 @@ command. Everything should now work fine. How about those leap years?
538Change the code to plot 100 years and see that every 28 years, the 584Change the code to plot 100 years and see that every 28 years, the
539sequence of weekdays repeats. 585sequence of weekdays repeats.
540 586
541@node Lesson II -- Customization, Lesson III -- Library Catalog, Lesson I -- Development Cycle, Getting Started 587@node Lesson II -- Customization, Lesson III -- User Catalog, Lesson I -- Development Cycle, Getting Started
542@section Lesson II: Customization 588@section Lesson II: Customization
543 589
544Emacs is probably the most customizable piece of software available, and 590Emacs is probably the most customizable piece of software ever
545it would be a shame if you did not make use of this and adapt IDLWAVE to 591written, and it would be a shame if you did not make use of this and
546your own preferences. Customizing Emacs or IDLWAVE is accomplished by 592adapt IDLWAVE to your own preferences. Customizing Emacs or IDLWAVE
547setting Lisp variables in the @file{.emacs} file in your home directory 593is accomplished by setting Lisp variables in the @file{.emacs} file in
548--- but do not be dismayed; for the most part, you can just copy and work 594your home directory --- but do not be dismayed; for the most part, you
549from the examples given here. 595can just copy and work from the examples given here.
550 596
551Let's first use a boolean variable. These are variables which you turn 597Let's first use a boolean variable. These are variables which you turn
552on or off, much like a checkbox. A value of @samp{t} means on, a value 598on or off, much like a checkbox. A value of @samp{t} means on, a value
@@ -561,7 +607,8 @@ When this option is turned on, each reserved word you type into an IDL
561source buffer will be converted to upper case when you press @key{SPC} 607source buffer will be converted to upper case when you press @key{SPC}
562or @key{RET} right after the word. Try it out! @samp{if} changes to 608or @key{RET} right after the word. Try it out! @samp{if} changes to
563@samp{IF}, @samp{begin} to @samp{BEGIN}. If you don't like this 609@samp{IF}, @samp{begin} to @samp{BEGIN}. If you don't like this
564behavior, remove the option again from your @file{.emacs} file. 610behavior, remove the option again from your @file{.emacs} file and
611restart Emacs.
565 612
566You likely have your own indentation preferences for IDL code. For 613You likely have your own indentation preferences for IDL code. For
567example, some like to indent the main block of an IDL program from the 614example, some like to indent the main block of an IDL program from the
@@ -588,50 +635,52 @@ there is another, more user-friendly way to customize all the IDLWAVE
588variables. You can access it through the IDLWAVE menu in one of the 635variables. You can access it through the IDLWAVE menu in one of the
589@file{.pro} buffers, menu item @code{Customize->Browse IDLWAVE 636@file{.pro} buffers, menu item @code{Customize->Browse IDLWAVE
590Group}. Here you'll be presented with all the various variables grouped 637Group}. Here you'll be presented with all the various variables grouped
591into categories. You can navigate the hierarchy (e.g. Idlwave Code 638into categories. You can navigate the hierarchy (e.g. @samp{IDLWAVE
592Formatting->Idlwave Main Block Indent), read about the variables, change 639Code Formatting->Idlwave Abbrev And Indent Action->Idlwave Expand
593them, and `Save for Future Sessions'. Few of these variables need 640Generic End} to turn on @code{END} expansion), read about the variables,
594customization, but you can exercise considerable control over IDLWAVE's 641change them, and `Save for Future Sessions'. Few of these variables
595functionality with them. 642need customization, but you can exercise considerable control over
643IDLWAVE's functionality with them.
596 644
597You may also find the key bindings used for the debugging commands too 645You may also find the key bindings used for the debugging commands too
598long and complicated. Often we have heard such complaints, ``Do I 646long and complicated. Often we have heard complaints along the lines
599really have to type @kbd{C-c C-d C-c} to run a simple command?'' Due to 647of, ``Do I really have to go through the finger gymnastics of @kbd{C-c
600Emacs rules and conventions, shorter bindings cannot be set by default, 648C-d C-c} to run a simple command?'' Due to Emacs rules and
601but you can enable them. First, there is a way to assign all debugging 649conventions, shorter bindings cannot be set by default, but you can
602commands in a single sweep to other combinations. The only problem is 650easily enable them. First, there is a way to assign all debugging
603that we have to use something which Emacs does not need for other 651commands in a single sweep to another simpler combination. The only
604important commands. One good option is to execute debugging commands by 652problem is that we have to use something which Emacs does not need for
605holding down @key{CONTROL} and @key{SHIFT} while pressing a single 653other important commands. One good option is to execute debugging
606character: @kbd{C-S-b} for setting a breakpoint, @kbd{C-S-c} for 654commands by holding down @key{CONTROL} and @key{SHIFT} while pressing
607compiling the current source file, @kbd{C-S-a} for deleting all 655a single character: @kbd{C-S-b} for setting a breakpoint, @kbd{C-S-c}
608breakpoints. You can enable this with: 656for compiling the current source file, @kbd{C-S-a} for deleting all
657breakpoints (try it, it's easier). You can enable this with:
609 658
610@lisp 659@lisp
611(setq idlwave-shell-debug-modifiers '(shift control)) 660(setq idlwave-shell-debug-modifiers '(shift control))
612@end lisp 661@end lisp
613 662
614@noindent If you have a special keyboard with, for example, a 663@noindent If you have a special keyboard with, for example, a
615@key{HYPER} key, you could even shorten that: 664@key{SUPER} key, you could even shorten that:
616 665
617@lisp 666@lisp
618(setq idlwave-shell-debug-modifiers '(hyper)) 667(setq idlwave-shell-debug-modifiers '(super))
619@end lisp 668@end lisp
620 669
621@noindent to get compilation on @kbd{H-c}. Often, a modifier key like 670@noindent to get compilation on @kbd{S-c}. Often, a modifier key like
622@key{HYPER} or @key{SUPER} is bound or can be bound to an otherwise 671@key{SUPER} or @key{HYPER} is bound or can be bound to an otherwise
623unused key -- consult your system documentation. 672unused key on your keyboard --- consult your system documentation.
624 673
625You can also assign specific commands to keys. This you must do in the 674You can also assign specific commands to keys. This you must do in the
626@emph{mode-hook}, a special function which is run when a new buffer gets 675@emph{mode-hook}, a special function which is run when a new IDLWAVE
627set up. Keybindings can only be done when the buffer exists. The 676buffer gets set up. The possibilities for key customization are
628possibilities for key customization are endless. Here we set function 677endless. Here we set function keys f4-f8 to common debugging commands.
629keys f5-f8 to common debugging commands.
630 678
631@lisp 679@lisp
632;; First for the source buffer 680;; First for the source buffer
633(add-hook 'idlwave-mode-hook 681(add-hook 'idlwave-mode-hook
634 (lambda () 682 (lambda ()
683 (local-set-key [f4] 'idlwave-shell-retall)
635 (local-set-key [f5] 'idlwave-shell-break-here) 684 (local-set-key [f5] 'idlwave-shell-break-here)
636 (local-set-key [f6] 'idlwave-shell-clear-current-bp) 685 (local-set-key [f6] 'idlwave-shell-clear-current-bp)
637 (local-set-key [f7] 'idlwave-shell-cont) 686 (local-set-key [f7] 'idlwave-shell-cont)
@@ -639,43 +688,53 @@ keys f5-f8 to common debugging commands.
639;; Then for the shell buffer 688;; Then for the shell buffer
640(add-hook 'idlwave-shell-mode-hook 689(add-hook 'idlwave-shell-mode-hook
641 (lambda () 690 (lambda ()
691 (local-set-key [f4] 'idlwave-shell-retall)
642 (local-set-key [f5] 'idlwave-shell-break-here) 692 (local-set-key [f5] 'idlwave-shell-break-here)
643 (local-set-key [f6] 'idlwave-shell-clear-current-bp) 693 (local-set-key [f6] 'idlwave-shell-clear-current-bp)
644 (local-set-key [f7] 'idlwave-shell-cont) 694 (local-set-key [f7] 'idlwave-shell-cont)
645 (local-set-key [f8] 'idlwave-shell-clear-all-bp))) 695 (local-set-key [f8] 'idlwave-shell-clear-all-bp)))
646@end lisp 696@end lisp
647 697
648@node Lesson III -- Library Catalog, , Lesson II -- Customization, Getting Started 698@node Lesson III -- User Catalog, , Lesson II -- Customization, Getting Started
649@section Lesson III: Library Catalog 699@section Lesson III: User and Library Catalogs
650 700
651We have already used the routine info display in the first part of this 701We have already used the routine info display in the first part of this
652tutorial. This was the key @kbd{C-c ?} which displays information about 702tutorial. This was the invoked using @kbd{C-c ?}, and displays
653the IDL routine near the cursor position. Wouldn't it be nice 703information about the IDL routine near the cursor position. Wouldn't it
654to have the same available for your own library routines and for the 704be nice to have the same kind of information available for your own
655huge amount of code in major extension libraries like JHUPL or the 705routines and for the huge amount of code in major libraries like JHUPL
656IDL-Astro library? To do this, you must give IDLWAVE a chance to study 706or the IDL-Astro library? In many cases, you may already have this
657these routines first. We call this @emph{Building the library catalog}. 707information. Files named @file{.idlwave_catalog} in library directories
658 708contain scanned information on the routines in that directory; many
659From the IDLWAVE entry in the menu bar, select @code{Routine Info/Select 709popular libraries ship with these ``library catalogs'' pre-scanned.
660Catalog Directories}. If necessary, start the shell first with @kbd{C-c 710Users can scan their own routines in one of two ways: either using the
661C-s} (@pxref{Starting the Shell}). IDLWAVE will find out about the IDL 711supplied tool to scan directories and build their own
662@code{!PATH} variable and offer a list of directories on the path. 712@file{.idlwave_catalog} files, or using the built-in method to create a
663Simply select them all (or whichever you want) and click on the 713single ``user catalog'', which we'll show here. @xref{Catalogs}, for
664@samp{Scan&Save} button. Then go for a cup of coffee while IDLWAVE 714more information on choosing which method to use.
665collects information for each and every IDL routine on your search path. 715
666All this information is written to the file @file{.idlcat} in your home 716To build a user catalog, select @code{Routine Info/Select Catalog
667directory and will from now one be automatically loaded whenever you use 717Directories} from the IDLWAVE entry in the menu bar. If necessary,
718start the shell first with @kbd{C-c C-s} (@pxref{Starting the Shell}).
719IDLWAVE will find out about the IDL @code{!PATH} variable and offer a
720list of directories on the path. Simply select them all (or whichever
721you want --- directories with existing library catalogs will not be
722selected by default) and click on the @samp{Scan&Save} button. Then
723go for a cup of coffee while IDLWAVE collects information for each and
724every IDL routine on your search path. All this information is
725written to the file @file{.idlwave/idlusercat.el} in your home
726directory and will from now on automatically load whenever you use
668IDLWAVE. You may find it necessary to rebuild the catalog on occasion 727IDLWAVE. You may find it necessary to rebuild the catalog on occasion
669as your local libraries change. Try to use routine info (@kbd{C-c ?}) 728as your local libraries change, or build a library catalog for those
670or completion (@kbd{M-@key{TAB}}) while on any routine or partial routine 729directories instead. Invoke routine info (@kbd{C-c ?}) or completion
671name you know to be located in the library. E.g., if you have scanned 730(@kbd{M-@key{TAB}}) on any routine or partial routine name you know to
672the IDL-Astro library: 731be located in the library. E.g., if you have scanned the IDL-Astro
732library:
673 733
674@example 734@example
675 a=readf@key{M-<TAB>} 735 a=readf@key{M-@key{TAB}}
676@end example 736@end example
677 737
678
679expands to `readfits('. Then try 738expands to `readfits('. Then try
680 739
681@example 740@example
@@ -690,11 +749,11 @@ Usage: Result = READFITS(filename, header, heap)
690@end example 749@end example
691 750
692I hope you made it until here. Now you are set to work with IDLWAVE. 751I hope you made it until here. Now you are set to work with IDLWAVE.
693On the way you will want to change other things, and to learn more about 752On the way you will want to change other things, and to learn more
694the possibilities not discussed in this short tutorial. Read the 753about the possibilities not discussed in this short tutorial. Read
695manual, look at the documentation strings of interesting variables (with 754the manual, look at the documentation strings of interesting variables
696@kbd{C-h v idlwave<-variable-name> @key{RET}}) and ask the remaining 755(with @kbd{C-h v idlwave<-variable-name> @key{RET}}) and ask the
697questions on the newsgroup @code{comp.lang.idl-pvwave}. 756remaining questions on the newsgroup @code{comp.lang.idl-pvwave}.
698 757
699@node The IDLWAVE Major Mode, The IDLWAVE Shell, Getting Started, Top 758@node The IDLWAVE Major Mode, The IDLWAVE Shell, Getting Started, Top
700@chapter The IDLWAVE Major Mode 759@chapter The IDLWAVE Major Mode
@@ -727,35 +786,26 @@ them.
727 786
728@menu 787@menu
729* Code Indentation:: Reflecting the logical structure 788* Code Indentation:: Reflecting the logical structure
730* Continued Statement Indentation:: 789* Continued Statement Indentation::
731* Comment Indentation:: Special indentation for comment lines 790* Comment Indentation:: Special indentation for comment lines
732* Continuation Lines:: Splitting statements over lines 791* Continuation Lines:: Splitting statements over lines
733* Syntax Highlighting:: Font-lock support 792* Syntax Highlighting:: Font-lock support
734* Octals and Highlighting:: Why "123 causes problems 793* Octals and Highlighting:: Why "123 causes problems
735@end menu 794@end menu
736 795
737The IDL language, with it's early roots in FORTRAN, modern 796The IDL language, with its early roots in FORTRAN, modern
738implementation in C, and liberal borrowing of features of many vector 797implementation in C, and liberal borrowing of features of many vector
739languages along its 25+ year history, has inherited an unusual mix of 798and other languages along its 25+ year history, has inherited an
740syntax elements. Left to his or her own devices, a novice IDL 799unusual mix of syntax elements. Left to his or her own devices, a
741programmer will often conjure code which is very difficult to read and 800novice IDL programmer will often conjure code which is very difficult
742impossible to adapt. Much can be gleaned from studying available IDL 801to read and impossible to adapt. Much can be gleaned from studying
743code libraries for coding style pointers, but, due to the variety of 802available IDL code libraries for coding style pointers, but, due to
744IDL syntax elements, replicating this style can be challenging at 803the variety of IDL syntax elements, replicating this style can be
745best. Luckily, IDLWAVE understands the structure of IDL code very 804challenging at best. Luckily, IDLWAVE understands the structure of
746well, and takes care of almost all formatting issues for you. After 805IDL code very well, and takes care of almost all formatting issues for
747configuring it to match your coding standards, you can rely on it to 806you. After configuring it to match your coding standards, you can
748help keep your code neat and organized. 807rely on it to help keep your code neat and organized.
749 808
750@cindex Foreign code, adapting
751@cindex Indentation, of foreign code
752@kindex C-M-\
753To re-indent a larger portion of code (e.g. when working with foreign code
754written with different conventions), use @kbd{C-M-\}
755(@code{indent-region}) after marking the relevant code. Useful marking
756commands are @kbd{C-x h} (the entire file) or @kbd{C-M-h} (the
757current subprogram). @xref{Actions}, for information how to impose
758additional formatting conventions on foreign code.
759 809
760@node Code Indentation, Continued Statement Indentation, Code Formatting, Code Formatting 810@node Code Indentation, Continued Statement Indentation, Code Formatting, Code Formatting
761@subsection Code Indentation 811@subsection Code Indentation
@@ -769,7 +819,17 @@ governed by a number of variables. IDLWAVE indents blocks (between
769@code{PRO}/@code{FUNCTION}/@code{BEGIN} and @code{END}), and 819@code{PRO}/@code{FUNCTION}/@code{BEGIN} and @code{END}), and
770continuation lines. 820continuation lines.
771 821
772@defopt idlwave-main-block-indent (@code{0}) 822@cindex Foreign code, adapting
823@cindex Indentation, of foreign code
824@kindex C-M-\
825To re-indent a larger portion of code (e.g. when working with foreign code
826written with different conventions), use @kbd{C-M-\}
827(@code{indent-region}) after marking the relevant code. Useful marking
828commands are @kbd{C-x h} (the entire file) or @kbd{C-M-h} (the
829current subprogram). @xref{Actions}, for information how to impose
830additional formatting conventions on foreign code.
831
832@defopt idlwave-main-block-indent (@code{0})
773Extra indentation for the main block of code. That is the block between 833Extra indentation for the main block of code. That is the block between
774the FUNCTION/PRO statement and the END statement for that program 834the FUNCTION/PRO statement and the END statement for that program
775unit. 835unit.
@@ -827,12 +887,16 @@ indentation by setting the variable
827maximum additional indentation beyond the basic indent to be 887maximum additional indentation beyond the basic indent to be
828tolerated, otherwise defaulting to a fixed-offset from the enclosing 888tolerated, otherwise defaulting to a fixed-offset from the enclosing
829indent (the size of which offset is set in 889indent (the size of which offset is set in
830@code{idlwave-continuation-indent}). Also, since the indentation 890@code{idlwave-continuation-indent}). As a special case, continuations
831level can be somewhat dynamic in continued statements with special 891of routine calls without any arguments or keywords will @emph{not}
832continuation indentation, especially if 892align the continued line, under the assumption that you continued
893because you needed the space.
894
895Also, since the indentation level can be somewhat dynamic in continued
896statements with special continuation indentation, especially if
833@code{idlwave-max-extra-continuation-indent} is small, the key 897@code{idlwave-max-extra-continuation-indent} is small, the key
834@kbd{C-u @key{TAB}} will re-indent all lines in the current statement. 898@kbd{C-u @key{TAB}} will re-indent all lines in the current statement.
835Note that @code{idlwave-indent-to-open-paren}, if non-@code{nil}, overrides 899Note that @code{idlwave-indent-to-open-paren}, if non-nil, overrides
836the @code{idlwave-max-extra-continuation-indent} limit, for 900the @code{idlwave-max-extra-continuation-indent} limit, for
837parentheses only, forcing them always to line up. 901parentheses only, forcing them always to line up.
838 902
@@ -966,7 +1030,7 @@ in the first line of a comment paragraph.
966 1030
967@defopt idlwave-use-last-hang-indent (@code{nil}) 1031@defopt idlwave-use-last-hang-indent (@code{nil})
968Non-@code{nil} means use last match on line for 1032Non-@code{nil} means use last match on line for
969@code{idlwave-indent-regexp}. 1033@code{idlwave-indent-regexp}.
970@end defopt 1034@end defopt
971 1035
972@node Syntax Highlighting, Octals and Highlighting, Continuation Lines, Code Formatting 1036@node Syntax Highlighting, Octals and Highlighting, Continuation Lines, Code Formatting
@@ -994,7 +1058,7 @@ for highlighting using the variable
994 1058
995@defopt idlwave-default-font-lock-items 1059@defopt idlwave-default-font-lock-items
996Items which should be fontified on the default fontification level 1060Items which should be fontified on the default fontification level
9972. 10612.
998@end defopt 1062@end defopt
999 1063
1000@node Octals and Highlighting, , Syntax Highlighting, Code Formatting 1064@node Octals and Highlighting, , Syntax Highlighting, Code Formatting
@@ -1002,12 +1066,12 @@ Items which should be fontified on the default fontification level
1002@cindex Syntax highlighting, Octals 1066@cindex Syntax highlighting, Octals
1003@cindex Highlighting of syntax, Octals 1067@cindex Highlighting of syntax, Octals
1004 1068
1005A rare syntax highlighting problem results from the extremely 1069A rare syntax highlighting problem results from an extremely unfortunate
1006unfortunate notation for octal numbers in IDL: @code{"123}. This 1070notation for octal numbers in IDL: @code{"123}. This unpaired quotation
1007unpaired quotation mark is very difficult to parse, given that it can be 1071mark is very difficult to parse, given that it can be mixed on a single
1008mixed on a single line with any number of strings. Emacs will 1072line with any number of strings. Emacs will incorrectly identify this
1009incorrectly identify this as a string, and the highlighting of following 1073as a string, and the highlighting of following lines of code can be
1010lines of code can be distorted, since the string is never terminated. 1074distorted, since the string is never terminated.
1011 1075
1012One solution to this involves terminating the mistakenly identified 1076One solution to this involves terminating the mistakenly identified
1013string yourself by providing a closing quotation mark in a comment: 1077string yourself by providing a closing quotation mark in a comment:
@@ -1041,15 +1105,16 @@ and object methods, and large libraries typically contain hundreds or
1041even thousands more (each with a few to tens of keywords and 1105even thousands more (each with a few to tens of keywords and
1042arguments). This large command set can make it difficult to remember 1106arguments). This large command set can make it difficult to remember
1043the calling sequence and keywords for the routines you use, but 1107the calling sequence and keywords for the routines you use, but
1044IDLWAVE can help. It builds up routine information using a wide 1108IDLWAVE can help. It builds up routine information from a wide
1045variety of sources: IDLWAVE in fact knows far more about the routines 1109variety of sources; IDLWAVE in fact knows far more about the
1046on your system than IDL itself. It maintains a list of all built-in 1110@samp{.pro} routines on your system than IDL itself! It maintains a
1047routines, with calling sequences and keywords@footnote{This list is 1111list of all built-in routines, with calling sequences and
1048created by scanning the IDL manuals and might contain (very few) 1112keywords@footnote{This list is created by scanning the IDL manuals and
1049errors. Please report any errors to the maintainer, so that they can 1113might contain (very few) errors. Please report any errors to the
1050be fixed.}. It also scans Emacs buffers and library files for routine 1114maintainer, so that they can be fixed.}. It also scans Emacs buffers
1051definitions, and queries the IDLWAVE-Shell for information about 1115for routine definitions, queries the IDLWAVE-Shell for information
1052routines currently compiled there. This information is updated 1116about routines currently compiled there, and automatically locates
1117library and user-created catalogs. This information is updated
1053automatically, and so should usually be current. To force a global 1118automatically, and so should usually be current. To force a global
1054update and refresh the routine information, use @kbd{C-c C-i} 1119update and refresh the routine information, use @kbd{C-c C-i}
1055(@code{idlwave-update-routine-info}). 1120(@code{idlwave-update-routine-info}).
@@ -1071,13 +1136,13 @@ plot,x,alog(x+5*sin(x) + 2),
1071On positions 1,2 and 8, information about the @samp{plot} procedure will 1136On positions 1,2 and 8, information about the @samp{plot} procedure will
1072be shown. On positions 3,4, and 7, the @samp{alog} function will be 1137be shown. On positions 3,4, and 7, the @samp{alog} function will be
1073described, while positions 5 and 6 will investigate the @samp{sin} 1138described, while positions 5 and 6 will investigate the @samp{sin}
1074function. 1139function.
1075 1140
1076When you ask for routine information about an object method, and the 1141When you ask for routine information about an object method, and the
1077method exists in several classes, IDLWAVE queries for the class of the 1142method exists in several classes, IDLWAVE queries for the class of the
1078object, unless the class is already known through a text property on the 1143object, unless the class is already known through a text property on the
1079@samp{->} operator (@pxref{Object Method Completion and Class 1144@samp{->} operator (@pxref{Object Method Completion and Class
1080Ambiguity}), or by having been explicitly included in the call 1145Ambiguity}), or by having been explicity included in the call
1081(e.g. @code{a->myclass::Foo}). 1146(e.g. @code{a->myclass::Foo}).
1082 1147
1083@cindex Calling sequences 1148@cindex Calling sequences
@@ -1090,7 +1155,7 @@ keywords and the source location of this routine. It looks like this:
1090Usage: XMANAGER, NAME, ID 1155Usage: XMANAGER, NAME, ID
1091Keywords: BACKGROUND CATCH CLEANUP EVENT_HANDLER GROUP_LEADER 1156Keywords: BACKGROUND CATCH CLEANUP EVENT_HANDLER GROUP_LEADER
1092 JUST_REG MODAL NO_BLOCK 1157 JUST_REG MODAL NO_BLOCK
1093Source: SystemLib [CSB] /soft1/idl53/lib/xmanager.pro 1158Source: SystemLib [LCSB] /soft1/idl53/lib/xmanager.pro
1094@end example 1159@end example
1095 1160
1096@cindex Categories, of routines 1161@cindex Categories, of routines
@@ -1102,20 +1167,22 @@ Source: SystemLib [CSB] /soft1/idl53/lib/xmanager.pro
1102@cindex @code{!DIR}, IDL variable 1167@cindex @code{!DIR}, IDL variable
1103 1168
1104If a definition of this routine exists in several files accessible to 1169If a definition of this routine exists in several files accessible to
1105IDLWAVE, several @samp{Source} lines will point to the different files. 1170IDLWAVE, several @samp{Source} lines will point to the different
1106This may indicate that your routine is shadowing a library routine, 1171files. This may indicate that your routine is shadowing a system
1107which may or may not be what you want (@pxref{Load-Path Shadows}). The 1172library routine, which may or may not be what you want
1108information about the calling sequence and keywords is derived from the 1173(@pxref{Load-Path Shadows}). The information about the calling
1109first source listed. Library routines are supported only if you have 1174sequence and keywords is derived from the first source listed.
1110scanned your local IDL libraries (@pxref{Library Catalog}). The source 1175Library routines are available only if you have scanned your local IDL
1111entry consists of a @emph{source category}, a set of @emph{flags} and 1176directories or are using pre-scanned libraries (@pxref{Catalogs}).
1112the path to the @emph{source file}. The following categories exist: 1177The source entry consists of a @emph{source category}, a set of
1178@emph{flags} and the path to the @emph{source file}. The following
1179default categories exist:
1113 1180
1114@multitable @columnfractions .15 .85 1181@multitable @columnfractions .15 .85
1115@item @i{System} 1182@item @i{System}
1116@tab A system routine of unknown origin. When the system library has 1183@tab A system routine of unknown origin. When the system library has
1117been scanned (@pxref{Library Catalog}), this category will automatically 1184been scanned as part of a catalog (@pxref{Catalogs}), this category
1118split into the next two. 1185will automatically split into the next two.
1119@item @i{Builtin} 1186@item @i{Builtin}
1120@tab A builtin system routine with no source code available. 1187@tab A builtin system routine with no source code available.
1121@item @i{SystemLib} 1188@item @i{SystemLib}
@@ -1127,27 +1194,28 @@ split into the next two.
1127@item @i{Other} 1194@item @i{Other}
1128@tab Any other routine with a file not known to be on the search path. 1195@tab Any other routine with a file not known to be on the search path.
1129@item @i{Unresolved} 1196@item @i{Unresolved}
1130@tab An otherwise unkown routine the shell lists as unresolved 1197@tab An otherwise unkown routine the shell lists as unresolved
1131(referenced, but not compiled). 1198(referenced, but not compiled).
1132@end multitable 1199@end multitable
1133 1200
1134You can create additional categories based on the routine's filepath 1201Any routines discovered in library catalogs (@pxref{Library
1135with the variable @code{idlwave-special-lib-alist}. This is useful for 1202Catalogs}), will display the category assigned during creation,
1136easy discrimination of various libraries, or even versions of the same 1203e.g. @samp{NasaLib}. For routines not discovered in this way, you can
1137library. 1204create additional categories based on the routine's filename using the
1205variable @code{idlwave-special-lib-alist}.
1138 1206
1139@cindex Flags, in routine info 1207@cindex Flags, in routine info
1140@cindex Duplicate routines 1208@cindex Duplicate routines
1141@cindex Multiply defined routines 1209@cindex Multiply defined routines
1142@cindex Routine definitions, multiple 1210@cindex Routine definitions, multiple
1143The flags @code{[CSB]} indicate the source of the information IDLWAVE 1211The flags @code{[LCSB]} indicate the source of the information IDLWAVE
1144has regarding the file: from a library catalog (@w{@code{[C--]}}, 1212has regarding the file: from a library catalog (@w{@code{[L---]}}),
1145@pxref{Library Catalog}), from the IDL Shell (@w{@code{[-S-]}}) or from 1213from a user catalog (@w{@code{[-C--]}}, from the IDL Shell
1146an Emacs buffer (@w{@code{[--B]}}). Combinations are possible (a 1214(@w{@code{[--S-]}}) or from an Emacs buffer (@w{@code{[---B]}}).
1147compiled library routine visited in a buffer might read 1215Combinations are possible (a compiled library routine visited in a
1148@w{@code{[CSB]}}). If a file contains multiple definitions of the same 1216buffer might read @w{@code{[L-SB]}}). If a file contains multiple
1149routine, the file name will be prefixed with @samp{(Nx)} where @samp{N} 1217definitions of the same routine, the file name will be prefixed with
1150is the number of definitions. 1218@samp{(Nx)} where @samp{N} is the number of definitions.
1151 1219
1152@cindex Online Help from the routine info buffer 1220@cindex Online Help from the routine info buffer
1153@cindex Active text, in routine info 1221@cindex Active text, in routine info
@@ -1162,7 +1230,7 @@ with the middle mouse button inserts keywords or visits files:
1162@item @i{Usage} 1230@item @i{Usage}
1163@tab If online help is installed, a click with the @emph{right} mouse 1231@tab If online help is installed, a click with the @emph{right} mouse
1164button on the @i{Usage:} line will access the help for the 1232button on the @i{Usage:} line will access the help for the
1165routine (@pxref{Online Help}). 1233routine (@pxref{Online Help}).
1166@item @i{Keyword} 1234@item @i{Keyword}
1167@tab Online help about keywords is also available with the 1235@tab Online help about keywords is also available with the
1168@emph{right} mouse button. Clicking on a keyword with the @emph{middle} 1236@emph{right} mouse button. Clicking on a keyword with the @emph{middle}
@@ -1198,54 +1266,32 @@ Maximum number of source files displayed in the Routine Info window.
1198@end defopt 1266@end defopt
1199 1267
1200 1268
1269@ifhtml
1270<A NAME="ONLINE_HELP"></A>
1271@end ifhtml
1201@node Online Help, Completion, Routine Info, The IDLWAVE Major Mode 1272@node Online Help, Completion, Routine Info, The IDLWAVE Major Mode
1202@section Online Help 1273@section Online Help
1203 1274
1204@cindex Online Help 1275@cindex Online Help
1205@cindex @file{idlw-help.txt} 1276@cindex @file{idlw-help.txt}
1206@cindex @file{idlw-help.el} 1277@cindex @file{idlw-help.el}
1207@cindex IDL manual, ASCII version
1208@cindex Installing online help 1278@cindex Installing online help
1209@cindex Online Help, Installation 1279@cindex Online Help, Installation
1210@cindex Speed, of online help 1280@cindex Speed, of online help
1211For IDL system routines, RSI provides extensive documentation. IDLWAVE
1212can access an ASCII version of this documentation very quickly and
1213accurately. This is @emph{much} faster than using the IDL online help
1214application, because IDLWAVE usually gets you to the right place in the
1215documentation directly, without any additional browsing and scrolling.
1216For this online help to work, an ASCII version of the IDL documentation,
1217which is not part of the standalone IDLWAVE distribution, is required.
1218The necessary help files can be downloaded from
1219@uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. The text
1220extracted from the PDF files is fine for normal documentation
1221paragraphs, but graphics and multiline equations will not be well
1222formatted. See also @ref{Documentation Scan}.
1223
1224@cindex Updated online help
1225@cindex Online help, updates
1226@cindex @code{<NEW>..</NEW>}
1227Occasionally RSI releases a synopsis of new features in an IDL release,
1228without simultaneously updating the documentation files, instead
1229preferring a @i{What's New} document which describes the changes. These
1230updates are incorporated directly into the IDLWAVE online help, and are
1231delimited in @code{<NEW>..</NEW>} blocks.
1232 1281
1233@cindex Source code, as online help 1282For IDL system routines, RSI provides extensive documentation.
1234@cindex DocLib header, as online help 1283IDLWAVE can access an HTML version of this documentation very quickly
1235For routines which are not documented in the IDL manual (for example 1284and accurately. This is @emph{much} faster than using the IDL online
1236personal or library routines), the source code itself is used as help 1285help application, because IDLWAVE usually gets you to the right place
1237text. If the requested information can be found in a (more or less) 1286in the documentation directly --- e.g. a specific keyword of a routine
1238standard DocLib file header, IDLWAVE shows the header (scrolling down to 1287--- without any additional browsing and scrolling. For this online
1239appropriate keyword). Otherwise the routine definition statement 1288help to work, an HTML version of the IDL documentation, which is not
1240(@code{pro}/@code{function}) is shown. 1289part of the standalone IDLWAVE distribution, is required. The
1241 1290necessary files can be downloaded from @uref{@value{IDLWAVE-HOMEPAGE},
1242@cindex Structure tags, in online help 1291the maintainers webpage}. There are a variety of options for
1243@cindex Class tags, in online help 1292displaying the HTML help: see below. Help for routines without HTML
1244Help is also available for class structure tags (@code{self.TAG}), and 1293documentation is also available, using the routine documentation
1245generic structure tags, if structure tag completion is enabled 1294header and/or source.
1246(@pxref{Structure Tag Completion}). This is implemented by visiting the
1247tag within the class or structure definition source itself. Help is not
1248available on built-in system class tags.
1249 1295
1250@kindex M-? 1296@kindex M-?
1251In any IDL program (or, as with most IDLWAVE commands, in the IDL 1297In any IDL program (or, as with most IDLWAVE commands, in the IDL
@@ -1261,6 +1307,8 @@ locations are recognized context for help:
1261@tab A keyword parameter of a routine. 1307@tab A keyword parameter of a routine.
1262@item @i{System Variable} 1308@item @i{System Variable}
1263@tab System variables like @code{!DPI}. 1309@tab System variables like @code{!DPI}.
1310@item @i{System Variable Tags}
1311@tab System variables tags like @code{!D.X_SIZE}.
1264@item @i{IDL Statement} 1312@item @i{IDL Statement}
1265@tab Statements like @code{PRO}, @code{REPEAT}, @code{COMPILE_OPT}, etc. 1313@tab Statements like @code{PRO}, @code{REPEAT}, @code{COMPILE_OPT}, etc.
1266@item @i{Class name} 1314@item @i{Class name}
@@ -1270,23 +1318,23 @@ locations are recognized context for help:
1270@item @i{Executive Command} 1318@item @i{Executive Command}
1271@tab An executive command like @code{.RUN}. Mostly useful in the shell. 1319@tab An executive command like @code{.RUN}. Mostly useful in the shell.
1272@item @i{Structure Tags} 1320@item @i{Structure Tags}
1273@tab In structure tags like @code{state.xsize} 1321@tab Structure tags like @code{state.xsize}
1274@item @i{Structure Tags} 1322@item @i{Class Tags}
1275@tab In class tags like @code{self.value}. 1323@tab Class tags like @code{self.value}.
1276@item @i{Default} 1324@item @i{Default}
1277@tab The routine that would be selected for routine info display. 1325@tab The routine that would be selected for routine info display.
1278@end multitable 1326@end multitable
1279 1327
1280@cindex @code{OBJ_NEW}, special online help 1328@cindex @code{OBJ_NEW}, special online help
1281Note that the @code{OBJ_NEW} function is special in that the help 1329Note that the @code{OBJ_NEW} function is special in that the help
1282displayed depends on the cursor position: If the cursor is on the 1330displayed depends on the cursor position. If the cursor is on the
1283@samp{OBJ_NEW}, this function is described. If it is on the class name 1331@samp{OBJ_NEW}, this function is described. If it is on the class
1284inside the quotes, the documentation for the class is pulled up. If the 1332name inside the quotes, the documentation for the class is pulled up.
1285cursor is @emph{after} the class name, anywhere in the argument list, 1333If the cursor is @emph{after} the class name, anywhere in the argument
1286the documentation for the corresponding @code{Init} method and its 1334list, the documentation for the corresponding @code{Init} method and
1287keywords is targeted. 1335its keywords is targeted.
1288 1336
1289@noindent Apart from source buffers, there are two more places from 1337Apart from an IDLWAVE buffer or shell, there are two more places from
1290which online help can be accessed. 1338which online help can be accessed.
1291 1339
1292@itemize @bullet 1340@itemize @bullet
@@ -1302,14 +1350,112 @@ help is available in the online system documentation (vs. just the
1302program source itself) will be emphasized (e.g. colored blue). 1350program source itself) will be emphasized (e.g. colored blue).
1303@end itemize 1351@end itemize
1304@noindent 1352@noindent
1305In both cases, a blue face indicates that the item is documented in the 1353In both cases, a blue face indicates that the item is documented in
1306IDL manual, but an attempt will be made to visit non-blue items directly 1354the IDL manual, but an attempt will be made to visit non-blue items
1307in the originating source file. 1355directly in the originating source file.
1356
1357
1358@menu
1359* Help with HTML Documentation::
1360* Help with Source::
1361@end menu
1308 1362
1309@cindex Help application, key bindings 1363@node Help with HTML Documentation, Help with Source, Online Help, Online Help
1310@cindex Key bindings, in help application 1364@subsection Help with HTML Documentation
1311The help window is normally displayed in a separate frame. The 1365@cindex HTML Help
1312following commands can be used to navigate inside the help system: 1366@cindex Help using HTML manuals
1367@cindex IDL manual, HTML version
1368
1369Help using the HTML documentation is invoked with the built-in Emacs
1370command @code{browse-url}, which displays the relevant help topic in a
1371browser of your choosing. There are many possible browsers to choose
1372among, with differing advantages and disadvantages. The variable
1373@code{idlwave-help-browser-function} controls which browser help is
1374sent to. This function is used to set the variable
1375@code{browse-url-browser-function} locally for IDLWAVE help only.
1376Customize this variable to see what choices of browsers your system
1377offers.
1378
1379Certain browsers like @code{w3} (bundled with many versions of Emacs)
1380and @code{w3m} (@uref{http://emacs-w3m.namazu.org/}, the author's help
1381browser of choice) are run within Emacs, and use Emacs buffers to
1382display the HTML help. This can be convenient, especially on small
1383displays, and images can even be displayed in-line on new Emacs
1384versions. However, better formatting results are often achieved with
1385external browsers, like Mozilla. IDLWAVE assumes any browser function
1386containing "w3" is displayed in a local buffer. If you are using
1387another Emacs-local browser for which this is not true, set the
1388variable @code{idlwave-help-browser-is-local}.
1389
1390@emph{N.B. For Windows users}: IDLWAVE can bring up RSI help directly
1391in the Microsoft HTMLHelp documentation supplied with IDL: no
1392additional help files are needed. Be sure to set
1393@code{idlwave-system-directory} and the help file will be found
1394automatically (or, alternatively, specify its location directly with
1395@code{idlwave-html-help-location}). The variable
1396@code{idlwave-help-use-hh} controls whether HTMLHelp is used, and
1397which application is called to invoke it (@code{HH} is the default).
1398The free helper application @code{KEYHH}
1399(@uref{http://www.keyworks.net/keyhh.htm}) can be used instead, and is
1400preferrable, as it permits loading new help topics into the same help
1401window. @code{KEYHH} must be downloaded and installed separately.
1402
1403@xref{HTML Help Browser Tips}, for more information on selecting and
1404configuring a browser for use with IDL's HTML help system.
1405
1406@defopt idlwave-html-help-location @file{/usr/local/etc}
1407The directory where the @file{idl_html_help} dir or @file{idl.chm}
1408HTMLHelp files live.
1409@end defopt
1410
1411@defopt idlwave-help-use-hh @code{nil}
1412If set to @code{'hh} or @code{'keyhh}, use Windows native HTMLHelp
1413with the specified help application.
1414@end defopt
1415
1416@defopt idlwave-help-browser-function
1417The browser function to use to display IDLWAVE HTML help. Should be
1418one of the functions available for setting
1419@code{browse-url-browser-function}, which see.
1420@end defopt
1421
1422@defopt idlwave-help-browser-is-local
1423Is the browser selected in @code{idlwave-help-browser-function} run in a
1424local Emacs buffer? Defaults to @code{t} if the function contains
1425"-w3".
1426@end defopt
1427
1428@defopt idlwave-help-link-face
1429The face for links to IDLWAVE online help.
1430@end defopt
1431
1432@node Help with Source, , Help with HTML Documentation, Online Help
1433@subsection Help with Source
1434@cindex Help using routine source
1435
1436@cindex Source code, as online help
1437@cindex DocLib header, as online help
1438For routines which are not documented in an HTML manual (for example
1439personal or library routines), the source code itself is used as help
1440text. If the requested information can be found in a (more or less)
1441standard DocLib file header, IDLWAVE shows the header (scrolling down to
1442a keyword, if appropriate). Otherwise the routine definition statement
1443(@code{pro}/@code{function}) is shown. The doclib header sections which
1444are searched for include @samp{NAME} and @samp{KEYWORDS}. Localization
1445support can be added by customizing the @code{idlwave-help-doclib-name}
1446and @code{idlwave-help-doclib-keyword} variables.
1447
1448@cindex Structure tags, in online help
1449@cindex Class tags, in online help
1450Help is also available for class structure tags (@code{self.TAG}), and
1451generic structure tags, if structure tag completion is enabled
1452(@pxref{Structure Tag Completion}). This is implemented by visiting the
1453tag within the class or structure definition source itself. Help is not
1454available on built-in system class tags.
1455
1456The help window is normally displayed in the same frame, but can be
1457popped-up in a separate frame. The following commands can be used to
1458navigate inside the help system for source files:
1313 1459
1314@multitable @columnfractions .15 .85 1460@multitable @columnfractions .15 .85
1315@item @kbd{@key{SPACE}} 1461@item @kbd{@key{SPACE}}
@@ -1318,29 +1464,6 @@ following commands can be used to navigate inside the help system:
1318@tab Scroll forward one line. 1464@tab Scroll forward one line.
1319@item @kbd{@key{DEL}} 1465@item @kbd{@key{DEL}}
1320@tab Scroll back one page. 1466@tab Scroll back one page.
1321@item @kbd{n, p}
1322@tab Browse to the next or previous topic (in physical sequence).
1323@item @kbd{b, f}
1324@tab Move back and forward through the help topic history.
1325@item @kbd{c}
1326@tab Clear the history.
1327@item @kbd{Mouse-2}
1328@tab Follow a link. Active links are displayed in a different font.
1329Items under @i{See Also} are active, and classes have links to their
1330methods and back.
1331@item @kbd{o}
1332@tab Open a topic. The topic can be selected with completion.
1333@item @kbd{*}
1334@tab Load the whole help file into Emacs, for global text searches.
1335@item @kbd{q}
1336@tab Kill the help window.
1337@end multitable
1338
1339@sp 1
1340@noindent When the help text is a source file, the following commands
1341are also available:
1342
1343@multitable @columnfractions .15 .85
1344@item @kbd{h} 1467@item @kbd{h}
1345@tab Jump to DocLib Header of the routine whose source is displayed 1468@tab Jump to DocLib Header of the routine whose source is displayed
1346as help. 1469as help.
@@ -1352,13 +1475,12 @@ as help.
1352item in the DocLib header. 1475item in the DocLib header.
1353@item @kbd{F} 1476@item @kbd{F}
1354@tab Fontify the buffer like source code. See the variable @code{idlwave-help-fontify-source-code}. 1477@tab Fontify the buffer like source code. See the variable @code{idlwave-help-fontify-source-code}.
1478@item @kbd{q}
1479@tab Kill the help window.
1355@end multitable 1480@end multitable
1356 1481
1357@defopt idlwave-help-directory
1358The directory where idlw-help.txt and idlw-help.el are stored.
1359@end defopt
1360 1482
1361@defopt idlwave-help-use-dedicated-frame (@code{t}) 1483@defopt idlwave-help-use-dedicated-frame (@code{nil})
1362Non-@code{nil} means use a separate frame for Online Help if possible. 1484Non-@code{nil} means use a separate frame for Online Help if possible.
1363@end defopt 1485@end defopt
1364 1486
@@ -1379,18 +1501,21 @@ Non-@code{nil} means fontify source code displayed as help.
1379@end defopt 1501@end defopt
1380 1502
1381@defopt idlwave-help-source-try-header (@code{t}) 1503@defopt idlwave-help-source-try-header (@code{t})
1382Non-@code{nil} means try to find help in routine header when displaying source 1504Non-@code{nil} means try to find help in routine header when
1383file. 1505displaying source file.
1384@end defopt 1506@end defopt
1385 1507
1386@defopt idlwave-help-link-face 1508@defopt idlwave-help-doclib-name (@code{"name"})
1387The face for links in IDLWAVE online help. 1509The case-insensitive heading word in doclib headers to locate the
1510@emph{name} section. Can be a regexp, e.g. @code{"\\(name\\|nom\\)"}.
1388@end defopt 1511@end defopt
1389 1512
1390@defopt idlwave-help-activate-links-aggressively (@code{t}) 1513@defopt idlwave-help-doclib-keyword (@code{"KEYWORD"})
1391Non-@code{nil} means make all possible links in help window active. 1514The case-insensitive heading word in doclib headers to locate the
1515@emph{keywords} section. Can be a regexp.
1392@end defopt 1516@end defopt
1393 1517
1518
1394@node Completion, Routine Source, Online Help, The IDLWAVE Major Mode 1519@node Completion, Routine Source, Online Help, The IDLWAVE Major Mode
1395@section Completion 1520@section Completion
1396@cindex Completion 1521@cindex Completion
@@ -1404,12 +1529,13 @@ Non-@code{nil} means make all possible links in help window active.
1404@kindex M-@key{TAB} 1529@kindex M-@key{TAB}
1405@kindex C-c C-i 1530@kindex C-c C-i
1406IDLWAVE offers completion for class names, routine names, keywords, 1531IDLWAVE offers completion for class names, routine names, keywords,
1407system variables, class structure tags, regular structure tags and file 1532system variables, system variable tags, class structure tags, regular
1408names. As in many programming modes, completion is bound to 1533structure tags and file names. As in many programming modes,
1409@kbd{M-@key{TAB}} (or @kbd{@key{TAB}} in the IDLWAVE Shell --- 1534completion is bound to @kbd{M-@key{TAB}} (or @kbd{@key{TAB}} in the
1410@pxref{Using the Shell}). Completion uses exactly the same internal 1535IDLWAVE Shell --- @pxref{Using the Shell}). Completion uses exactly
1411information as routine info, so when necessary (rarely) it can be 1536the same internal information as routine info, so when necessary
1412updated with @kbd{C-c C-i} (@code{idlwave-update-routine-info}). 1537(rarely) it can be updated with @kbd{C-c C-i}
1538(@code{idlwave-update-routine-info}).
1413 1539
1414The completion function is context sensitive and figures out what to 1540The completion function is context sensitive and figures out what to
1415complete based location of the point. Here are example lines and what 1541complete based location of the point. Here are example lines and what
@@ -1443,6 +1569,11 @@ will always assume a keyword to @samp{plot}. However, a function is
1443also a possible completion here. You can force completion of a function 1569also a possible completion here. You can force completion of a function
1444name at such a location by using a prefix arg: @kbd{C-u M-@key{TAB}}. 1570name at such a location by using a prefix arg: @kbd{C-u M-@key{TAB}}.
1445 1571
1572Giving two prefix arguments (@kbd{C-u C-u M-@key{TAB}}) prompts for a
1573regular expression to search among the commands to be completed. As
1574an example, completing a blank line in this way will allow you to
1575search for a procedure matching a regexp.
1576
1446@cindex Scrolling the @file{*Completions*} window 1577@cindex Scrolling the @file{*Completions*} window
1447@cindex Completion, scrolling 1578@cindex Completion, scrolling
1448@cindex Completion, Online Help 1579@cindex Completion, Online Help
@@ -1489,7 +1620,7 @@ available.
1489@menu 1620@menu
1490* Case of Completed Words:: CaseOFcomPletedWords 1621* Case of Completed Words:: CaseOFcomPletedWords
1491* Object Method Completion and Class Ambiguity:: obj->Method, what? 1622* Object Method Completion and Class Ambiguity:: obj->Method, what?
1492* Object Method Completion in the Shell:: 1623* Object Method Completion in the Shell::
1493* Class and Keyword Inheritance:: obj->Method, _EXTRA=e 1624* Class and Keyword Inheritance:: obj->Method, _EXTRA=e
1494* Structure Tag Completion:: Completing state.Tag 1625* Structure Tag Completion:: Completing state.Tag
1495@end menu 1626@end menu
@@ -1498,19 +1629,21 @@ available.
1498@subsection Case of Completed Words 1629@subsection Case of Completed Words
1499@cindex Case of completed words 1630@cindex Case of completed words
1500@cindex Mixed case completion 1631@cindex Mixed case completion
1501The case of the completed words is determined by what is already in the 1632IDL is a case-insensitive language, so casing is a matter of style
1502buffer. When the partial word being completed is all lower case, the 1633only. IDLWAVE helps maintain a consistent casing style for completed
1503completion will be lower case as well. If at least one character is 1634items. The case of the completed words is determined by what is
1504upper case, the string will be completed in upper case or mixed case. 1635already in the buffer. As an exception, when the partial word being
1505The default is to use upper case for procedures, functions and keywords, 1636completed is all lower case, the completion will be lower case as
1506and mixed case for object class names and methods, similar to the 1637well. If at least one character is upper case, the string will be
1507conventions in the IDL manuals. These defaults can be changed with the 1638completed in upper case or mixed case, depending on the value of the
1508variable @code{idlwave-completion-case}. For instance, to enable 1639variable @code{idlwave-completion-case}. The default is to use upper
1509mixed-case completion for routines in addition to classes and methods, 1640case for procedures, functions and keywords, and mixed case for object
1510you need an entry such as @code{routine . preserve} in that variable. 1641class names and methods, similar to the conventions in the IDL
1511To enable total control over the case of completed items, independent of 1642manuals. For instance, to enable mixed-case completion for routines
1512buffer context, set @code{idlwave-completion-force-default-case} to 1643in addition to classes and methods, you need an entry such as
1513non-@code{nil}. 1644@code{(routine . preserve)} in that variable. To enable total control
1645over the case of completed items, independent of buffer context, set
1646@code{idlwave-completion-force-default-case} to non-@code{nil}.
1514 1647
1515@defopt idlwave-completion-case 1648@defopt idlwave-completion-case
1516Association list setting the case (UPPER/lower/Capitalized/MixedCase...) 1649Association list setting the case (UPPER/lower/Capitalized/MixedCase...)
@@ -1554,7 +1687,7 @@ narrow down the number of possible completions. The variable
1554@code{idlwave-query-class} can be configured to make such prompting the 1687@code{idlwave-query-class} can be configured to make such prompting the
1555default for all methods (not recommended), or selectively for very 1688default for all methods (not recommended), or selectively for very
1556common methods for which the number of completing keywords would be too 1689common methods for which the number of completing keywords would be too
1557large (e.g. @code{Init}). 1690large (e.g. @code{Init}).
1558 1691
1559@cindex Saving object class on @code{->} 1692@cindex Saving object class on @code{->}
1560@cindex @code{->} 1693@cindex @code{->}
@@ -1568,8 +1701,9 @@ enabled by default --- the variable @code{idlwave-store-inquired-class}
1568can be used to turn it on. 1701can be used to turn it on.
1569 1702
1570@defopt idlwave-completion-show-classes (@code{1}) 1703@defopt idlwave-completion-show-classes (@code{1})
1571Non-@code{nil} means show classes in @file{*Completions*} buffer when 1704Non-@code{nil} means show up to that many classes in
1572completing object methods and keywords. 1705@file{*Completions*} buffer when completing object methods and
1706keywords.
1573@end defopt 1707@end defopt
1574 1708
1575@defopt idlwave-completion-fontify-classes (@code{t}) 1709@defopt idlwave-completion-fontify-classes (@code{t})
@@ -1630,23 +1764,23 @@ entire class inheritance chain. This is often referred to as
1630@emph{chaining}, and is characterized by chained method calls like 1764@emph{chaining}, and is characterized by chained method calls like
1631@w{@code{self->MySuperClass::SetProperty,_EXTRA=e}}. 1765@w{@code{self->MySuperClass::SetProperty,_EXTRA=e}}.
1632 1766
1633IDLWAVE can accommodate this special synergy between class and keyword 1767IDLWAVE can accomodate this special synergy between class and keyword
1634inheritance: if @code{_EXTRA} or @code{_REF_EXTRA} is detected among a 1768inheritance: if @code{_EXTRA} or @code{_REF_EXTRA} is detected among a
1635method's keyword parameters, all keywords of superclass versions of the 1769method's keyword parameters, all keywords of superclass versions of
1636method being considered are included in completion. There is of course 1770the method being considered can be included in completion. There is
1637no guarantee that this type of keyword chaining actually occurrs, but 1771of course no guarantee that this type of keyword chaining actually
1638for some methods it's a very convenient assumption. The variable 1772occurrs, but for some methods it's a very convenient assumption. The
1639@code{idlwave-keyword-class-inheritance} can be used to configure which 1773variable @code{idlwave-keyword-class-inheritance} can be used to
1640methods have keyword inheritance treated in this simple, class-driven 1774configure which methods have keyword inheritance treated in this
1641way. By default, only @code{Init} and @code{(Get|Set)Property} are. 1775simple, class-driven way. By default, only @code{Init} and
1642The completion buffer will label keywords based on their originating 1776@code{(Get|Set)Property} are. The completion buffer will label
1643class. 1777keywords based on their originating class.
1644 1778
1645@defopt idlwave-support-inheritance (@code{t}) 1779@defopt idlwave-support-inheritance (@code{t})
1646Non-@code{nil} means consider inheritance during completion, online help etc. 1780Non-@code{nil} means consider inheritance during completion, online help etc.
1647@end defopt 1781@end defopt
1648 1782
1649@defopt idlwave-keyword-class-inheritance 1783@defopt idlwave-keyword-class-inheritance
1650A list of regular expressions to match methods for which simple 1784A list of regular expressions to match methods for which simple
1651class-driven keyword inheritance will be used for Completion. 1785class-driven keyword inheritance will be used for Completion.
1652@end defopt 1786@end defopt
@@ -1676,7 +1810,7 @@ Structure tag completion is not enabled by default. To enable it,
1676simply add the following to your @file{.emacs}: 1810simply add the following to your @file{.emacs}:
1677 1811
1678@lisp 1812@lisp
1679 (add-hook 'idlwave-load-hook 1813 (add-hook 'idlwave-load-hook
1680 (lambda () (require 'idlw-complete-structtag))) 1814 (lambda () (require 'idlw-complete-structtag)))
1681@end lisp 1815@end lisp
1682 1816
@@ -1696,7 +1830,9 @@ for a module name, offering the same default as
1696@code{idlwave-routine-info} would have used, taken from nearby buffer 1830@code{idlwave-routine-info} would have used, taken from nearby buffer
1697contents. In the minibuffer, specify a complete routine name (including 1831contents. In the minibuffer, specify a complete routine name (including
1698any class part). IDLWAVE will display the source file in another 1832any class part). IDLWAVE will display the source file in another
1699window, positioned at the routine in question. 1833window, positioned at the routine in question. You can also visit a
1834routine in the current buffer, with completion, by using a single prefix
1835(@kbd{C-u C-c C-v}).
1700 1836
1701@cindex Buffers, killing 1837@cindex Buffers, killing
1702@cindex Killing autoloaded buffers 1838@cindex Killing autoloaded buffers
@@ -1719,9 +1855,9 @@ taken from context, but you get a chance to edit it.
1719 1855
1720@code{idlwave-resolve} is one way to get a library module within reach 1856@code{idlwave-resolve} is one way to get a library module within reach
1721of IDLWAVE's routine info collecting functions. A better way is to 1857of IDLWAVE's routine info collecting functions. A better way is to
1722scan (parts of) the library (@pxref{Library Catalog}). Routine info on 1858keep routine information available in catalogs (@pxref{Catalogs}).
1723library modules will then be available without the need to compile the 1859Routine info on modules will then be available without the need to
1724modules first, and even without a running shell. 1860compile the modules first, and even without a running shell.
1725 1861
1726@xref{Sources of Routine Info}, for more information on the ways IDLWAVE 1862@xref{Sources of Routine Info}, for more information on the ways IDLWAVE
1727collects data about routines, and how to update this information. 1863collects data about routines, and how to update this information.
@@ -1970,7 +2106,8 @@ indentation of the code.
1970@end itemize 2106@end itemize
1971 2107
1972@defopt idlwave-do-actions (@code{nil}) 2108@defopt idlwave-do-actions (@code{nil})
1973Non-@code{nil} means performs actions when indenting. 2109Non-@code{nil} means performs actions when indenting. Individual action
2110settings are described below and set separately.
1974@end defopt 2111@end defopt
1975 2112
1976@menu 2113@menu
@@ -2069,7 +2206,7 @@ your @file{.emacs} file:
2069 (idlwave-action-and-binding "\\<\\(pro\\|function\\)\\>[ \t]*\\<" 2206 (idlwave-action-and-binding "\\<\\(pro\\|function\\)\\>[ \t]*\\<"
2070 '(capitalize-word 1) t) 2207 '(capitalize-word 1) t)
2071 ;; Capitalize common block name 2208 ;; Capitalize common block name
2072 (idlwave-action-and-binding "\\<common\\>[ \t]+\\<" 2209 (idlwave-action-and-binding "\\<common\\>[ \t]+\\<"
2073 '(capitalize-word 1) t))) 2210 '(capitalize-word 1) t)))
2074@end lisp 2211@end lisp
2075 2212
@@ -2096,7 +2233,7 @@ expansion.
2096@cindex Modification timestamp 2233@cindex Modification timestamp
2097@cindex Header, for file documentation 2234@cindex Header, for file documentation
2098@cindex Timestamp, in doc header. 2235@cindex Timestamp, in doc header.
2099@cindex ChangeLog, in doc header. 2236@cindex Changelog, in doc header.
2100 2237
2101@kindex C-c C-h 2238@kindex C-c C-h
2102@kindex C-c C-m 2239@kindex C-c C-m
@@ -2220,21 +2357,21 @@ The IDLWAVE shell is an Emacs major mode which permits running the IDL
2220program as an inferior process of Emacs, and works closely with the 2357program as an inferior process of Emacs, and works closely with the
2221IDLWAVE major mode in buffers. It can be used to work with IDL 2358IDLWAVE major mode in buffers. It can be used to work with IDL
2222interactively, to compile and run IDL programs in Emacs buffers and to 2359interactively, to compile and run IDL programs in Emacs buffers and to
2223debug these programs. The IDLWAVE shell is built upon @file{comint}, an 2360debug these programs. The IDLWAVE shell is built on @file{comint}, an
2224Emacs packages which handles the communication with the IDL program. 2361Emacs packages which handles the communication with the IDL program.
2225Unfortunately IDL for Windows and MacOS do not have command-prompt 2362Unfortunately IDL for Windows does not have command-prompt versions
2226versions and thus do not allow the interaction with 2363and thus do not allow the interaction with Emacs@footnote{Please
2227Emacs@footnote{Please inform the maintainer if you come up with a way to 2364inform the maintainer if you come up with a way to make the IDLWAVE
2228make the IDLWAVE shell work on these systems.} --- so the IDLWAVE shell 2365shell work on these systems.} --- so the IDLWAVE shell currently only
2229currently only works under Unix. 2366works under Unix and MacOSX.
2230 2367
2231@menu 2368@menu
2232* Starting the Shell:: How to launch IDL as a subprocess 2369* Starting the Shell:: How to launch IDL as a subprocess
2233* Using the Shell:: Interactively working with the Shell 2370* Using the Shell:: Interactively working with the Shell
2234* Commands Sent to the Shell:: 2371* Commands Sent to the Shell::
2235* Debugging IDL Programs:: 2372* Debugging IDL Programs::
2236* Examining Variables:: 2373* Examining Variables::
2237* Custom Expression Examination:: 2374* Custom Expression Examination::
2238@end menu 2375@end menu
2239 2376
2240@node Starting the Shell, Using the Shell, The IDLWAVE Shell, The IDLWAVE Shell 2377@node Starting the Shell, Using the Shell, The IDLWAVE Shell, The IDLWAVE Shell
@@ -2249,22 +2386,23 @@ currently only works under Unix.
2249The IDLWAVE shell can be started with the command @kbd{M-x 2386The IDLWAVE shell can be started with the command @kbd{M-x
2250idlwave-shell}. In @code{idlwave-mode} the function is bound to 2387idlwave-shell}. In @code{idlwave-mode} the function is bound to
2251@kbd{C-c C-s}. It creates a buffer @file{*idl*} which is used to 2388@kbd{C-c C-s}. It creates a buffer @file{*idl*} which is used to
2252interact with the shell. If the shell is already running, @kbd{C-c C-s} 2389interact with the shell. If the shell is already running, @kbd{C-c
2253will simple switch to the shell buffer. The command @kbd{C-c C-l} 2390C-s} will simply switch to the shell buffer. The command @kbd{C-c
2254(@code{idlwave-shell-recenter-shell-window}) displays the shell window 2391C-l} (@code{idlwave-shell-recenter-shell-window}) displays the shell
2255without selecting it. The shell can also be started automatically when 2392window without selecting it. The shell can also be started
2256another command tries to send a command to it. To enable auto start, 2393automatically when another command tries to send a command to it. To
2257set the variable @code{idlwave-shell-automatic-start} to @code{t}. 2394enable auto start, set the variable
2395@code{idlwave-shell-automatic-start} to @code{t}.
2258 2396
2259In order to create a separate frame for the IDLWAVE shell buffer, call 2397In order to create a separate frame for the IDLWAVE shell buffer, call
2260@code{idlwave-shell} with a prefix argument: @kbd{C-u C-c C-s} or 2398@code{idlwave-shell} with a prefix argument: @kbd{C-u C-c C-s} or
2261@kbd{C-u C-c C-l}. If you always want a dedicated frame for the shell 2399@kbd{C-u C-c C-l}. If you always want a dedicated frame for the shell
2262window, configure the variable 2400window, configure the variable
2263@code{idlwave-shell-use-dedicated-frame}. 2401@code{idlwave-shell-use-dedicated-frame}.
2264 2402
2265To launch a quick IDLWAVE shell directly from a shell prompt without an 2403To launch a quick IDLWAVE shell directly from a shell prompt without
2266IDLWAVE buffer (e.g., as a replacement for running inside an xterm), 2404an IDLWAVE buffer (e.g., as a replacement for running inside an
2267define an alias with the following content: 2405xterm), define a system alias with the following content:
2268 2406
2269@example 2407@example
2270emacs -geometry 80x32 -eval "(idlwave-shell 'quick)" 2408emacs -geometry 80x32 -eval "(idlwave-shell 'quick)"
@@ -2273,6 +2411,16 @@ emacs -geometry 80x32 -eval "(idlwave-shell 'quick)"
2273Replace the @samp{-geometry 80x32} option with @samp{-nw} if you prefer 2411Replace the @samp{-geometry 80x32} option with @samp{-nw} if you prefer
2274the Emacs process to run directly inside the terminal window. 2412the Emacs process to run directly inside the terminal window.
2275 2413
2414@cindex ENVI
2415@cindex IDL> Prompt
2416
2417To use IDLWAVE with ENVI or other custom packages which change the
2418@samp{IDL> } prompt, you must change the
2419@code{idlwave-shell-prompt-pattern}, which defaults to @samp{"^ ?IDL>
2420"}. Normally, you can just replace the @samp{IDL} in this expression
2421with the prompt you see. A suitable pattern which matches the prompt
2422for both ENVI and IDL simultaneously is @samp{"^ ?\\(ENVI\\|IDL\\)> "}.
2423
2276@defopt idlwave-shell-explicit-file-name (@file{idl}) 2424@defopt idlwave-shell-explicit-file-name (@file{idl})
2277This is the command to run IDL. 2425This is the command to run IDL.
2278@end defopt 2426@end defopt
@@ -2302,12 +2450,14 @@ Initial commands, separated by newlines, to send to IDL.
2302Non-@code{nil} means preserve command history between sessions. 2450Non-@code{nil} means preserve command history between sessions.
2303@end defopt 2451@end defopt
2304 2452
2305@defopt idlwave-shell-command-history-file (@file{~/.idlwhist}) 2453@defopt idlwave-shell-command-history-file (@file{~/.idlwave/.idlwhist})
2306The file in which the command history of the idlwave shell is saved. 2454The file in which the command history of the idlwave shell is saved.
2455Unless it's an absolute path, it goes in
2456@code{idlwave-config-directory}.
2307@end defopt 2457@end defopt
2308 2458
2309@defopt idlwave-shell-use-dedicated-frame (@code{nil}) 2459@defopt idlwave-shell-use-dedicated-frame (@code{nil})
2310Non-@code{nil} means IDLWAVE should use a special frame to display 2460Non-@code{nil} means IDLWAVE should use a special frame to display the
2311shell buffer. 2461shell buffer.
2312@end defopt 2462@end defopt
2313 2463
@@ -2476,18 +2626,22 @@ By default, much of this background shell input and output is hidden
2476from the user, but this is configurable. The custom variable 2626from the user, but this is configurable. The custom variable
2477@code{idlwave-abbrev-show-commands} allows you to configure which 2627@code{idlwave-abbrev-show-commands} allows you to configure which
2478commands sent to the shell are shown there. For a related customization 2628commands sent to the shell are shown there. For a related customization
2479for separating the output of @emph{examine} commands @xref{Examining 2629for separating the output of @emph{examine} commands, see @ref{Examining
2480Variables}. 2630Variables}.
2481 2631
2482@defopt idlwave-shell-show-commands (@code{'(run misc breakpoint)}) 2632@defopt idlwave-shell-show-commands (@code{'(run misc breakpoint)})
2483A list of command types to echo in the shell when sent. Possible values 2633A list of command types to echo in the shell when sent. Possible values
2484are @code{run} for @code{.run}, @code{.compile} and other run commands, 2634are @code{run} for @code{.run}, @code{.compile} and other run commands,
2485@code{misc} for lesser used commands like @code{window}, @code{retall}, 2635@code{misc} for lesser used commands like @code{window},
2486etc., @code{breakpoint} for breakpoint setting and clearing commands, 2636@code{retall},@code{close}, etc., @code{breakpoint} for breakpoint
2487and @code{debug} for other debug, stepping, and continue commands. In 2637setting and clearing commands, and @code{debug} for other debug,
2488addition, if the variable is set to the single symbol @code{'everything}, 2638stepping, and continue commands. In addition, if the variable is set to
2489all the copious shell input is displayed (which is probably only useful 2639the single symbol @code{'everything}, all the copious shell input is
2490for debugging purposes). 2640displayed (which is probably only useful for debugging purposes).
2641N.B. For hidden commands which produce output by side-effect, that
2642output remains hidden (e.g., stepping through a @code{print} command).
2643As a special case, any error message in the output will be displayed
2644(e.g., stepping to an error).
2491@end defopt 2645@end defopt
2492 2646
2493@node Debugging IDL Programs, Examining Variables, Commands Sent to the Shell, The IDLWAVE Shell 2647@node Debugging IDL Programs, Examining Variables, Commands Sent to the Shell, The IDLWAVE Shell
@@ -2497,17 +2651,21 @@ for debugging purposes).
2497@cindex Toolbar 2651@cindex Toolbar
2498 2652
2499Programs can be compiled, run, and debugged directly from the source 2653Programs can be compiled, run, and debugged directly from the source
2500buffer in Emacs. IDLWAVE makes compiling and debugging IDL programs 2654buffer in Emacs, walking through arbitrarily deeply nested code,
2501far less cumbersome by providing a full-featured, 2655printing expressions and skipping up and down the calling stack along
2502key/menu/toolbar-driven interface to commands like @code{breakpoint}, 2656the way. IDLWAVE makes compiling and debugging IDL programs far less
2503@code{.step}, @code{.run}, etc. 2657cumbersome by providing a full-featured, key/menu/toolbar-driven
2504 2658interface to commands like @code{breakpoint}, @code{.step},
2505The IDLWAVE shell installs key bindings both in the shell buffer and in 2659@code{.run}, etc. It can even perform complex debug operations not
2506all IDL code buffers of the current Emacs session, so debug commands 2660natively supported by IDL (like continuing to the line at the cursor).
2507work in both places (in the shell, commands operate on the last file 2661
2508compiled). On Emacs versions which support this, a debugging toolbar is 2662The IDLWAVE shell installs key bindings both in the shell buffer and
2509also installed. The display of the toolbar can be toggled with @kbd{C-c 2663in all IDL code buffers of the current Emacs session, so debug
2510C-d C-t} (@code{idlwave-shell-toggle-toolbar}). 2664commands work in both places (in the shell, commands operate on the
2665last file compiled). On Emacs versions which support it, a debugging
2666toolbar is also installed. The toolbar display can be toggled with
2667@kbd{C-c C-d C-t} (@code{idlwave-shell-toggle-toolbar}).
2668
2511 2669
2512@defopt idlwave-shell-use-toolbar (@code{t}) 2670@defopt idlwave-shell-use-toolbar (@code{t})
2513Non-@code{nil} means use the debugging toolbar in all IDL related 2671Non-@code{nil} means use the debugging toolbar in all IDL related
@@ -2515,38 +2673,67 @@ buffers.
2515@end defopt 2673@end defopt
2516 2674
2517@menu 2675@menu
2518* Debug Key Bindings:: 2676* A Tale of Two Modes::
2519* Compiling Programs:: 2677* Debug Key Bindings::
2520* Breakpoints and Stepping:: 2678* Breakpoints and Stepping::
2521* Walking the Calling Stack:: 2679* Compiling Programs::
2680* Walking the Calling Stack::
2681* Electric Debug Mode::
2522@end menu 2682@end menu
2523 2683
2524@node Debug Key Bindings, Compiling Programs, Debugging IDL Programs, Debugging IDL Programs 2684
2685@node A Tale of Two Modes, Debug Key Bindings, Debugging IDL Programs, Debugging IDL Programs
2686@subsection A Tale of Two Modes
2687@cindex Electric Debug Mode
2688@cindex Debugging Interface
2689
2690The many debugging, compiling, and examination commands provided in
2691IDLWAVE are available simultaneously through two different interfaces:
2692the original, multi-key command interface, and the new Electric Debug
2693Mode. The functionality they offer is similar, but the way you
2694interact with them is quite different. The main difference is that,
2695in Electric Debug Mode, the source buffers are made read-only, and
2696single key-strokes are used to step through, examine expressions, set
2697and remove breakpoints, etc. The same variables, prefix arguments,
2698and settings apply to both versions, and both can be used
2699interchangeably. By default, when breakpoints are hit, Electric Debug
2700Mode is enabled. The traditional interface is described first.
2701@xref{Electric Debug Mode}, for more on that mode.
2702
2703
2704@sp 1
2705@noindent @strong{Note that electric debug mode can be prevented from
2706activating automatically by customizing the variable
2707@code{idlwave-shell-automatic-electric-debug}.}
2708
2709@node Debug Key Bindings, Breakpoints and Stepping, A Tale of Two Modes, Debugging IDL Programs
2525@subsection Debug Key Bindings 2710@subsection Debug Key Bindings
2526@kindex C-c C-d 2711@kindex C-c C-d
2527@cindex Key bindings 2712@cindex Key bindings
2528 2713
2529The debugging key bindings are by default on the prefix key @kbd{C-c 2714The standard debugging key bindings are always available by default on
2530C-d}, so for example setting a breakpoint is done with @kbd{C-c C-d 2715the prefix key @kbd{C-c C-d}, so, for example, setting a breakpoint is
2531C-b}, and compiling a source file with @kbd{C-c C-d C-c}. If you find 2716done with @kbd{C-c C-d C-b}, and compiling a source file with @kbd{C-c
2532this too much work, you can easily configure IDLWAVE to use one or more 2717C-d C-c}. You can also easily configure IDLWAVE to use one or more
2533modifier keys not in use by other commands, in lieu of the prefix 2718modifier keys not in use by other commands, in lieu of the prefix
2534@kbd{C-c C-d} (though these bindings will typically also be available 2719@kbd{C-c C-d} (though these bindings will typically also be available
2535--- see @code{idlwave-shell-activate-prefix-keybindings}). For example, 2720--- see @code{idlwave-shell-activate-prefix-keybindings}). For
2536if you write in @file{.emacs}: 2721example, if you include in @file{.emacs}:
2537 2722
2538@lisp 2723@lisp
2539(setq idlwave-shell-debug-modifiers '(control shift)) 2724(setq idlwave-shell-debug-modifiers '(control shift))
2540@end lisp 2725@end lisp
2541 2726
2542@noindent a breakpoint can be set by pressing @kbd{b} while holding down 2727@noindent a breakpoint can then be set by pressing @kbd{b} while holding down
2543@kbd{shift} and @kbd{control} keys, i.e. @kbd{C-S-b}. Compiling a 2728@kbd{shift} and @kbd{control} keys, i.e. @kbd{C-S-b}. Compiling a
2544source file will be on @kbd{C-S-c}, deleting a breakpoint @kbd{C-S-d}, 2729source file will be on @kbd{C-S-c}, deleting a breakpoint @kbd{C-S-d},
2545etc. In the remainder of this chapter we will assume that the @kbd{C-c 2730etc. In the remainder of this chapter we will assume that the
2546C-d} bindings are active, but each of these bindings will have an 2731@kbd{C-c C-d} bindings are active, but each of these bindings will
2547equivalent single-keypress shortcut if modifiers are given in the 2732have an equivalent shortcut if modifiers are given in the
2548@code{idlwave-shell-debug-modifiers} variable (see @pxref{Lesson II -- 2733@code{idlwave-shell-debug-modifiers} variable (@pxref{Lesson II --
2549Customization}). 2734Customization}). A much simpler and faster form of debugging for
2735running code is also available by default --- see @ref{Electric Debug
2736Mode}.
2550 2737
2551@defopt idlwave-shell-prefix-key (@kbd{C-c C-d}) 2738@defopt idlwave-shell-prefix-key (@kbd{C-c C-d})
2552The prefix key for the debugging map 2739The prefix key for the debugging map
@@ -2559,53 +2746,13 @@ key, like @kbd{C-c C-d C-b}.
2559@end defopt 2746@end defopt
2560 2747
2561@defopt idlwave-shell-debug-modifiers (@code{nil}) 2748@defopt idlwave-shell-debug-modifiers (@code{nil})
2562List of modifier keys to use for additional binding of debugging 2749List of modifier keys to use for additional, alternative binding of
2563commands in the shell and source buffers. Can be one or more of 2750debugging commands in the shell and source buffers. Can be one or
2564@code{control}, @code{meta}, @code{super}, @code{hyper}, @code{alt}, and 2751more of @code{control}, @code{meta}, @code{super}, @code{hyper},
2565@code{shift}. 2752@code{alt}, and @code{shift}.
2566@end defopt
2567
2568@node Compiling Programs, Breakpoints and Stepping, Debug Key Bindings, Debugging IDL Programs
2569@subsection Compiling Programs
2570@cindex Compiling programs
2571@cindex Programs, compiling
2572@cindex Default command line, executing
2573@cindex Executing a default command line
2574
2575@kindex C-c C-d C-c
2576In order to compile the current buffer under the IDLWAVE shell, press
2577@kbd{C-c C-d C-c} (@code{idlwave-save-and-run}). This first saves the
2578current buffer and then sends the command @samp{.run path/to/file} to the
2579shell. You can also execute @kbd{C-c C-d C-c} from the shell buffer, in
2580which case the most recently compiled buffer will be saved and
2581re-compiled.
2582
2583When developing or debugging a program, it is often necessary to execute
2584the same command line many times. A convenient way to do this is
2585@kbd{C-c C-d C-y} (@code{idlwave-shell-execute-default-command-line}).
2586This command first resets IDL from a state of interrupted execution by
2587closing all files and returning to the main interpreter level. Then a
2588default command line is send to the shell. To edit the default command
2589line, call @code{idlwave-shell-execute-default-command-line} with a
2590prefix argument: @kbd{C-u C-c C-d C-y}.
2591
2592@defopt idlwave-shell-mark-stop-line (@code{t})
2593Non-@code{nil} means mark the source code line where IDL is currently
2594stopped. The value specifies the preferred method. Legal values are
2595@code{nil}, @code{t}, @code{arrow}, and @code{face}.
2596@end defopt 2753@end defopt
2597 2754
2598@defopt idlwave-shell-overlay-arrow (@code{">"}) 2755@node Breakpoints and Stepping, Compiling Programs, Debug Key Bindings, Debugging IDL Programs
2599The overlay arrow to display at source lines where execution halts, if
2600configured in @code{idlwave-shell-mark-stop-line}.
2601@end defopt
2602
2603@defopt idlwave-shell-stop-line-face
2604The face which highlights the source line where IDL is stopped, if
2605configured in @code{idlwave-shell-mark-stop-line}.
2606@end defopt
2607
2608@node Breakpoints and Stepping, Walking the Calling Stack, Compiling Programs, Debugging IDL Programs
2609@subsection Breakpoints and Stepping 2756@subsection Breakpoints and Stepping
2610@cindex Breakpoints 2757@cindex Breakpoints
2611@cindex Stepping 2758@cindex Stepping
@@ -2613,24 +2760,33 @@ configured in @code{idlwave-shell-mark-stop-line}.
2613 2760
2614@kindex C-c C-d C-b 2761@kindex C-c C-d C-b
2615@kindex C-c C-d C-b 2762@kindex C-c C-d C-b
2616You can set breakpoints and step through a program with IDLWAVE. 2763IDLWAVE helps you set breakpoints and step through code. Setting a
2617Setting a breakpoint in the current line of the source buffer is done 2764breakpoint in the current line of the source buffer is accomplished
2618with @kbd{C-c C-d C-b} (@code{idlwave-shell-break-here}). With a prefix 2765with @kbd{C-c C-d C-b} (@code{idlwave-shell-break-here}). With a
2619arg of 1 (i.e. @kbd{C-1 C-c C-d C-b}), the breakpoint gets a 2766prefix arg of 1 (i.e. @kbd{C-1 C-c C-d C-b}), the breakpoint gets a
2620@code{/ONCE} keyword, meaning that it will be deleted after first use. 2767@code{/ONCE} keyword, meaning that it will be deleted after first use.
2621With a numeric prefix greater than one (e.g. @kbd{C-4 C-c C-d C-b}), the 2768With a numeric prefix greater than one (e.g. @kbd{C-4 C-c C-d C-b}),
2622breakpoint will only be active the @code{nth} time it is hit. With a 2769the breakpoint will only be active the @code{nth} time it is hit.
2623single non-numeric prefix (i.e. @kbd{C-u C-c C-d C-b}), prompt for a 2770With a single non-numeric prefix (i.e. @kbd{C-u C-c C-d C-b}), prompt
2624condition --- an IDL expression to be evaulated and trigger the 2771for a condition --- an IDL expression to be evaulated and trigger the
2625breakpoint only if true. To clear the breakpoint in the current line, 2772breakpoint only if true. To clear the breakpoint in the current line,
2626use @kbd{C-c C-d C-d} (@code{idlwave-clear-current-bp}). When executed 2773use @kbd{C-c C-d C-d} (@code{idlwave-clear-current-bp}). When
2627from the shell window, the breakpoint where IDL is currently stopped 2774executed from the shell window, the breakpoint where IDL is currently
2628will be deleted. To clear all breakpoints, use @kbd{C-c C-d C-a} 2775stopped will be deleted. To clear all breakpoints, use @kbd{C-c C-d
2629(@code{idlwave-clear-all-bp}). Breakpoint lines are highlighted in the 2776C-a} (@code{idlwave-clear-all-bp}). Breakpoints can also be disabled
2630source code. Note that IDL places breakpoints as close as possible on 2777and re-enabled: @kbd{C-c C-d C-\}
2631or after the line you specify. IDLWAVE queries the shell for the actual 2778(@code{idlwave-shell-toggle-enable-current-bp}).
2632breakpoint location which was set, so the exact line you specify may not 2779
2633be marked. 2780
2781Breakpoint lines are highlighted or indicated with an icon in the
2782source code (different icons for conditional, after, and other break
2783types). Disabled breakpoints are @emph{grayed out} by default. Note
2784that IDL places breakpoints as close as possible on or after the line
2785you specify. IDLWAVE queries the shell for the actual breakpoint
2786location which was set, so the exact line you specify may not be
2787marked. You can re-sync the breakpoint list and display at any time
2788(e.g., if you add or remove some on the command line) using @kbd{C-c
2789C-d C-l}.
2634 2790
2635Once the program has stopped somewhere, you can step through it. The 2791Once the program has stopped somewhere, you can step through it. The
2636most important stepping commands are @kbd{C-c C-d C-s} to execute one 2792most important stepping commands are @kbd{C-c C-d C-s} to execute one
@@ -2651,6 +2807,14 @@ breakpoint and stepping commands:
2651@tab Clear current breakpoint (@code{idlwave-shell-clear-current-bp}) 2807@tab Clear current breakpoint (@code{idlwave-shell-clear-current-bp})
2652@item @kbd{C-c C-d C-a} 2808@item @kbd{C-c C-d C-a}
2653@tab Clear all breakpoints (@code{idlwave-shell-clear-all-bp}) 2809@tab Clear all breakpoints (@code{idlwave-shell-clear-all-bp})
2810@item @kbd{C-c C-d [}
2811@tab Go to the previous breakpoint (@code{idlwave-shell-goto-previous-bp})
2812@item @kbd{C-c C-d ]}
2813@tab Go to the next breakpoint (@code{idlwave-shell-goto-next-bp})
2814@item @kbd{C-c C-d C-\}
2815@tab Disable/Enable current breakpoint (@code{idlwave-shell-toggle-enable-current-bp})
2816@item @kbd{C-c C-d C-j}
2817@tab Set a breakpoint at the beginning of the enclosing routine.
2654@item @kbd{C-c C-d C-s} 2818@item @kbd{C-c C-d C-s}
2655@tab Step, into function calls (@code{idlwave-shell-step}) 2819@tab Step, into function calls (@code{idlwave-shell-step})
2656@item @kbd{C-c C-d C-n} 2820@item @kbd{C-c C-d C-n}
@@ -2666,13 +2830,16 @@ breakpoint and stepping commands:
2666@item @kbd{C-c C-d C-h} 2830@item @kbd{C-c C-d C-h}
2667@tab Continue to line at cursor position (@code{idlwave-shell-to-here}) 2831@tab Continue to line at cursor position (@code{idlwave-shell-to-here})
2668@item @kbd{C-c C-d C-r} 2832@item @kbd{C-c C-d C-r}
2669@tab Continue execution to next breakpoint (@code{idlwave-shell-cont}) 2833@tab Continue execution to next breakpoint, if any (@code{idlwave-shell-cont})
2670@item @kbd{C-c C-d C-up} 2834@item @kbd{C-c C-d C-up}
2671@tab Show higher level in calling stack (@code{idlwave-shell-stack-up}) 2835@tab Show higher level in calling stack (@code{idlwave-shell-stack-up})
2672@item @kbd{C-c C-d C-down} 2836@item @kbd{C-c C-d C-down}
2673@tab Show lower level in calling stack (@code{idlwave-shell-stack-down}) 2837@tab Show lower level in calling stack (@code{idlwave-shell-stack-down})
2674@end multitable 2838@end multitable
2675 2839
2840All of these commands have equivalents in Electric Debug Mode, which
2841provides faster access (@pxref{Electric Debug Mode}).
2842
2676@defopt idlwave-shell-mark-breakpoints (@code{t}) 2843@defopt idlwave-shell-mark-breakpoints (@code{t})
2677Non-@code{nil} means mark breakpoints in the source file buffers. The 2844Non-@code{nil} means mark breakpoints in the source file buffers. The
2678value indicates the preferred method. Legal values are @code{nil}, 2845value indicates the preferred method. Legal values are @code{nil},
@@ -2684,7 +2851,49 @@ The face for breakpoint lines in the source code if
2684@code{idlwave-shell-mark-breakpoints} has the value @code{face}. 2851@code{idlwave-shell-mark-breakpoints} has the value @code{face}.
2685@end defopt 2852@end defopt
2686 2853
2687@node Walking the Calling Stack, , Breakpoints and Stepping, Debugging IDL Programs 2854@node Compiling Programs, Walking the Calling Stack, Breakpoints and Stepping, Debugging IDL Programs
2855@subsection Compiling Programs
2856@cindex Compiling programs
2857@cindex Programs, compiling
2858@cindex Default command line, executing
2859@cindex Executing a default command line
2860
2861@kindex C-c C-d C-c
2862In order to compile the current buffer under the IDLWAVE shell, press
2863@kbd{C-c C-d C-c} (@code{idlwave-save-and-run}). This first saves the
2864current buffer and then sends the command @samp{.run path/to/file} to the
2865shell. You can also execute @kbd{C-c C-d C-c} from the shell buffer, in
2866which case the most recently compiled buffer will be saved and
2867re-compiled.
2868
2869When developing or debugging a program, it is often necessary to execute
2870the same command line many times. A convenient way to do this is
2871@kbd{C-c C-d C-y} (@code{idlwave-shell-execute-default-command-line}).
2872This command first resets IDL from a state of interrupted execution by
2873closing all files and returning to the main interpreter level. Then a
2874default command line is send to the shell. To edit the default command
2875line, call @code{idlwave-shell-execute-default-command-line} with a
2876prefix argument: @kbd{C-u C-c C-d C-y}. If no default command line has
2877been set (or you give two prefix arguments), the last command on the
2878@code{comint} input history is sent.
2879
2880@defopt idlwave-shell-mark-stop-line (@code{t})
2881Non-@code{nil} means mark the source code line where IDL is currently
2882stopped. The value specifies the preferred method. Legal values are
2883@code{nil}, @code{t}, @code{arrow}, and @code{face}.
2884@end defopt
2885
2886@defopt idlwave-shell-overlay-arrow (@code{">"})
2887The overlay arrow to display at source lines where execution halts, if
2888configured in @code{idlwave-shell-mark-stop-line}.
2889@end defopt
2890
2891@defopt idlwave-shell-stop-line-face
2892The face which highlights the source line where IDL is stopped, if
2893configured in @code{idlwave-shell-mark-stop-line}.
2894@end defopt
2895
2896@node Walking the Calling Stack, Electric Debug Mode, Compiling Programs, Debugging IDL Programs
2688@subsection Walking the Calling Stack 2897@subsection Walking the Calling Stack
2689@cindex Calling stack, walking 2898@cindex Calling stack, walking
2690 2899
@@ -2704,25 +2913,150 @@ for information how to examine the value of variables and expressions on
2704higher calling stack levels. 2913higher calling stack levels.
2705 2914
2706@ifhtml 2915@ifhtml
2916<A NAME="EDEBUG"></A>
2917@end ifhtml
2918@node Electric Debug Mode, , Walking the Calling Stack, Debugging IDL Programs
2919@subsection Electric Debug Mode
2920@cindex Electric Debug Mode
2921@cindex @samp{*Debugging*}
2922
2923Even with a convenient debug key prefix enabled, repetitive stepping,
2924variable examination (@pxref{Examining Variables}), and other
2925debugging activities can be awkward and slow using commands which
2926require multiple keystrokes. Luckily, there's a better way, inspired
2927by the lisp e-debug mode, and available through the @emph{Electric
2928Debug Mode}. By default, as soon as a breakpoint is hit, this minor
2929mode is enabled. The buffer showing the line where execution has
2930halted is switched to Electric Debug Mode. This mode is visible as
2931@samp{*Debugging*} in the mode line, and a different face (violet by
2932default, where color is available) for the line stopped at point. The
2933buffer is made read-only and single-character bindings for the most
2934commonly used debugging commands are enabled:
2935
2936@multitable @columnfractions .2 .8
2937@item @kbd{a}
2938@tab Clear all breakpoints (@code{idlwave-shell-clear-all-bp})
2939@item @kbd{b}
2940@tab Set breakpoint, @kbd{C-u b} for a conditional break, @kbd{C-n b} for nth hit (@code{idlwave-shell-break-here})
2941@item @kbd{d}
2942@tab Clear current breakpoint (@code{idlwave-shell-clear-current-bp})
2943@item @kbd{h}
2944@tab Continue to the line at cursor position (@code{idlwave-shell-to-here})
2945@item @kbd{i}
2946@tab Set breakpoint in function named here (@code{idlwave-shell-break-in})
2947@item @kbd{[}
2948@tab Go to the previous breakpoint in the file (@code{idlwave-shell-goto-previous-bp})
2949@item @kbd{]}
2950@tab Go to the next breakpoint in the file
2951(@code{idlwave-shell-goto-next-bp})
2952@item @kbd{\}
2953@tab Disable/Enable current breakpoint (@code{idlwave-shell-toggle-enable-current-bp})
2954@item @kbd{j}
2955@tab Set breakpoint at beginning of enclosing routine (@code{idlwave-shell-break-this-module})
2956@item @kbd{k}
2957@tab Skip one statement (@code{idlwave-shell-skip})
2958@item @kbd{m}
2959@tab Continue to end of function (@code{idlwave-shell-return})
2960@item @kbd{n}
2961@tab Step, over function calls (@code{idlwave-shell-stepover})
2962@item @kbd{o}
2963@tab Continue past end of function (@code{idlwave-shell-out})
2964@item @kbd{p}
2965@tab Print expression near point or in region with @kbd{C-u p} (@code{idlwave-shell-print})
2966@item @kbd{q}
2967@tab End the debugging session and return to the Shell's main level
2968(@code{idlwave-shell-retall})
2969@item @kbd{r}
2970@tab Continue execution to next breakpoint, if any (@code{idlwave-shell-cont})
2971@item @kbd{s} or @kbd{@key{SPACE}}
2972@tab Step, into function calls (@code{idlwave-shell-step})
2973@item @kbd{t}
2974@tab Print a calling-level traceback in the shell
2975@item @kbd{u}
2976@tab Continue to end of block (@code{idlwave-shell-up})
2977@item @kbd{v}
2978@tab Turn Electric Debug Mode off
2979(@code{idlwave-shell-electric-debug-mode})
2980@item @kbd{x}
2981@tab Examine expression near point (or in region with @kbd{C-u x})
2982with shortcut of examine type.
2983@item @kbd{z}
2984@tab Reset IDL (@code{idlwave-shell-reset})
2985@item @kbd{+} or @kbd{=}
2986@tab Show higher level in calling stack (@code{idlwave-shell-stack-up})
2987@item @kbd{-} or @kbd{_}
2988@tab Show lower level in calling stack (@code{idlwave-shell-stack-down})
2989@item @kbd{?}
2990@tab Help on expression near point or in region with @kbd{C-u ?}
2991(@code{idlwave-shell-help-expression})
2992@item @kbd{C-?}
2993@tab Show help on the commands available.
2994@end multitable
2995
2996Most single-character electric debug bindings use the final keystroke
2997of the equivalent multiple key commands (which are of course also
2998still available), but some differ (e.g. @kbd{t},@kbd{q},@kbd{x}).
2999Some have additional convenience bindings (like @kbd{@key{SPACE}} for
3000stepping). All prefix and other argument options described in this
3001section for the commands invoked by electric debug bindings are still
3002valid. For example, @kbd{C-u b} sets a conditional breakpoint, just
3003as it did with @kbd{C-u C-c C-d C-b}.
3004
3005You can toggle the electric debug mode at any time in a buffer using
3006@kbd{C-c C-d C-v} (@kbd{v} to turn it off while in the mode), or from
3007the Debug menu. Normally the mode will be enabled and disabled at the
3008appropriate times, but occassionally you might want to edit a file
3009while still debugging it, or switch to the mode for conveniently
3010setting lots of breakpoints.
3011
3012To quickly abandon a debugging session and return to normal editing at
3013the Shell's main level, use @kbd{q} (@code{idlwave-shell-retall}).
3014This disables electric debug mode in all IDLWAVE buffers@footnote{Note
3015that this binding is not symmetric: @kbd{C-c C-d C-q} is bound to
3016@code{idlwave-shell-quit}, which quits your IDL session.}. Help is
3017available for the command shortcuts with @kbd{C-?}. If you find this
3018mode gets in your way, you can keep it from automatically activating
3019by setting the variable @code{idlwave-shell-automatic-electric-debug}
3020to @code{nil}, or @code{'breakpoint}. If you'd like the convenient
3021electric debug shortcuts available also when run-time errors are
3022encountered, set to @code{t}.
3023
3024@defopt idlwave-shell-automatic-electric-debug (@code{'breakpoint})
3025Whether to enter electric debug mode automatically when a breakpoint
3026or run-time error is encountered, and then disable it in all buffers
3027when the $MAIN$ level is reached (either through normal program
3028execution, or retall). In addition to @code{nil} for never, and
3029@code{t} for both breakpoints and errors, this can be
3030@code{'breakpoint} (the default) to enable it only at breakpoint
3031halts.
3032@end defopt
3033
3034@defopt idlwave-shell-electric-zap-to-file (@code{t})
3035If set, when entering electric debug mode, select the window displaying
3036the file where point is stopped. This takes point away from the shell
3037window, but is useful for immediate stepping, etc.
3038@end defopt
3039
3040@ifhtml
2707<A NAME="EXAMINE"></A> 3041<A NAME="EXAMINE"></A>
2708@end ifhtml 3042@end ifhtml
2709@node Examining Variables, Custom Expression Examination, Debugging IDL Programs, The IDLWAVE Shell 3043@node Examining Variables, Custom Expression Examination, Debugging IDL Programs, The IDLWAVE Shell
2710@section Examining Variables 3044@section Examining Variables
2711@cindex @code{PRINT} expressions 3045@cindex @code{PRINT} expressions
2712@cindex @code{HELP}, on expressions 3046@cindex @code{HELP}, on expressions
2713@cindex Expressions, printing 3047@cindex Expressions, printing & help
2714@cindex Expressions, help 3048@cindex Examining expressions
2715@cindex Printing expressions 3049@cindex Printing expressions
2716@cindex Mouse binding to print expressions 3050@cindex Mouse binding to print expressions
2717 3051
2718@kindex C-c C-d C-p 3052@kindex C-c C-d C-p
2719Do you find yourself repeatedly typing, e.g. @code{print,n_elements(x)}, 3053Do you find yourself repeatedly typing,
2720and similar statements to remind yourself of the 3054e.g. @code{print,n_elements(x)}, and similar statements to remind
2721type/size/structure/value/etc. of variables and expressions in your code 3055yourself of the type/size/structure/value/etc. of variables and
2722or at the command line? IDLWAVE has a suite of special commands to 3056expressions in your code or at the command line? IDLWAVE has a suite
2723automate these types of variables or expression examinations. They work 3057of special commands to automate these types of variable or expression
2724by sending statements to the shell formatted to include the indicated 3058examinations. They work by sending statements to the shell formatted
2725expression. 3059to include the indicated expression.
2726 3060
2727These examination commands can be used in the shell or buffer at any 3061These examination commands can be used in the shell or buffer at any
2728time (as long as the shell is running), and are very useful when 3062time (as long as the shell is running), and are very useful when
@@ -2730,7 +3064,7 @@ execution is stopped in a buffer due to a triggered breakpoint or error,
2730or while composing a long command in the IDLWAVE shell. In the latter 3064or while composing a long command in the IDLWAVE shell. In the latter
2731case, the command is sent to the shell and its output is visible, but 3065case, the command is sent to the shell and its output is visible, but
2732point remains unmoved in the command being composed --- you can inspect 3066point remains unmoved in the command being composed --- you can inspect
2733the constituents of a command you're building without interrupting the 3067the contituents of a command you're building without interrupting the
2734process of building it! You can even print arbitrary expressions from 3068process of building it! You can even print arbitrary expressions from
2735older input or output further up in the shell window --- any expression, 3069older input or output further up in the shell window --- any expression,
2736variable, number, or function you see can be examined. 3070variable, number, or function you see can be examined.
@@ -2743,13 +3077,14 @@ contents, and @key{q} hides the buffer.
2743 3077
2744The two most basic examine commands are bound to @kbd{C-c C-d C-p}, to 3078The two most basic examine commands are bound to @kbd{C-c C-d C-p}, to
2745print the expression at point, and @kbd{C-c C-d ?}, to invoke help on 3079print the expression at point, and @kbd{C-c C-d ?}, to invoke help on
2746this expression. The expression at point is either an array expression 3080this expression@footnote{Available as @kbd{p} and @kbd{?} in Electric
2747or a function call, or the contents of a pair of parentheses. The 3081Debug Mode (@pxref{Electric Debug Mode})}. The expression at point is
2748selected expression is highlighted, and simultaneously the resulting 3082either an array expression or a function call, or the contents of a
2749output is highlighted in the shell. Calling the above commands with a 3083pair of parentheses. The selected expression is highlighted, and
2750prefix argument will prompt for an expression instead of using the one 3084simultaneously the resulting output is highlighted in the shell.
2751at point. Two prefix arguments (@kbd{C-u C-u C-c C-d C-p}) will use the 3085Calling the above commands with a prefix argument will use the current
2752current region as expression. 3086region as expression instead of using the one at point. Two prefix
3087arguments (@kbd{C-u C-u C-c C-d C-p}) will prompt for an expression.
2753 3088
2754For added speed and convenience, there are mouse bindings which allow 3089For added speed and convenience, there are mouse bindings which allow
2755you to click on expressions and examine their values. Use 3090you to click on expressions and examine their values. Use
@@ -2757,10 +3092,10 @@ you to click on expressions and examine their values. Use
2757help (i.e. you need to hold down @key{META} and @key{CONTROL} while 3092help (i.e. you need to hold down @key{META} and @key{CONTROL} while
2758clicking with the middle mouse button). If you simply click, the 3093clicking with the middle mouse button). If you simply click, the
2759nearest expression will be selected in the same manner as described 3094nearest expression will be selected in the same manner as described
2760above. You can also @emph{drag} the mouse in order to highlight exactly 3095above. You can also @emph{drag} the mouse in order to highlight
2761a specific expression or sub-expression to be examined. For custom 3096exactly the specific expression or sub-expression you want to examine.
2762expression examination, and the customizable pop-up examine selection, 3097For custom expression examination, and the powerful customizable
2763@xref{Custom Expression Examination}. 3098pop-up examine selection, @xref{Custom Expression Examination}.
2764 3099
2765@cindex Printing expressions, on calling stack 3100@cindex Printing expressions, on calling stack
2766@cindex Restrictions for expression printing 3101@cindex Restrictions for expression printing
@@ -2782,7 +3117,8 @@ with a @samp{( )} will be interpreted as function calls.
2782@cindex ROUTINE_NAMES, IDL procedure 3117@cindex ROUTINE_NAMES, IDL procedure
2783N.B.: printing values of expressions on higher levels of the calling 3118N.B.: printing values of expressions on higher levels of the calling
2784stack uses the @emph{unsupported} IDL routine @code{ROUTINE_NAMES}, 3119stack uses the @emph{unsupported} IDL routine @code{ROUTINE_NAMES},
2785which may or may not be available in future versions of IDL. 3120which may or may not be available in future versions of IDL. Caveat
3121Examinor.
2786@end itemize 3122@end itemize
2787 3123
2788@defopt idlwave-shell-expression-face 3124@defopt idlwave-shell-expression-face
@@ -2792,14 +3128,14 @@ the expression printed by IDL.
2792@end defopt 3128@end defopt
2793 3129
2794@defopt idlwave-shell-output-face 3130@defopt idlwave-shell-output-face
2795The face for @code{idlwave-shell-output-overlay}. 3131The face for @code{idlwave-shell-output-overlay}.
2796Allows to choose the font, color and other properties for the most 3132Allows to choose the font, color and other properties for the most
2797recent output of IDL when examining an expression." 3133recent output of IDL when examining an expression."
2798@end defopt 3134@end defopt
2799 3135
2800@defopt idlwave-shell-separate-examine-output (@code{t}) 3136@defopt idlwave-shell-separate-examine-output (@code{t})
2801If non-@code{nil}, re-direct the output of examine commands to a special 3137If non-@code{nil}, re-direct the output of examine commands to a special
2802@file{*Examine*} buffer, instead of in the shell itself. 3138@file{*Examine*} buffer, instead of in the shell itself.
2803@end defopt 3139@end defopt
2804 3140
2805@node Custom Expression Examination, , Examining Variables, The IDLWAVE Shell 3141@node Custom Expression Examination, , Examining Variables, The IDLWAVE Shell
@@ -2812,45 +3148,53 @@ endless (just look, for instance, at the keyword list to
2812@code{widget_info()}). Rather than attempt to include them all, IDLWAVE 3148@code{widget_info()}). Rather than attempt to include them all, IDLWAVE
2813provides two easy methods to customize your own commands, with a special 3149provides two easy methods to customize your own commands, with a special
2814mouse examine command, and two macros for generating your own examine 3150mouse examine command, and two macros for generating your own examine
2815bindings. 3151key and mouse bindings.
2816 3152
2817The most powerful and flexible mouse examine command is available on 3153The most powerful and flexible mouse examine command of all is
2818@kbd{C-S-Mouse-2}. Just as for all the other mouse examine commands, it 3154available on @kbd{C-S-Mouse-2}. Just as for all the other mouse
2819permits click or drag expression selection, but instead of sending 3155examine commands, it permits click or drag expression selection, but
2820hard-coded commands to the shell, it pops-up a customizable selection 3156instead of sending hard-coded commands to the shell, it pops-up a
2821list of examine functions to choose among, configured with the 3157customizable selection list of examine functions to choose among,
2822@code{idlwave-shell-examine-alist} variable. This variable is a list of 3158configured with the @code{idlwave-shell-examine-alist}
2823key-value pairs (an @emph{alist} in Emacs parlance), where the keys name 3159variable@footnote{In Electric Debug Mode (@pxref{Electric Debug
2824the command, and the values are the command strings, in which the text 3160Mode}), the key @kbd{x} provides a single-character shortcut interface
2825@code{___} (three underscores) will be replaced by the selected 3161to the same examine functions for the expression at point or marked by
2826expression before being sent to the shell. An example might be key 3162the region.}. This variable is a list of key-value pairs (an
2827@code{Structure Help} with value @code{help,___,/STRUCTURE}. 3163@emph{alist} in Emacs parlance), where the key gives a name to be
2828@code{idlwave-shell-examine-alist} comes by default with a large list of 3164shown for the examine command, and the value is the command strings
2829examine commands, but can be easily customized to add more. 3165itself, in which the text @code{___} (three underscores) will be
2830 3166replaced by the selected expression before being sent to the shell.
2831In addition to the pop-up mouse command, you can easily create your own 3167An example might be key @code{Structure Help} with value
2832customized bindings to inspect expressions using the two convenience 3168@code{help,___,/STRUCTURE}. In that case, you'd be prompted with
2833macros @code{idlwave-shell-inspect} and 3169@emph{Structure Help}, which might send something like
2834@code{idlwave-shell-mouse-inspect}. These create keyboard or 3170@code{help,var,/STRUCTURE} to the shell for output.
2835mouse-based custom inspections of variables, sharing all the same 3171@code{idlwave-shell-examine-alist} comes configured by default with a
2836properties of the built-in examine commands. Both functions take a 3172large list of examine commands, but you can easily customize it to add
2837single string argument sharing the syntax of the 3173your own.
3174
3175In addition to configuring the functions available to the pop-up mouse
3176command, you can easily create your own customized bindings to inspect
3177expressions using the two convenience macros
3178@code{idlwave-shell-examine} and @code{idlwave-shell-mouse-examine}.
3179These create keyboard or mouse-based custom inspections of variables,
3180sharing all the same properties of the built-in examine commands.
3181Both functions take a single string argument sharing the syntax of the
2838@code{idlwave-shell-examine-alist} values, e.g.: 3182@code{idlwave-shell-examine-alist} values, e.g.:
2839 3183
2840@lisp 3184@lisp
2841(add-hook 'idlwave-shell-mode-hook 3185(add-hook 'idlwave-shell-mode-hook
2842 (lambda () 3186 (lambda ()
2843 (idlwave-shell-define-key-both [s-down-mouse-2] 3187 (idlwave-shell-define-key-both [s-down-mouse-2]
2844 (idlwave-shell-mouse-examine 3188 (idlwave-shell-mouse-examine
2845 "print, size(___,/DIMENSIONS)")) 3189 "print, size(___,/DIMENSIONS)"))
2846 (idlwave-shell-define-key-both [f9] (idlwave-shell-examine 3190 (idlwave-shell-define-key-both [f9] (idlwave-shell-examine
2847 "print, size(___,/DIMENSIONS)")) 3191 "print, size(___,/DIMENSIONS)"))
2848 (idlwave-shell-define-key-both [f10] (idlwave-shell-examine 3192 (idlwave-shell-define-key-both [f10] (idlwave-shell-examine
2849 "print,size(___,/TNAME)")) 3193 "print,size(___,/TNAME)"))
2850 (idlwave-shell-define-key-both [f11] (idlwave-shell-examine 3194 (idlwave-shell-define-key-both [f11] (idlwave-shell-examine
2851 "help,___,/STRUCTURE")))) 3195 "help,___,/STRUCTURE"))))
2852@end lisp 3196@end lisp
2853 3197
2854@noindent Now pressing @key{f9}, or middle-mouse dragging with the 3198@noindent Now pressing @key{f9}, or middle-mouse dragging with the
2855@key{SUPER} key depressed, will print the dimensions of the nearby or 3199@key{SUPER} key depressed, will print the dimensions of the nearby or
2856highlighted expression. Pressing @key{f10} will give the type string, 3200highlighted expression. Pressing @key{f10} will give the type string,
@@ -2858,10 +3202,10 @@ and @key{f11} will show the contents of a nearby structure. As you can
2858see, the possibilities are only marginally finite. 3202see, the possibilities are only marginally finite.
2859 3203
2860@defopt idlwave-shell-examine-alist 3204@defopt idlwave-shell-examine-alist
2861An alist of examine commands in which the keys name the command and are 3205An alist of examine commands in which the keys name the command and
2862displayed in the selection pop-up, and the values are custom IDL examine 3206are displayed in the selection pop-up, and the values are custom IDL
2863command strings to send, after all instances of @code{___} are replaced 3207examine command strings to send, after all instances of @code{___}
2864by the indicated expression. 3208(three underscores) are replaced by the indicated expression.
2865@end defopt 3209@end defopt
2866 3210
2867 3211
@@ -2872,7 +3216,6 @@ by the indicated expression.
2872@menu 3216@menu
2873* Installing IDLWAVE:: How to install the distribution 3217* Installing IDLWAVE:: How to install the distribution
2874* Installing Online Help:: Where to get the additional files needed 3218* Installing Online Help:: Where to get the additional files needed
2875* Upgrading from idl.el:: Necessary configuration changes
2876@end menu 3219@end menu
2877 3220
2878@node Installing IDLWAVE, Installing Online Help, Installation, Installation 3221@node Installing IDLWAVE, Installing Online Help, Installation, Installation
@@ -2889,65 +3232,34 @@ IDLWAVE is part of Emacs 21.1 and later. It is also an XEmacs package
2889and can be installed from 3232and can be installed from
2890@uref{ftp://ftp.xemacs.org/pub/xemacs/packages/,the XEmacs ftp site} 3233@uref{ftp://ftp.xemacs.org/pub/xemacs/packages/,the XEmacs ftp site}
2891with the normal package management system on XEmacs 21. These 3234with the normal package management system on XEmacs 21. These
2892pre-installed versions should work out-of-the-box. However, the files 3235pre-installed versions should work out-of-the-box. However, the HTML
2893required for online help are not distributed with XEmacs/Emacs and have 3236files required for online HTML help are not distributed with
2894to be installed separately@footnote{Due to copyright reasons, the ASCII 3237XEmacs/Emacs and have to be installed separately@footnote{Due to
2895version of the IDL manual cannot be distributed under the GPL.} 3238copyright reasons, the HTML version of the IDL manual cannot be
2896(@pxref{Installing Online Help}). 3239distributed under the GPL.} (@pxref{Installing Online Help}).
2897 3240
2898You can also download IDLWAVE and install it yourself from 3241You can also download IDLWAVE and install it yourself from
2899@uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. Follow the 3242@uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. Follow the
2900instructions in the INSTALL file. 3243instructions in the INSTALL file.
2901 3244
2902@node Installing Online Help, Upgrading from idl.el, Installing IDLWAVE, Installation 3245@node Installing Online Help, , Installing IDLWAVE, Installation
2903@section Installing Online Help 3246@section Installing Online Help
2904@cindex Installing online help 3247@cindex Installing online help
2905@cindex Online Help, Installation 3248@cindex Online Help, Installation
2906 3249
2907If you want to use the online help display, two additional files (an 3250If you want to use the online help display, an additional set of files
2908ASCII version of the IDL documentation and a topics/code file) must be 3251(HTML versions of the IDL documentation) must be installed. These
2909installed. These files can also be downloaded from 3252files can also be downloaded from @uref{@value{IDLWAVE-HOMEPAGE}, the
2910@uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. You need to 3253maintainers webpage}. You need to place the files somewhere on your
2911place the files somewhere on your system and tell IDLWAVE where they are 3254system and tell IDLWAVE where they are with
2912with
2913 3255
2914@lisp 3256@lisp
2915(setq idlwave-help-directory "/path/to/help/files/") 3257(setq idlwave-html-help-location "/path/to/help/dir/") ;e.g. /usr/local/etc
2916@end lisp 3258@end lisp
2917 3259
2918@node Upgrading from idl.el, , Installing Online Help, Installation 3260Note that the help package only changes with new versions of the IDL
2919@section Upgrading from the old @b{@file{idl.el}} file 3261documentation, and need not be updated unless your version of IDL
2920@cindex Upgrading from old @b{@file{idl.el}} 3262changes.
2921@cindex Renaming old variables
2922@cindex Old variables, renaming
2923@kindex M-@key{TAB}
2924
2925If you have been using the old @file{idl.el} and @file{idl-shell.el}
2926files and would like to use IDLWAVE, you need to update your
2927customization in @file{.emacs}.
2928
2929@enumerate
2930@item
2931Change all variable and function prefixes from @samp{idl-} to @samp{idlwave-}.
2932@item
2933Remove the now invalid @code{autoload} and @code{auto-mode-alist} forms
2934pointing to the @file{idl.el} and @file{idl-shell.el} files. Install
2935the new autoload forms.
2936@item
2937If you have been using the hook function recommended in earlier versions
2938to get a separate frame for the IDL shell, remove that command from your
2939@code{idlwave-shell-mode-hook}. Instead, set the variable
2940@code{idlwave-shell-use-dedicated-frame} with
2941@lisp
2942(setq idlwave-shell-use-dedicated-frame t)
2943@end lisp
2944@item
2945The key sequence @kbd{M-@key{TAB}} no longer inserts a TAB character.
2946Like in many other Emacs modes, @kbd{M-@key{TAB}} now does
2947completion. Inserting a TAB has therefore been moved to
2948@kbd{C-@key{TAB}}. On a character based terminal you can also use
2949@kbd{C-c @key{SPC}}.
2950@end enumerate
2951 3263
2952@node Acknowledgements, Sources of Routine Info, Installation, Top 3264@node Acknowledgements, Sources of Routine Info, Installation, Top
2953@chapter Acknowledgements 3265@chapter Acknowledgements
@@ -2973,10 +3285,11 @@ of the package from version 3.0, during which time he overhauled almost
2973everything, modernized IDLWAVE with many new features, and developed the 3285everything, modernized IDLWAVE with many new features, and developed the
2974manual. 3286manual.
2975 3287
2976@item 3288@item
2977@uref{mailto:jdsmith@@as.arizona.edu, @b{J.D. Smith}}, the current 3289@uref{mailto:jdsmith@@as.arizona.edu, @b{J.D. Smith}}, the current
2978maintainer, as of version 4.10, helped shape object method completion 3290maintainer, as of version 4.10, helped shape object method completion
2979and most new features introduced in versions 4.x. 3291and most new features introduced in versions 4.x, and added
3292significant new capabilities for versions 5.x.
2980@end itemize 3293@end itemize
2981 3294
2982@noindent 3295@noindent
@@ -2985,43 +3298,45 @@ with patches, ideas, bug reports and suggestions.
2985 3298
2986@itemize @minus 3299@itemize @minus
2987@item 3300@item
2988Ulrik Dickow <dickow@@nbi.dk> 3301Ulrik Dickow <dickow__at__nbi.dk>
2989@item 3302@item
2990Eric E. Dors <edors@@lanl.gov> 3303Eric E. Dors <edors__at__lanl.gov>
2991@item 3304@item
2992Stein Vidar H. Haugan <s.v.h.haugan@@astro.uio.no> 3305Stein Vidar H. Haugan <s.v.h.haugan__at__astro.uio.no>
2993@item 3306@item
2994David Huenemoerder <dph@@space.mit.edu> 3307David Huenemoerder <dph__at__space.mit.edu>
2995@item 3308@item
2996Kevin Ivory <Kevin.Ivory@@linmpi.mpg.de> 3309Kevin Ivory <Kevin.Ivory__at__linmpi.mpg.de>
2997@item 3310@item
2998Dick Jackson <dick@@d-jackson.com> 3311Dick Jackson <dick__at__d-jackson.com>
2999@item 3312@item
3000Xuyong Liu <liu@@stsci.edu> 3313Xuyong Liu <liu__at__stsci.edu>
3001@item 3314@item
3002Simon Marshall <Simon.Marshall@@esrin.esa.it> 3315Simon Marshall <Simon.Marshall__at__esrin.esa.it>
3003@item 3316@item
3004Craig Markwardt <craigm@@cow.physics.wisc.edu> 3317Craig Markwardt <craigm__at__cow.physics.wisc.edu>
3005@item 3318@item
3006Laurent Mugnier <mugnier@@onera.fr> 3319Laurent Mugnier <mugnier__at__onera.fr>
3007@item 3320@item
3008Lubos Pochman <lubos@@rsinc.com> 3321Lubos Pochman <lubos__at__rsinc.com>
3009@item 3322@item
3010Bob Portmann <portmann@@al.noaa.gov> 3323Bob Portmann <portmann__at__al.noaa.gov>
3011@item 3324@item
3012Patrick M. Ryan <pat@@jaameri.gsfc.nasa.gov> 3325Patrick M. Ryan <pat__at__jaameri.gsfc.nasa.gov>
3013@item 3326@item
3014Marty Ryba <ryba@@ll.mit.edu> 3327Marty Ryba <ryba__at__ll.mit.edu>
3015@item 3328@item
3016Phil Williams <williams@@irc.chmcc.org> 3329Phil Williams <williams__at__irc.chmcc.org>
3017@item 3330@item
3018Phil Sterne <sterne@@dublin.llnl.gov> 3331Phil Sterne <sterne__at__dublin.llnl.gov>
3332@item
3333Paul Sorenson <aardvark62__at__msn.com>
3019@end itemize 3334@end itemize
3020 3335
3021@noindent 3336@noindent
3022Thanks to everyone! 3337Thanks to everyone!
3023 3338
3024@node Sources of Routine Info, Configuration Examples, Acknowledgements, Top 3339@node Sources of Routine Info, HTML Help Browser Tips, Acknowledgements, Top
3025@appendix Sources of Routine Info 3340@appendix Sources of Routine Info
3026 3341
3027@cindex Sources of routine information 3342@cindex Sources of routine information
@@ -3033,7 +3348,7 @@ know about the accessible routines.
3033@menu 3348@menu
3034* Routine Definitions:: Where IDL Routines are defined. 3349* Routine Definitions:: Where IDL Routines are defined.
3035* Routine Information Sources:: So how does IDLWAVE know about... 3350* Routine Information Sources:: So how does IDLWAVE know about...
3036* Library Catalog:: Scanning the Libraries for Routine Info 3351* Catalogs::
3037* Load-Path Shadows:: Routines defined in several places 3352* Load-Path Shadows:: Routines defined in several places
3038* Documentation Scan:: Scanning the IDL Manuals 3353* Documentation Scan:: Scanning the IDL Manuals
3039@end menu 3354@end menu
@@ -3051,14 +3366,14 @@ know about the accessible routines.
3051several places: 3366several places:
3052 3367
3053@enumerate 3368@enumerate
3054@item 3369@item
3055@emph{Builtin routines} are defined inside IDL itself. The source 3370@emph{Builtin routines} are defined inside IDL itself. The source
3056code of such routines is not available. 3371code of such routines is not available.
3057@item 3372@item
3058Routines which are @emph{part of the current program}, are defined in a 3373Routines which are @emph{part of the current program}, are defined in a
3059file explicitly compiled by the user. This file may or may not be 3374file explicitly compiled by the user. This file may or may not be
3060located on the IDL search path. 3375located on the IDL search path.
3061@item 3376@item
3062@emph{Library routines} are defined in files located on IDL's search 3377@emph{Library routines} are defined in files located on IDL's search
3063path, and will not need to be manually compiled. When a library routine 3378path, and will not need to be manually compiled. When a library routine
3064is called for the first time, IDL will find the source file and compile 3379is called for the first time, IDL will find the source file and compile
@@ -3072,7 +3387,7 @@ or included as dynamically loaded modules (DLMs). Currently IDLWAVE
3072cannot provide routine info and completion for such external routines. 3387cannot provide routine info and completion for such external routines.
3073@end enumerate 3388@end enumerate
3074 3389
3075@node Routine Information Sources, Library Catalog, Routine Definitions, Sources of Routine Info 3390@node Routine Information Sources, Catalogs, Routine Definitions, Sources of Routine Info
3076@appendixsec Routine Information Sources 3391@appendixsec Routine Information Sources
3077@cindex Routine info sources 3392@cindex Routine info sources
3078@cindex Builtin list of routines 3393@cindex Builtin list of routines
@@ -3087,21 +3402,21 @@ routines on a system, IDLWAVE collects data from many sources:
3087@enumerate 3402@enumerate
3088 3403
3089@item 3404@item
3090It has a @emph{builtin list} with the properties of the builtin IDL 3405It has a @emph{builtin list} with information about the routines IDL
3091routines. IDLWAVE @value{VERSION} is distributed with a list of 3406ships with. IDLWAVE @value{VERSION} is distributed with a list of
3092@value{NSYSROUTINES} routines and @value{NSYSKEYWORDS} keywords, 3407@value{NSYSROUTINES} routines and @value{NSYSKEYWORDS} keywords,
3093reflecting IDL version @value{IDLVERSION}. This list has been created 3408reflecting IDL version @value{IDLVERSION}. This list has been created
3094by scanning the IDL manuals and is stored in the file 3409by scanning the IDL manuals and is stored in the file
3095@file{idlw-rinfo.el}. @xref{Documentation Scan}, for information on how 3410@file{idlw-rinfo.el}. @xref{Documentation Scan}, for information on
3096to regenerate this file for new versions of IDL. 3411how to regenerate this file for new versions of IDL.
3097 3412
3098@item 3413@item
3099It @emph{scans} all @emph{buffers} of the current Emacs session for 3414It @emph{scans} all @emph{buffers} of the current Emacs session for
3100routine definitions. This is done automatically when routine 3415routine definitions. This is done automatically when routine
3101information or completion is first requested by the user. Each new 3416information or completion is first requested by the user. Each new
3102buffer and each buffer which is saved after making changes is also 3417buffer and each buffer saved after making changes is also scanned. The
3103scanned. The command @kbd{C-c C-i} (@code{idlwave-update-routine-info}) 3418command @kbd{C-c C-i} (@code{idlwave-update-routine-info}) can be used
3104can be used at any time to rescan all buffers. 3419at any time to rescan all buffers.
3105 3420
3106@item 3421@item
3107If you have an IDLWAVE-Shell running in the Emacs session, IDLWAVE will 3422If you have an IDLWAVE-Shell running in the Emacs session, IDLWAVE will
@@ -3113,19 +3428,28 @@ requested by the user, and each time an Emacs buffer is compiled with
3113routine data. 3428routine data.
3114 3429
3115@item 3430@item
3116IDLWAVE can scan all or selected library source files and store the 3431Many popular libraries are distributed with routine information
3117result in a file which will be automatically loaded just like 3432already scanned into @emph{library catalogs} (@pxref{Library
3118@file{idlw-rinfo.el}. @xref{Library Catalog}, for information how to 3433Catalogs}). These per-directory catalog files can also be built by
3119scan library files. 3434the user with the supplied @file{idlwave_catalog} tool.
3435
3436@item
3437IDLWAVE can scan selected directories of source files and store the
3438result in a single @emph{user catalog} file which will be
3439automatically loaded just like @file{idlw-rinfo.el}. @xref{User
3440Catalog}, for information on how to scan files in this way.
3120@end enumerate 3441@end enumerate
3121 3442
3122Loading routine and catalog information is a time consuming process. 3443Loading routine and catalog information can be a time consuming process,
3123Depending on the system and network configuration it can take up to 30 3444especially over slow networks. Depending on the system and network
3124seconds. In order to minimize the waiting time upon your first 3445configuration it could take up to 30 seconds. In order to minimize the
3125completion or routine info command in a session, IDLWAVE uses Emacs idle 3446wait time upon your first completion or routine info command in a
3126time to do the initialization in 5 steps, yielding to user input in 3447session, IDLWAVE uses Emacs idle time to do the initialization in six
3127between. If this gets into your way, set the variable 3448steps, yielding to user input in between. If this gets into your way,
3128@code{idlwave-init-rinfo-when-idle-after} to 0 (zero). 3449set the variable @code{idlwave-init-rinfo-when-idle-after} to 0 (zero).
3450The more routines documented in library and user catalogs, the slower
3451the loading will be, so reducing this number can help alleviate any long
3452load times.
3129 3453
3130@defopt idlwave-init-rinfo-when-idle-after (@code{10}) 3454@defopt idlwave-init-rinfo-when-idle-after (@code{10})
3131Seconds of idle time before routine info is automatically initialized. 3455Seconds of idle time before routine info is automatically initialized.
@@ -3144,82 +3468,199 @@ Non-@code{nil} means query the shell for info about compiled routines.
3144Controls under what circumstances routine info is updated automatically. 3468Controls under what circumstances routine info is updated automatically.
3145@end defopt 3469@end defopt
3146 3470
3147@node Library Catalog, Load-Path Shadows, Routine Information Sources, Sources of Routine Info 3471@ifhtml
3148@appendixsec Library Catalog 3472<A NAME="CATALOGS"></A>
3149@cindex Library scan 3473@end ifhtml
3150@cindex Library catalog 3474@node Catalogs, Load-Path Shadows, Routine Information Sources, Sources of Routine Info
3475@appendixsec Catalogs
3476@cindex Catalogs
3477
3478@emph{Catalogs} are files containing scanned information on individual
3479routines, including arguments and keywords, calling sequence, file path,
3480class and procedure vs. function type, etc. They represent a way of
3481extending the internal built-in information available for IDL system
3482routines (@pxref{Routine Info}) to other source collections.
3483
3484Starting with version 5.0, there are two types of catalogs available
3485with IDLWAVE. The traditional @emph{user catalog} and the newer
3486@emph{library catalogs}. Although they can be used interchangeably, the
3487library catalogs are more flexible, and preferred. There are few
3488occasions when a user catalog might be preferred --- read below. Both
3489types of catalogs can coexist without causing problems.
3490
3491To facilitate the catalog systems, IDLWAVE stores information it gathers
3492from the shell about the IDL search paths, and can write this
3493information out automatically, or on-demand (menu @code{Debug->Save Path
3494Info}). On systems with no shell from which to discover the path
3495information (e.g. Windows), a library path must be specified in
3496@code{idlwave-library-path} to allow library catalogs to be located, and
3497to setup directories for user catalog scan (@pxref{User Catalog} for
3498more on this variable).
3499
3500@defopt idlwave-auto-write-path (@code{t})
3501Write out information on the !PATH and !DIR paths from IDL automatically
3502when they change and when the Shell is closed. These paths are needed
3503to locate library catalogs.
3504@end defopt
3505
3506@defopt idlwave-library-path
3507IDL library path for Windows and MacOS. Not needed under Unix/MacOSX.
3508@end defopt
3509
3510@defopt idlwave-system-directory
3511The IDL system directory for Windows and MacOS. Not needed under
3512Unix/MacOSX (obtained from the Shell).
3513@end defopt
3514
3515@defopt idlwave-config-directory (@file{~/.idlwave})
3516Default path where IDLWAVE saves configuration information and any
3517user catalog.
3518@end defopt
3519
3520@menu
3521* Library Catalogs::
3522* User Catalog::
3523@end menu
3524
3525@ifhtml
3526<A NAME="LIBRARY_CATALOGS"></A>
3527@end ifhtml
3528@node Library Catalogs, User Catalog, Catalogs, Catalogs
3529@appendixsubsec Library Catalogs
3530@cindex @file{.idlwave_catalog}
3531@cindex Library catalogs
3532@cindex @code{idlwave_catalog}
3533
3534Library catalogs are files named @file{.idlwave_catalog} stored in
3535directories containing @code{.pro} routine files. They are discovered
3536on the IDL search path and loaded automatically when routine information
3537is read. Each catalog file documents the routines found in that
3538directory --- one catalog per directory. Every catalog has a library
3539name associated with it (e.g. @emph{AstroLib}). This name will be shown
3540briefly when the catalog is found, and in the routine info of routines
3541it documents.
3542
3543Many popular libraries of routines are shipped with IDLWAVE catalog
3544files by default, and so will be automatically discovered. Library
3545catalogs are scanned externally to Emacs using a tool provided with
3546IDLWAVE. Each catalog can be re-scanned independently of any other.
3547Catalogs can easily be made available system-wide with a common source
3548repository, providing uniform routine information, and lifting the
3549burden of scanning from the user (who may not even know they're using a
3550scanned catalog). Since all catalogs are independent, they can be
3551re-scanned automatically to gather updates, e.g. in a @file{cron} job.
3552Scanning is much faster than with the built-in user catalog method. One
3553minor disadvantage: the entire IDL search path is scanned for catalog
3554files every time IDLWAVE starts up, which might be slow over a network.
3555
3556A Perl tool to create library catalogs is distributed with IDLWAVE:
3557@code{idlwave_catalog}. It can be called quite simply:
3558@example
3559idlwave_catalog MyLib
3560@end example
3561
3562@noindent This would scan all directories recursively beneath the current and
3563populate them with @file{.idlwave_catalog} files, tagging the routines
3564found with the name library ``MyLib''. The full usage information:
3565
3566@example
3567Usage: idlwave_catalog [-l] [-v] [-d] [-s] [-f] [-h] libname
3568 libname - Unique name of the catalog (4 or more alphanumeric
3569 characters).
3570 -l - Scan local directory only, otherwise recursively
3571 catalog all directories at or beneath this one.
3572 -v - Print verbose information.
3573 -d - Instead of scanning, delete all .idlwave_catalog files
3574 here or below.
3575 -s - Be silent.
3576 -f - Force overwriting any catalogs found with a different
3577 library name.
3578 -h - Print this usage.
3579@end example
3580
3581To re-load the library catalogs on the IDL path, force a system routine
3582info update using a single prefix to @code{idlwave-update-routine-info}:
3583@kbd{C-u C-c C-i}.
3584
3585@defopt idlwave-use-library-catalogs (@code{t})
3586Whether to search for and load library catalogs. Only disable if
3587performance is a problem and the catalogs are not needed.
3588@end defopt
3589
3590@node User Catalog, , Library Catalogs, Catalogs
3591@appendixsubsec User Catalog
3592@cindex User catalog
3151@cindex IDL library routine info 3593@cindex IDL library routine info
3152@cindex Windows 3594@cindex Windows
3153@cindex MacOS 3595@cindex MacOS
3154@cindex IDL variable @code{!DIR} 3596@cindex IDL variable @code{!DIR}
3155@cindex @code{!DIR}, IDL variable 3597@cindex @code{!DIR}, IDL variable
3156 3598
3599The user catalog is the old routine catalog system. It is produced
3600within Emacs, and stored in a single file in the user's home directory
3601(@file{.idlwave/idlusercat.el} by default). Although library catalogs
3602are more flexible, there may be reasons to prefer a user catalog
3603instead, including:
3604
3605@itemize @bullet
3606@item The scan is internal to Emacs, so you don't need a working Perl
3607installation, as you do for library catalogs.
3608@item Can be used to scan directories for which the user has no write
3609privileges.
3610@item Easy widget-based path selection.
3611@end itemize
3612
3613However, no routine info is available in the user catalog by default;
3614the user must actively complete a scan. In addition, this type of
3615catalog is all or nothing: if a single routine changes, the entire
3616catalog must be rescanned to update it. Creating the user catalog is
3617also much slower than scanning library catalogs.
3157 3618
3158IDLWAVE can extract routine information from library modules and store 3619You can scan any of the directories on the currently known path. Under
3159that information in a file. To do this, the variable 3620Windows and MacOS (not OSX), you need to specify the IDL search path in
3160@code{idlwave-libinfo-file} needs to contain the path to a file in an 3621the variable @code{idlwave-library-path}, and the location of the IDL
3161existing directory (the default is @code{"~/.idlcat.el"}). Since the 3622directory (the value of the @code{!DIR} system variable) in the variable
3162file will contain lisp code, its name should end in @file{.el}. Under 3623@code{idlwave-system-directory}, like this@footnote{The initial @samp{+}
3163Windows and MacOS, you also need to specify the search path for IDL 3624leads to recursive expansion of the path, just like in IDL}:
3164library files in the variable @code{idlwave-library-path}, and the
3165location of the IDL directory (the value of the @code{!DIR} system
3166variable) in the variable @code{idlwave-system-directory}, like
3167this@footnote{The initial @samp{+} leads to recursive expansion of the
3168path, just like in IDL}:
3169 3625
3170@lisp 3626@lisp
3171(setq idlwave-library-path 3627(setq idlwave-library-path
3172 '("+c:/RSI/IDL54/lib/" "+c:/user/me/idllibs" )) 3628 '("+c:/RSI/IDL56/lib/" "+c:/user/me/idllibs"))
3173(setq idlwave-system-directory "c:/RSI/IDL54/") 3629(setq idlwave-system-directory "c:/RSI/IDL56/")
3174@end lisp 3630@end lisp
3175 3631
3176@noindent Under GNU and UNIX, these values will be automatically inferred from 3632@noindent Under GNU and UNIX, these values will be automatically gathered from
3177an IDLWAVE shell. 3633the IDLWAVE shell.
3178 3634
3179The command @kbd{M-x idlwave-create-libinfo-file} can then be used to 3635The command @kbd{M-x idlwave-create-user-catalog-file} (or the menu item
3180scan library files. It brings up a widget in which you can select some 3636@samp{IDLWAVE->Routine Info->Select Catalog Directories} can then be
3181or all directories on the search path. If you only want to have routine 3637used to create a user catalog. It brings up a widget in which you can
3182and completion info of some libraries, it is sufficient to scan those 3638select some or all directories on the search path. Directories which
3183directories. However, if you want IDLWAVE to detect possible name 3639already contain a library catalog are marked with @samp{[LIB]}, and need
3184conflicts with routines defined in other libraries, the whole pass 3640not be scanned (although there is no harm if you do so, other than the
3185should be scanned. 3641additional memory used for the duplication).
3186 3642
3187After selecting directories, click on the @w{@samp{[Scan & Save]}} 3643After selecting directories, click on the @w{@samp{[Scan & Save]}}
3188button in the widget to scan all files in the selected directories and 3644button in the widget to scan all files in the selected directories and
3189write the resulting routine information into the file 3645write out the resulting routine information. In order to update the
3190@code{idlwave-libinfo-file}. In order to update the library information 3646library information using the directory selection, call the command
3191from the same directories, call the command
3192@code{idlwave-update-routine-info} with a double prefix argument: 3647@code{idlwave-update-routine-info} with a double prefix argument:
3193@w{@kbd{C-u C-u C-c C-i}}. This will rescan files in the previously 3648@w{@kbd{C-u C-u C-c C-i}}. This will rescan files in the previously
3194selected directories, write an updated version of the libinfo file and 3649selected directories, write an updated version of the user catalog file
3195rebuild IDLWAVE's internal lists. If you give three prefix arguments 3650and rebuild IDLWAVE's internal lists. If you give three prefix
3196@w{@kbd{C-u C-u C-u C-c C-i}}, updating will be done with a background 3651arguments @w{@kbd{C-u C-u C-u C-c C-i}}, updating will be done with a
3197job@footnote{Unix systems only, I think.}. You can continue to work, 3652background job@footnote{Unix systems only, I think.}. You can continue
3198and the library catalog will be re-read when it is ready. 3653to work, and the library catalog will be re-read when it is ready. If
3199 3654you find you need to update the user catalog often, you should consider
3200A note of caution: Depending on your local installation, the IDL 3655building a library catalog for your routines instead (@pxref{Library
3201library can be very large. Parsing it for routine information will take 3656Catalogs}).
3202time and loading this information into Emacs can require a
3203significant amount of memory. However, having this information
3204available will be a great help.
3205
3206@defopt idlwave-libinfo-file
3207File for routine information of the IDL library.
3208@end defopt
3209
3210@defopt idlwave-library-path
3211IDL library path for Windows and MacOS. Not needed under Unix.
3212@end defopt
3213
3214@defopt idlwave-system-directory
3215The IDL system directory for Windows and MacOS. Not needed under Unix.
3216@end defopt
3217 3657
3218@defopt idlwave-special-lib-alist 3658@defopt idlwave-special-lib-alist
3219Alist of regular expressions matching special library directories. 3659Alist of regular expressions matching special library directories for
3660labeling in routine-info display.
3220@end defopt 3661@end defopt
3221 3662
3222@node Load-Path Shadows, Documentation Scan, Library Catalog, Sources of Routine Info 3663@node Load-Path Shadows, Documentation Scan, Catalogs, Sources of Routine Info
3223@appendixsec Load-Path Shadows 3664@appendixsec Load-Path Shadows
3224@cindex Load-path shadows 3665@cindex Load-path shadows
3225@cindex Shadows, load-path 3666@cindex Shadows, load-path
@@ -3229,18 +3670,19 @@ Alist of regular expressions matching special library directories.
3229@cindex Application, testing for shadowing 3670@cindex Application, testing for shadowing
3230@cindex Buffer, testing for shadowing 3671@cindex Buffer, testing for shadowing
3231 3672
3232IDLWAVE can compile a list of routines which are defined in several 3673IDLWAVE can compile a list of routines which are (re-)defined in more
3233different files. Since one definition will hide (shadow) the others 3674than one file. Since one definition will hide (shadow) the others
3234depending on which file is compiled first, such multiple definitions are 3675depending on which file is compiled first, such multiple definitions are
3235called "load-path shadows". IDLWAVE has several routines to scan for 3676called "load-path shadows". IDLWAVE has several routines to scan for
3236load path shadows. The output is placed into the special buffer 3677load path shadows. The output is placed into the special buffer
3237@file{*Shadows*}. The format of the output is identical to the source 3678@file{*Shadows*}. The format of the output is identical to the source
3238section of the routine info buffer (@pxref{Routine Info}). The 3679section of the routine info buffer (@pxref{Routine Info}). The
3239different definitions of a routine are listed in the sequence of 3680different definitions of a routine are ordered by @emph{likelihood of
3240@emph{likelihood of use}. So the first entry will be most likely the 3681use}. So the first entry will be most likely the one you'll get if an
3241one you'll get if an unsuspecting command uses that routine. Before 3682unsuspecting command uses that routine. Before listing shadows, you
3242listing shadows, you should make sure that routine info is up-to-date by 3683should make sure that routine info is up-to-date by pressing @kbd{C-c
3243pressing @kbd{C-c C-i}. Here are the different routines: 3684C-i}. Here are the different routines (also available in the Menu
3685@samp{IDLWAVE->Routine Info}):
3244 3686
3245@table @asis 3687@table @asis
3246@item @kbd{M-x idlwave-list-buffer-load-path-shadows} 3688@item @kbd{M-x idlwave-list-buffer-load-path-shadows}
@@ -3257,9 +3699,9 @@ then check for shadowing.
3257This command checks all routines accessible to IDLWAVE for conflicts. 3699This command checks all routines accessible to IDLWAVE for conflicts.
3258@end table 3700@end table
3259 3701
3260For these commands to work properly you should have scanned the entire 3702For these commands to work fully you need to scan the entire load path
3261load path, not just selected directories. Also, IDLWAVE should be able 3703in either a user or library catalog. Also, IDLWAVE should be able to
3262to distinguish between the system library files (normally installed in 3704distinguish between the system library files (normally installed in
3263@file{/usr/local/rsi/idl/lib}) and any site specific or user specific 3705@file{/usr/local/rsi/idl/lib}) and any site specific or user specific
3264files. Therefore, such local files should not be installed inside the 3706files. Therefore, such local files should not be installed inside the
3265@file{lib} directory of the IDL directory. This is also advisable for 3707@file{lib} directory of the IDL directory. This is also advisable for
@@ -3279,37 +3721,108 @@ Another way to find out if a specific routine has multiple definitions
3279on the load path is routine info display (@pxref{Routine Info}). 3721on the load path is routine info display (@pxref{Routine Info}).
3280 3722
3281@node Documentation Scan, , Load-Path Shadows, Sources of Routine Info 3723@node Documentation Scan, , Load-Path Shadows, Sources of Routine Info
3282@appendixsec Documentation Scan 3724@appendixsec Documentation Scan
3283@cindex @file{get_rinfo} 3725@cindex @file{get_html_rinfo}
3284@cindex @file{idlw-rinfo.el} 3726@cindex @file{idlw-rinfo.el}
3285@cindex @file{idlw-help.txt}
3286@cindex @file{idlw-help.el}
3287@cindex Scanning the documentation 3727@cindex Scanning the documentation
3288@cindex Perl program, to create @file{idlw-rinfo.el} 3728@cindex Perl program, to create @file{idlw-rinfo.el}
3289 3729
3290IDLWAVE derives it knowledge about system routines from the IDL 3730IDLWAVE derives its knowledge about system routines from the IDL
3291manuals. The file @file{idlw-rinfo.el} contains the routine information 3731manuals. The file @file{idlw-rinfo.el} contains the routine information
3292for the IDL system routines. The Online Help feature of IDLWAVE 3732for the IDL system routines, and links to relevant sections of the HTML
3293requires ASCII versions of some IDL manuals to be available in a 3733documentation. The Online Help feature of IDLWAVE requires HTML
3294specific format (@file{idlw-help.txt}), along with an Emacs-Lisp file 3734versions of the IDL manuals to be available; the HTML documentation is
3295@file{idlw-help.el} with supporting code and pointers to the ASCII file. 3735not distributed with IDLWAVE by default, but must be downloaded
3296 3736separately from the @uref{@value{IDLWAVE-HOMEPAGE}, the maintainers
3297All 3 files can be derived from the IDL documentation. If you are 3737webpage}.
3298lucky, the maintainer of IDLWAVE will always have access to the newest 3738
3299version of IDL and provide updates. The IDLWAVE distribution also 3739The HTML files and related images can be produced from the
3300contains the Perl program @file{get_rinfo} which constructs these files 3740@file{idl.chm} HTMLHelp file distributed with IDL using the free
3301by scanning selected files from the IDL documentation. Instructions on 3741Microsoft HTML Help Workshop. If you are lucky, the maintainer of
3302how to use @file{get_rinfo} are in the program itself. 3742IDLWAVE will always have access to the newest version of IDL and
3303 3743provide updates. The IDLWAVE distribution also contains the Perl
3304One particularly frustrating situation occurs when a new IDL version is 3744program @file{get_html_rinfo} which constructs the
3305released without the associated documentation updates. Instead, a 3745@file{idlw-rinfo.el} file by scanning the HTML documents produced from
3306@emph{What's New} file containing new and updated documentation is 3746the IDL documentation. Instructions on how to use
3307shipped alongside the previous version's reference material. The 3747@file{get_html_rinfo} are in the program itself.
3308@file{get_rinfo} script can merge this new information into the standard 3748
3309help text and routine information, as long as it is pre-formatted in a 3749@node HTML Help Browser Tips, Configuration Examples, Sources of Routine Info, Top
3310simple way. See @file{get_rinfo} for more information. 3750@appendix HTML Help Browser Tips
3311 3751@cindex Browser Tips
3312@node Configuration Examples, Windows and MacOS, Sources of Routine Info, Top 3752
3753There are a wide variety of possible browsers to use for displaying
3754the online HTML help available with IDLWAVE (starting with version
37555.0). Since IDLWAVE runs on a many different system types, a single
3756browser configuration is not possible, but choices abound.
3757
3758On many systems, the default browser configured in
3759@code{browse-url-browser-function}, and hence inherited by default by
3760@code{idlwave-help-browser-function}, is Netscape. Unfortunately, the
3761HTML manuals decompiled from the original RSI source contain
3762formatting structures which Netscape 4.x does not handle well, though
3763they are still readable. A much better choice is Mozilla, or one of
3764the Mozilla-derived browsers such as
3765@uref{http://galeon.sourceforge.net/,Galeon} (Linux),
3766@uref{http://www.mozilla.org/projects/camino/,Camino} (MacOSX), or
3767@uref{http://www.mozilla.org/projects/firebird/,Firebird} (all
3768platforms). Newer versions of Emacs provide a browser-function choice
3769@code{browse-url-gnome-moz} which uses the Gnome-configured browser.
3770
3771Note that the HTML files decompiled from RSI Microsoft Help sources
3772contain specific references to the @samp{Symbol} font, which by default
3773is not permitted in normal encodings (it's technically illegal). Though
3774it only impacts a few symbols, you can trick Mozilla-based browsers into
3775recognizing @samp{Symbol} by following the directions
3776@uref{http://hutchinson.belmont.ma.us/tth/Xfonts.html, here}. With this
3777fix in place, HTML help pages look almost identical to their PDF
3778equivalents (yet can be bookmarked, browsed as history, searched, etc.).
3779
3780@noindent Individual platform recommendations:
3781
3782@itemize @bullet
3783@item Windows: The native Microsoft HTMLHelp browser is preferred,
3784with even better results using the free
3785@uref{http://www.keyworks.net/keyhh.htm,@code{KEYHH}} program to
3786permit IDL help to be targetted to a single window. To use HTMLHelp,
3787specify @code{idlwave-help-use-hh} as @code{'hh} or @code{'keyhh}.
3788One bonus: since IDL is shipped with the @file{idl.chm} help file, you
3789don't need to download the HTML help package. @xref{Help with HTML
3790Documentation}.
3791@item Unix/MacOSX: The @uref{http://www.w3m.org,@code{w3m}} browser
3792and its associated
3793@uref{http://emacs-w3m.namazu.org/,@code{emacs-w3m}} emacs mode
3794provide in-buffer browsing with image display, and excellent speed and
3795formatting. Both the Emacs mode and the browser itself must be
3796downloaded separately. To use this browser, include
3797
3798@lisp
3799(setq idlwave-help-browser-function 'w3m-browse-url)
3800@end lisp
3801
3802in your @file{.emacs}. Setting a few other nice @code{w3m} options
3803cuts down on screen clutter:
3804
3805@lisp
3806(setq w3m-use-tab nil
3807 w3m-use-header-line nil
3808 w3m-use-toolbar nil)
3809@end lisp
3810
3811If you use a dedicated frame for help, you might want to add the
3812following, to get consistent behavior with the @kbd{q} key:
3813
3814@lisp
3815;; Close my help window when w3m closes.
3816(defadvice w3m-close-window (after idlwave-close activate)
3817 (if (boundp 'idlwave-help-frame)
3818 (idlwave-help-quit)))
3819@end lisp
3820
3821Note that you can open the file in an external browser from within
3822@code{w3m} using @kbd{M}.
3823@end itemize
3824
3825@node Configuration Examples, Windows and MacOS, HTML Help Browser Tips, Top
3313@appendix Configuration Examples 3826@appendix Configuration Examples
3314@cindex Configuration examples 3827@cindex Configuration examples
3315@cindex Example configuration 3828@cindex Example configuration
@@ -3370,7 +3883,7 @@ user is King!
3370(setq idlwave-main-block-indent 3) 3883(setq idlwave-main-block-indent 3)
3371(setq idlwave-end-offset -3) 3884(setq idlwave-end-offset -3)
3372(setq idlwave-continuation-indent 1) 3885(setq idlwave-continuation-indent 1)
3373(setq idlwave-begin-line-comment "^;[^;]") ; Leave ";" but not ";;" 3886(setq idlwave-begin-line-comment "^;[^;]") ; Leave ";" but not ";;"
3374 ; anchored at start of line. 3887 ; anchored at start of line.
3375(setq idlwave-surround-by-blank t) ; Turn on padding ops =,<,> 3888(setq idlwave-surround-by-blank t) ; Turn on padding ops =,<,>
3376(setq idlwave-pad-keyword nil) ; Remove spaces for keyword '=' 3889(setq idlwave-pad-keyword nil) ; Remove spaces for keyword '='
@@ -3388,6 +3901,18 @@ user is King!
3388 ("SETPROPERTY" .t) 3901 ("SETPROPERTY" .t)
3389 ("GETPROPERTY" .t))) 3902 ("GETPROPERTY" .t)))
3390 3903
3904;; Using w3m for help (must install w3m and emacs-w3m)
3905(autoload 'w3m-browse-url "w3m" "Interface for w3m on Emacs." t)
3906(setq idlwave-help-browser-function 'w3m-browse-url
3907 w3m-use-tab nil ; no tabs, location line, or toolbar
3908 w3m-use-header-line nil
3909 w3m-use-toolbar nil)
3910
3911;; Close my help window or frame when w3m closes with `q'
3912(defadvice w3m-close-window (after idlwave-close activate)
3913 (if (boundp 'idlwave-help-frame)
3914 (idlwave-help-quit)))
3915
3391;; Some setting can only be done from a mode hook. Here is an example: 3916;; Some setting can only be done from a mode hook. Here is an example:
3392(add-hook 'idlwave-mode-hook 3917(add-hook 'idlwave-mode-hook
3393 (lambda () 3918 (lambda ()
@@ -3395,6 +3920,7 @@ user is King!
3395 ;; Run other functions here 3920 ;; Run other functions here
3396 (font-lock-mode 1) ; Turn on font-lock mode 3921 (font-lock-mode 1) ; Turn on font-lock mode
3397 (idlwave-auto-fill-mode 0) ; Turn off auto filling 3922 (idlwave-auto-fill-mode 0) ; Turn off auto filling
3923 (setq idlwave-help-browser-function 'browse-url-w3)
3398 3924
3399 ;; Pad with 1 space (if -n is used then make the 3925 ;; Pad with 1 space (if -n is used then make the
3400 ;; padding a minimum of n spaces.) The defaults use -1 3926 ;; padding a minimum of n spaces.) The defaults use -1
@@ -3424,10 +3950,10 @@ user is King!
3424 ;; (local-set-key "\C-j" 'idlwave-newline) ; My preference. 3950 ;; (local-set-key "\C-j" 'idlwave-newline) ; My preference.
3425 3951
3426 ;; Some personal abbreviations 3952 ;; Some personal abbreviations
3427 (define-abbrev idlwave-mode-abbrev-table 3953 (define-abbrev idlwave-mode-abbrev-table
3428 (concat idlwave-abbrev-start-char "wb") "widget_base()" 3954 (concat idlwave-abbrev-start-char "wb") "widget_base()"
3429 (idlwave-keyword-abbrev 1)) 3955 (idlwave-keyword-abbrev 1))
3430 (define-abbrev idlwave-mode-abbrev-table 3956 (define-abbrev idlwave-mode-abbrev-table
3431 (concat idlwave-abbrev-start-char "on") "obj_new()" 3957 (concat idlwave-abbrev-start-char "on") "obj_new()"
3432 (idlwave-keyword-abbrev 1)) 3958 (idlwave-keyword-abbrev 1))
3433 )) 3959 ))
@@ -3445,12 +3971,12 @@ user is King!
3445(add-hook 'idlwave-shell-mode-hook 3971(add-hook 'idlwave-shell-mode-hook
3446 (lambda () 3972 (lambda ()
3447 ;; Set up some custom key and mouse examine commands 3973 ;; Set up some custom key and mouse examine commands
3448 (idlwave-shell-define-key-both [s-down-mouse-2] 3974 (idlwave-shell-define-key-both [s-down-mouse-2]
3449 (idlwave-shell-mouse-examine 3975 (idlwave-shell-mouse-examine
3450 "print, size(___,/DIMENSIONS)")) 3976 "print, size(___,/DIMENSIONS)"))
3451 (idlwave-shell-define-key-both [f9] (idlwave-shell-examine 3977 (idlwave-shell-define-key-both [f9] (idlwave-shell-examine
3452 "print, size(___,/DIMENSIONS)")) 3978 "print, size(___,/DIMENSIONS)"))
3453 (idlwave-shell-define-key-both [f10] (idlwave-shell-examine 3979 (idlwave-shell-define-key-both [f10] (idlwave-shell-examine
3454 "print,size(___,/TNAME)")) 3980 "print,size(___,/TNAME)"))
3455 (idlwave-shell-define-key-both [f11] (idlwave-shell-examine 3981 (idlwave-shell-define-key-both [f11] (idlwave-shell-examine
3456 "help,___,/STRUCTURE")))) 3982 "help,___,/STRUCTURE"))))
@@ -3459,27 +3985,28 @@ user is King!
3459@ifhtml 3985@ifhtml
3460<A NAME="WIN_MAC"></A> 3986<A NAME="WIN_MAC"></A>
3461@end ifhtml 3987@end ifhtml
3462@node Windows and MacOS, Index, Configuration Examples, Top 3988@node Windows and MacOS, Troubleshooting, Configuration Examples, Top
3463@appendix Windows and MacOS 3989@appendix Windows and MacOS
3464@cindex Windows 3990@cindex Windows
3465@cindex MacOS 3991@cindex MacOS
3992@cindex MacOSX
3466 3993
3467IDLWAVE was developed on a UNIX system. However, due to the portability 3994IDLWAVE was developed on a UNIX system. However, thanks to the
3468of Emacs, much of IDLWAVE does also work under different operating 3995portability of Emacs, much of IDLWAVE does also work under different
3469systems like Windows (with NTEmacs or NTXEmacs) or MacOS. 3996operating systems like Windows (with NTEmacs or NTXEmacs) or MacOS.
3470 3997
3471The only problem really is that RSI does not provide a command-line 3998The only real problem is that RSI does not provide a command-line
3472version of IDL for Windows or MacOS with which IDLWAVE can 3999version of IDL for Windows or MacOS(<=9) with which IDLWAVE can
3473interact@footnote{Call your RSI representative and complain --- it 4000interact@footnote{Call your RSI representative and complain --- it
3474should be trivial for them to provide one. And if enough people ask 4001should be trivial for them to provide one. And if enough people ask for
3475for it, maybe they will. The upcoming IDL for Mac OSX is slated to 4002it, maybe they will. The new MacOSX version of IDL @emph{does} have a
3476have a command-line version.}. Therefore the IDLWAVE Shell does not 4003shell and works well with IDLWAVE.}. As a result, the IDLWAVE Shell
3477work and you have to rely on IDLDE to run and debug your programs. 4004does not work and you have to rely on IDLDE to run and debug your
3478However, editing IDL source files with Emacs/IDLWAVE works with all 4005programs. However, editing IDL source files with Emacs/IDLWAVE works
3479bells and whistles, including routine info, completion and fast online 4006with all bells and whistles, including routine info, completion and fast
3480help. Only a small amount of additional information must be specified 4007online help. Only a small amount of additional information must be
3481in your .emacs file: the path names which, on a UNIX system, are 4008specified in your @file{.emacs} file: the path names which, on a UNIX
3482automatically gathered by talking to the IDL program. 4009system, are automatically gathered by talking to the IDL program.
3483 4010
3484Here is an example of the additional configuration needed for a Windows 4011Here is an example of the additional configuration needed for a Windows
3485system. I am assuming that IDLWAVE has been installed in 4012system. I am assuming that IDLWAVE has been installed in
@@ -3487,7 +4014,7 @@ system. I am assuming that IDLWAVE has been installed in
3487@w{@samp{C:\RSI\IDL55}}. 4014@w{@samp{C:\RSI\IDL55}}.
3488 4015
3489@lisp 4016@lisp
3490;; location of the lisp files (needed if IDLWAVE is not part of 4017;; location of the lisp files (needed if IDLWAVE is not part of
3491;; the X/Emacs installation) 4018;; the X/Emacs installation)
3492(setq load-path (cons "c:/program files/IDLWAVE" load-path)) 4019(setq load-path (cons "c:/program files/IDLWAVE" load-path))
3493 4020
@@ -3499,37 +4026,214 @@ system. I am assuming that IDLWAVE has been installed in
3499;; location of the IDL system directory (try "print,!DIR") 4026;; location of the IDL system directory (try "print,!DIR")
3500(setq idlwave-system-directory "c:/RSI/IDL55/") 4027(setq idlwave-system-directory "c:/RSI/IDL55/")
3501 4028
3502;; location of the IDLWAVE help files idlw-help.el and idlw-help.txt. 4029;; specify using the HTMLHelp documentation for online help, with the
3503(setq idlwave-help-directory "c:/IDLWAVE") 4030;; KEYHH helper routine (Windows only)
4031(setq idlwave-use-hh 'keyhh)
3504 4032
3505;; file in which to store the user catalog info 4033;; file in which to store the user catalog info
3506(setq idlwave-libinfo-file "c:/IDLWAVE/idlcat.el") 4034(setq idlwave-user-catalog-file "c:/IDLWAVE/idlcat.el")
3507@end lisp 4035@end lisp
3508 4036
3509@noindent Furthermore, Windows sometimes tries to outsmart you --- make 4037@noindent Furthermore, Windows sometimes tries to outsmart you --- make
3510sure you check the following things: 4038sure you check the following things:
3511 4039
3512@itemize @bullet 4040@itemize @bullet
3513@item When you download the IDLWAVE distribution, make sure you save the 4041@item When you download the IDLWAVE distribution, make sure you save the
3514files under the names @file{idlwave.tar.gz} and 4042file under the names @file{idlwave.tar.gz}.
3515@file{idlwave-help-tar.gz}.
3516@item Be sure that your software for untarring/ungzipping is @emph{NOT}
3517doing smart CR/LF conversion (WinZip users will find this in
3518Options:Configuration:Miscellaneous, change the setting, then re-open
3519the archive). This adds one byte per line, throwing off the
3520byte-counts for the help file lookups and defeating fast online help lookup.
3521@item M-TAB switches among running programs --- use Esc-TAB 4043@item M-TAB switches among running programs --- use Esc-TAB
3522instead. 4044instead.
3523@item Other issues as yet unnamed... 4045@item Other issues as yet unnamed...
3524@end itemize 4046@end itemize
3525 4047
4048Windows users who'd like to make use of IDLWAVE's context-aware HTML
4049help can skip the browser and use the HTMLHelp functionality directly.
4050@xref{Help with HTML Documentation}.
4051
4052@ifhtml
4053<A NAME="TROUBLE"></A>
4054@end ifhtml
4055@node Troubleshooting, Index, Windows and MacOS, Top
4056@appendix Troubleshooting
4057@cindex Troubleshooting
4058
4059Although IDLWAVE usually installs and works without difficulty, a few
4060common problems and their solutions are documented below.
4061
4062@enumerate
4063
4064@item @strong{Whenever an IDL error occurs or a breakpoint is hit, I get
4065errors or strange behavior when I try to type anything into some of my
4066IDLWAVE buffers.}
4067
4068This is a @emph{feature}, not an error. You're in @emph{Electric
4069Debug Mode} (@pxref{Electric Debug Mode}). You should see
4070@code{*Debugging*} in the mode-line. The buffer is read-only and all
4071debugging and examination commands are available as single keystrokes;
4072@kbd{C-?} lists these shortcuts. Use @kbd{q} to quit the mode, and
4073customize the variable @code{idlwave-shell-automatic-electric-debug}
4074if you prefer not to enter electric debug on breakpoints@dots{} but
4075you really should try it before you disable it! You can also
4076customize this variable to enter debug mode when errors are
4077encountered too.
4078
4079@item @strong{I get errors like @samp{Searching for program: no such
4080file or directory, idl} when attempting to start the IDL shell.}
4081
4082IDLWAVE needs to know where IDL is in order to run it as a process.
4083By default, it attempts to invoke it simply as @samp{idl}, which
4084presumes such an executable is on your search path. You need to
4085ensure @samp{idl} is on your @samp{$PATH}, or specify the full
4086pathname to the idl program with the variable
4087@code{idlwave-shell-explicit-file-name}. Note that you may need to
4088set your shell search path in two places when running Emacs as an Aqua
4089application with MacOSX; see the next topic.
4090
4091@item @strong{IDLWAVE is disregarding my @samp{IDL_PATH} which I set
4092under MacOSX}
4093
4094If you run Emacs directly as an Aqua application, rather than from the
4095console shell, the environment is set not from your usual shell
4096configuration files (e.g. @file{.cshrc}), but from the file
4097@file{~/.MacOSX/environment.plist}. Either include your path settings
4098there, or start Emacs and IDLWAVE from the shell.
4099
4100@item @strong{I get errors like @samp{Symbol's function is void:
4101overlayp} when trying to start the shell in XEmacs}
4102
4103You don't have the @samp{fsf-compat} package installed, which IDLWAVE
4104needs to run under XEmacs. Install it and, if necessary, insert
4105@code{(require 'overlay)} in your @file{.emacs}.
4106
4107@item @strong{I'm getting errors like @samp{Symbol's value as variable is void:
4108cl-builtin-gethash} on completion or routine info.}
4109
4110This error arises if you upgraded Emacs from 20.x to 21.x without
4111re-installing IDLWAVE. Old Emacs and new Emacs are not byte-compatible
4112in compiled lisp files. Presumably, you kept the original .elc files in
4113place, and this is the source of the error. If you recompile (or just
4114"make; make install") from source, it should resolve this problem.
4115Another option is to recompile the @file{idlw*.el} files by hand using
4116@kbd{M-x byte-compile-file}. Why not take the opportunity to grab the
4117latest IDLWAVE version at @uref{@value{IDLWAVE-HOMEPAGE}, the
4118maintainers webpage}
4119
4120@item @strong{@kbd{M-@key{TAB}} doesn't complete words, it switches
4121windows on my desktop.}
4122
4123Your system is trapping @kbd{M-@key{TAB}} and using it for its own
4124nefarious purposes: Emacs never sees the keystrokes. On many Unix
4125systems, you can reconfigure your window manager to use another key
4126sequence for switching among windows. Another option is to use the
4127equivalent sequence @kbd{@key{ESC}-@key{TAB}}.
4128
4129@item @strong{When stopping at breakpoints or errors, IDLWAVE does not
4130seem to highlight the relevant line in the source.}
4131
4132IDLWAVE scans for error and halt messages and highlights the stop
4133location in the correct file. However, if you've changed the system
4134variable @samp{!ERROR_STATE.MSG_PREFIX}, it is unable to parse these
4135message correctly. Don't do that.
4136
4137@item @strong{IDLWAVE doesn't work correctly when using ENVI.}
4138
4139Though IDLWAVE was not written with ENVI in mind, it works just fine
4140with it, as long as you update the prompt it's looking for (@samp{IDL>
4141} by default). You can do this with the variable
4142@code{idlwave-shell-prompt-pattern} (@pxref{Starting the Shell}), e.g.,
4143in your @file{.emacs}:
4144
4145@lisp
4146(setq idlwave-shell-prompt-pattern "^\\(ENVI\\|IDL\\)> ")
4147@end lisp
4148
4149@item @strong{Attempts to set breakpoints fail: no breakpoint is
4150indicated in the IDLWAVE buffer.}
4151
4152IDL changed its breakpoint reporting format starting with IDLv5.5. The
4153first version of IDLWAVE to support the new format is IDLWAVE v4.10. If
4154you have an older version and are using IDL >v5.5, you need to upgrade,
4155and/or make sure your recent version of IDLWAVE is being found on the
4156Emacs load-path (see the next entry). You can list the version being
4157used with @kbd{C-h v idlwave-mode-version @key{RET}}.
4158
4159@item @strong{I installed a new version of IDLWAVE, but the old
4160version is still being used} or @strong{IDLWAVE works, but when I
4161tried to install the optional modules @file{idlw-roprompt.el} or
4162@file{idlw-complete-structtag}, I get errors like @samp{Cannot open
4163load file}}.
4164
4165The problem is that your Emacs is not finding the version of IDLWAVE you
4166installed. Many Emacsen come with an older bundled copy of IDLWAVE
4167(e.g. v4.7 for Emacs 21.x), which is likely what's being used instead.
4168You need to make sure your Emacs @emph{load-path} contains the directory
4169where IDLWAVE is installed (@file{/usr/local/share/emacs/site-lisp}, by
4170default), @emph{before} Emacs' default search directories. You can
4171accomplish this by putting the following in your @file{.emacs}:
4172
4173@lisp
4174(setq load-path (cons "/usr/local/share/emacs/site-lisp" load-path))
4175@end lisp
4176
4177@noindent You can check on your load-path value using @kbd{C-h v
4178load-path @key{RET}}.
3526 4179
3527@node Index, , Windows and MacOS, Top 4180@item @strong{IDLWAVE is screwing up the formatting of my @file{.idl} files.}
4181
4182Actually, this isn't IDLWAVE at all, but @samp{idl-mode}, an unrelated
4183programming mode for CORBA's Interface Definition Language (you should
4184see @samp{(IDL)}, not @samp{(IDLWAVE)} in the mode-line). One
4185solution: don't name your file @file{.idl}, but rather @file{.pro}.
4186Another solution: make sure @file{.idl} files load IDLWAVE instead of
4187@samp{idl-mode} by adding the following to your @file{.emacs}:
4188
4189@lisp
4190(setcdr (rassoc 'idl-mode auto-mode-alist) 'idlwave-mode)
4191@end lisp
4192
4193@item @strong{The routine info for my local routines is out of date!}
4194
4195IDLWAVE collects routine info from various locations (@pxref{Routine
4196Information Sources}). Routines in files visited in a buffer or
4197compiled in the shell should be up to date. For other routines, the
4198information is only as current as the most recent scan. If you have a
4199rapidly changing set of routines, and you'd like the latest routine
4200information to be available for it, one powerful technique makes use of
4201the library catalog tool, @samp{idlwave_catalog}. Simply add a line to
4202your @samp{cron} file (@samp{crontab -e} will let you edit this on some
4203systems), like this:
4204
4205@example
420645 3 * * 1-5 (cd /path/to/myidllib; /path/to/idlwave_catalog MyLib)
4207@end example
4208
4209@noindent where @samp{MyLib} is the name of your library. This will
4210rescan all @file{.pro} files at or below @file{/path/to/myidllib} every
4211week night at 3:45am. You can even scan site-wide libraries with this
4212method, and the most recent information will be available to all users.
4213
4214@item @strong{All the Greek-font characters in the HTML help are
4215displayed as Latin characters!}
4216
4217Unfortunately, the HTMLHelp files RSI provides attempt to switch to
4218@samp{Symbol} font to display Greek characters, which is not really an
4219permitted method for doing this in HTML. There is a "workaround" for
4220many browsers: @xref{HTML Help Browser Tips}.
4221
4222@item @strong{In the shell, my long commands are truncated at 256 characters!}
4223
4224This actually happens when running IDL in an XTerm as well. There are
4225a couple of work arounds: @code{define_key,/control,'^d'} (e.g. in
4226your @file{$IDL_STARTUP} file) will disable the @samp{EOF} character
4227and give you a 512 character limit. You won't be able to use
4228@key{C-d} to quit the shell, however. Another possibility is
4229@code{!EDIT_INPUT=0}, which gives you an @emph{infinite} limit (OK, a
4230memory-bounded limit), but disables the processing of background
4231widget events (those with @code{/NO_BLOCK} passed to @code{XManager}).
4232
4233@end enumerate
4234
4235@node Index, , Troubleshooting, Top
3528@unnumbered Index 4236@unnumbered Index
3529@printindex cp 4237@printindex cp
3530 4238
3531@bye 4239@bye
3532
3533@ignore
3534 arch-tag: f1d73958-1423-4127-b8aa-f7b953d64492
3535@end ignore