comparison man/idlwave.texi @ 47440:0e5a022947e9

Updated to IDLWAVE version 4.15. See idlwave.org.
author J.D. Smith <jdsmith@as.arizona.edu>
date Thu, 12 Sep 2002 17:24:53 +0000
parents 82d113655734
children 0a70200bde27
comparison
equal deleted inserted replaced
47439:8e23c317f989 47440:0e5a022947e9
7 * IDLWAVE: (idlwave). Major mode and shell for IDL files. 7 * IDLWAVE: (idlwave). Major mode and shell for IDL files.
8 @end direntry 8 @end direntry
9 @synindex ky cp 9 @synindex ky cp
10 @syncodeindex vr cp 10 @syncodeindex vr cp
11 @syncodeindex fn cp 11 @syncodeindex fn cp
12 @set VERSION 4.14 12 @set VERSION 4.15
13 @set EDITION 4.14 13 @set EDITION 4.15
14 @set IDLVERSION 5.5 14 @set IDLVERSION 5.5
15 @set NSYSROUTINES 1322 15 @set NSYSROUTINES 1324
16 @set NSYSKEYWORDS 5952 16 @set NSYSKEYWORDS 6129
17 @set DATE June 2002 17 @set DATE September 2002
18 @set AUTHOR J.D. Smith & Carsten Dominik 18 @set AUTHOR J.D. Smith & Carsten Dominik
19 @set AUTHOR-EMAIL dominik@@astro.uva.nl 19 @set AUTHOR-EMAIL dominik@@astro.uva.nl
20 @set MAINTAINER J.D. Smith 20 @set MAINTAINER J.D. Smith
21 @set MAINTAINER-EMAIL jdsmith@@as.arizona.edu 21 @set MAINTAINER-EMAIL jdsmith@@as.arizona.edu
22 @set IDLWAVE-HOMEPAGE http://idlwave.org/ 22 @set IDLWAVE-HOMEPAGE http://idlwave.org/
143 143
144 Completion 144 Completion
145 145
146 * Case of Completed Words:: CaseOFcomPletedWords 146 * Case of Completed Words:: CaseOFcomPletedWords
147 * Object Method Completion and Class Ambiguity:: obj->Method, what? 147 * Object Method Completion and Class Ambiguity:: obj->Method, what?
148 * Object Method Completion in the Shell::
148 * Class and Keyword Inheritance:: obj->Method, _EXTRA=e 149 * Class and Keyword Inheritance:: obj->Method, _EXTRA=e
149 * Structure Tag Completion:: Completing state.Tag 150 * Structure Tag Completion:: Completing state.Tag
150 151
151 Actions 152 Actions
152 153
153 * Block Boundary Check:: Is the END correct 154 * Block Boundary Check:: Is the END statement correct?
154 * Padding Operators:: Enforcing space around `=' etc 155 * Padding Operators:: Enforcing space around `=' etc
155 * Case Changes:: Enforcing upper case keywords 156 * Case Changes:: Enforcing upper case keywords
156 157
157 The IDLWAVE Shell 158 The IDLWAVE Shell
158 159
159 * Starting the Shell:: How to launch IDL as a subprocess 160 * Starting the Shell:: How to launch IDL as a subprocess
160 * Using the Shell:: Interactively working with the Shell 161 * Using the Shell:: Interactively working with the Shell
161 * Debugging IDL Programs:: Compilation/Debugging 162 * Commands Sent to the Shell::
163 * Debugging IDL Programs::
162 * Examining Variables:: 164 * Examining Variables::
163 * Custom Expression Examination:: 165 * Custom Expression Examination::
164 166
165 Debugging IDL Programs 167 Debugging IDL Programs
166 168
167 * Compiling Programs:: Compiling buffers under the shell 169 * Debug Key Bindings::
168 * Breakpoints and Stepping:: Deciding where to stop and look 170 * Compiling Programs::
169 * Walking the Calling Stack:: From where was this routine called? 171 * Breakpoints and Stepping::
172 * Walking the Calling Stack::
170 173
171 Installation 174 Installation
172 175
173 * Installing IDLWAVE:: How to install the distribution 176 * Installing IDLWAVE:: How to install the distribution
174 * Installing Online Help:: Where to get the additional files needed 177 * Installing Online Help:: Where to get the additional files needed
201 Research Systems, Inc., a Kodak Company}), and for running IDL as an 204 Research Systems, Inc., a Kodak Company}), and for running IDL as an
202 inferior shell@footnote{Note that this package has nothing to do with 205 inferior shell@footnote{Note that this package has nothing to do with
203 the Interface Definition Language, part of the Common Object Request 206 the Interface Definition Language, part of the Common Object Request
204 Broker Architecture (CORBA)}. It can also be used for editing source 207 Broker Architecture (CORBA)}. It can also be used for editing source
205 files for the related WAVE/CL language, but with only limited 208 files for the related WAVE/CL language, but with only limited
206 support. Note that this package has nothing to do with the Interface 209 support.
207 Definition Language, part of the Common Object Request Broker
208 Architecture (CORBA).
209 210
210 IDLWAVE consists of two main parts: a major mode for editing IDL source 211 IDLWAVE consists of two main parts: a major mode for editing IDL source
211 files files (@code{idlwave-mode}) and a mode for running the IDL program 212 files files (@code{idlwave-mode}) and a mode for running the IDL program
212 as an inferior shell (@code{idlwave-shell-mode}). Although one mode can 213 as an inferior shell (@code{idlwave-shell-mode}). Although one mode can
213 be used without the other, both work together closely to form a complete 214 be used without the other, both work together closely to form a complete
221 @item 222 @item
222 Context-sensitive display of calling sequences and keywords for more 223 Context-sensitive display of calling sequences and keywords for more
223 than 1000 native IDL routines, extendible to any number of additional 224 than 1000 native IDL routines, extendible to any number of additional
224 routines in your local IDL libraries. 225 routines in your local IDL libraries.
225 @item 226 @item
226 Name space conflict search, with likelihood ranking. 227 Routine name space conflict search, likelihood-of-use ranking.
227 @item 228 @item
228 Fast, context-sensitive online help. 229 Fast, context-sensitive online help.
229 @item 230 @item
230 Context sensitive completion of routine names and keywords. 231 Context sensitive completion of routine names and keywords.
231 @item 232 @item
368 (setq idlwave-shell-debug-modifiers '(control shift)) 369 (setq idlwave-shell-debug-modifiers '(control shift))
369 ;; Specify the online help files' location. 370 ;; Specify the online help files' location.
370 (setq idlwave-help-directory "~/.idlwave") 371 (setq idlwave-help-directory "~/.idlwave")
371 @end lisp 372 @end lisp
372 373
374 @ifhtml
375 <A NAME="TUTORIAL"></A>
376 @end ifhtml
373 @node Getting Started, The IDLWAVE Major Mode, IDLWAVE in a Nutshell, Top 377 @node Getting Started, The IDLWAVE Major Mode, IDLWAVE in a Nutshell, Top
374 @chapter Getting Started (Tutorial) 378 @chapter Getting Started (Tutorial)
375 @cindex Quick-Start 379 @cindex Quick-Start
376 @cindex Tutorial 380 @cindex Tutorial
377 @cindex Getting Started 381 @cindex Getting Started
748 implementation in C, and liberal borrowing of features of many vector 752 implementation in C, and liberal borrowing of features of many vector
749 languages along its 25+ year history, has inherited an unusual mix of 753 languages along its 25+ year history, has inherited an unusual mix of
750 syntax elements. Left to his or her own devices, a novice IDL 754 syntax elements. Left to his or her own devices, a novice IDL
751 programmer will often conjure code which is very difficult to read and 755 programmer will often conjure code which is very difficult to read and
752 impossible to adapt. Much can be gleaned from studying available IDL 756 impossible to adapt. Much can be gleaned from studying available IDL
753 code libraries for coding style pointers, but, due to the variety of IDL 757 code libraries for coding style pointers, but, due to the variety of
754 syntax elements, replicating this style can be challenging at best. 758 IDL syntax elements, replicating this style can be challenging at
755 Luckily, IDLWAVE understands the structure IDL code very well, and takes 759 best. Luckily, IDLWAVE understands the structure of IDL code very
756 care of almost all formatting issues for you. After configuring it to 760 well, and takes care of almost all formatting issues for you. After
757 match your coding standards, you can rely on it to help keep your code 761 configuring it to match your coding standards, you can rely on it to
758 neat and organized. 762 help keep your code neat and organized.
759 763
760 @cindex Foreign code, adapting 764 @cindex Foreign code, adapting
761 @cindex Indentation, of foreign code 765 @cindex Indentation, of foreign code
762 @kindex C-M-\ 766 @kindex C-M-\
763 To re-indent a larger portion of code (e.g. when working with foreign code 767 To re-indent a larger portion of code (e.g. when working with foreign code
829 @example 833 @example
830 function thisfunctionnameisverylongsoitwillleavelittleroom, a, b, $ 834 function thisfunctionnameisverylongsoitwillleavelittleroom, a, b, $
831 c, d 835 c, d
832 @end example 836 @end example
833 837
834 You can instruct IDLWAVE when to use this special continuation 838 You can instruct IDLWAVE when to avoid using this special continuation
835 indentation by setting the variable 839 indentation by setting the variable
836 @code{idlwave-max-extra-continuation-indent}, which specifies the 840 @code{idlwave-max-extra-continuation-indent}, which specifies the
837 maximum additional indentation beyond the basic indent to be tolerated, 841 maximum additional indentation beyond the basic indent to be
838 otherwise defaulting to fixed-offset from the enclosing indent (the size 842 tolerated, otherwise defaulting to a fixed-offset from the enclosing
839 of which offset is set in @code{idlwave-continuation-indent}). Also, 843 indent (the size of which offset is set in
840 since the indentation level is somewhat dynamic in continued statements 844 @code{idlwave-continuation-indent}). Also, since the indentation
841 with special continuation indentation, especially if 845 level can be somewhat dynamic in continued statements with special
842 @code{idlwave-max-extra-continuation-indent} is small, the key @kbd{C-u 846 continuation indentation, especially if
843 @key{TAB}} will re-indent all lines in the current statement. Note that 847 @code{idlwave-max-extra-continuation-indent} is small, the key
844 @code{idlwave-indent-to-open-paren}, if non-nil, overrides the 848 @kbd{C-u @key{TAB}} will re-indent all lines in the current statement.
845 @code{idlwave-max-extra-continuation-indent} limit, for parentheses 849 Note that @code{idlwave-indent-to-open-paren}, if non-nil, overrides
846 only, forcing them always to line up. 850 the @code{idlwave-max-extra-continuation-indent} limit, for
851 parentheses only, forcing them always to line up.
847 852
848 853
849 @defopt idlwave-continuation-indent (@code{2}) 854 @defopt idlwave-continuation-indent (@code{2})
850 Extra indentation applied to normal continuation lines. 855 Extra indentation applied to normal continuation lines.
851 @end defopt 856 @end defopt
880 @tab The indentation of lines starting with three semicolons remains 885 @tab The indentation of lines starting with three semicolons remains
881 unchanged. 886 unchanged.
882 @item @code{;;} 887 @item @code{;;}
883 @tab Lines starting with two semicolons are indented like the surrounding code. 888 @tab Lines starting with two semicolons are indented like the surrounding code.
884 @item @code{;} 889 @item @code{;}
885 @tab Lines starting with a single semicolon are indent to a minimum column. 890 @tab Lines starting with a single semicolon are indented to a minimum column.
886 @end multitable 891 @end multitable
887 892
888 @noindent 893 @noindent
889 The indentation of comments starting in column 0 is never changed. 894 The indentation of comments starting in column 0 is never changed.
890 895
1043 @cindex Scanning buffers for routine info 1048 @cindex Scanning buffers for routine info
1044 @cindex Buffers, scanning for routine info 1049 @cindex Buffers, scanning for routine info
1045 @cindex Shell, querying for routine info 1050 @cindex Shell, querying for routine info
1046 1051
1047 @kindex C-c C-i 1052 @kindex C-c C-i
1048 IDL comes bundled with more than one thousand procedures, functions and 1053 IDL comes bundled with more than one thousand procedures, functions
1049 object methods, and large libraries typically contain hundreds or even 1054 and object methods, and large libraries typically contain hundreds or
1050 thousands more. This large command set makes it difficult to remember 1055 even thousands more (each with a few to tens of keywords and
1051 the calling sequence and keywords for routines you use, but IDLWAVE can 1056 arguments). This large command set can make it difficult to remember
1052 help. It builds up routine information using a wide variety of sources: 1057 the calling sequence and keywords for the routines you use, but
1053 IDLWAVE in fact knows far more about the routines on your system than 1058 IDLWAVE can help. It builds up routine information using a wide
1054 IDL itself. It maintains a list of all built-in routines, with calling 1059 variety of sources: IDLWAVE in fact knows far more about the routines
1055 sequences and keywords@footnote{This list is created by scanning the IDL 1060 on your system than IDL itself. It maintains a list of all built-in
1056 manuals and might contain (very few) errors. Please report any errors 1061 routines, with calling sequences and keywords@footnote{This list is
1057 to the maintainer, so that they can be fixed.}. It also scans Emacs 1062 created by scanning the IDL manuals and might contain (very few)
1058 buffers and library files for routine definitions, and queries the 1063 errors. Please report any errors to the maintainer, so that they can
1059 IDLWAVE-Shell for information about routines currently compiled there. 1064 be fixed.}. It also scans Emacs buffers and library files for routine
1060 This information is updated automatically, and so should usually be 1065 definitions, and queries the IDLWAVE-Shell for information about
1061 current. To force a global update and refresh the routine information, 1066 routines currently compiled there. This information is updated
1062 use @kbd{C-c C-i} (@code{idlwave-update-routine-info}). 1067 automatically, and so should usually be current. To force a global
1068 update and refresh the routine information, use @kbd{C-c C-i}
1069 (@code{idlwave-update-routine-info}).
1063 1070
1064 @kindex C-c ? 1071 @kindex C-c ?
1065 To display the information about a routine, press @kbd{C-c ?}, which 1072 To display the information about a routine, press @kbd{C-c ?}, which
1066 calls the command @code{idlwave-routine-info}. When the current cursor 1073 calls the command @code{idlwave-routine-info}. When the current cursor
1067 position is on the name or in the argument list of a procedure or 1074 position is on the name or in the argument list of a procedure or
1216 @cindex Online Help, Installation 1223 @cindex Online Help, Installation
1217 @cindex Speed, of online help 1224 @cindex Speed, of online help
1218 For IDL system routines, RSI provides extensive documentation. IDLWAVE 1225 For IDL system routines, RSI provides extensive documentation. IDLWAVE
1219 can access an ASCII version of this documentation very quickly and 1226 can access an ASCII version of this documentation very quickly and
1220 accurately. This is @emph{much} faster than using the IDL online help 1227 accurately. This is @emph{much} faster than using the IDL online help
1221 application, because usually IDLWAVE gets you to the right place in the 1228 application, because IDLWAVE usually gets you to the right place in the
1222 docs directly, without any additional browsing and scrolling. For this 1229 documentation directly, without any additional browsing and scrolling.
1223 online help to work, an ASCII version of the IDL documentation, which is 1230 For this online help to work, an ASCII version of the IDL documentation,
1224 not part of the standalone IDLWAVE distribution, is required. The 1231 which is not part of the standalone IDLWAVE distribution, is required.
1225 necessary help files can be downloaded from 1232 The necessary help files can be downloaded from
1226 @uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. The text 1233 @uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. The text
1227 extracted from the PDF files is fine for normal documentation 1234 extracted from the PDF files is fine for normal documentation
1228 paragraphs, but graphics and multiline equations will not be well 1235 paragraphs, but graphics and multiline equations will not be well
1229 formatted. See also @ref{Documentation Scan}. 1236 formatted. See also @ref{Documentation Scan}.
1230 1237
1238 delimited in @code{<NEW>..</NEW>} blocks. 1245 delimited in @code{<NEW>..</NEW>} blocks.
1239 1246
1240 @cindex Source code, as online help 1247 @cindex Source code, as online help
1241 @cindex DocLib header, as online help 1248 @cindex DocLib header, as online help
1242 For routines which are not documented in the IDL manual (for example 1249 For routines which are not documented in the IDL manual (for example
1243 your own routines), the source code is used as help text. If the 1250 personal or library routines), the source code itself is used as help
1244 requested information can be found in a (more or less) standard DocLib 1251 text. If the requested information can be found in a (more or less)
1245 file header, IDLWAVE shows the header (scrolling down to appropriate 1252 standard DocLib file header, IDLWAVE shows the header (scrolling down to
1246 keywords). Otherwise the routine definition statement 1253 appropriate keyword). Otherwise the routine definition statement
1247 (@code{pro}/@code{function}) is shown. 1254 (@code{pro}/@code{function}) is shown.
1255
1256 @cindex Structure tags, in online help
1257 @cindex Class tags, in online help
1258 Help is also available for class structure tags (@code{self.TAG}), and
1259 generic structure tags, if structure tag completion is enabled
1260 (@pxref{Structure Tag Completion}). This is implemented by visiting the
1261 tag within the class or structure definition source itself. Help is not
1262 available on built-in system class tags.
1248 1263
1249 @kindex M-? 1264 @kindex M-?
1250 In any IDL program (or, as with most IDLWAVE commands, in the IDL 1265 In any IDL program (or, as with most IDLWAVE commands, in the IDL
1251 Shell), press @kbd{M-?} (@code{idlwave-context-help}), or click with 1266 Shell), press @kbd{M-?} (@code{idlwave-context-help}), or click with
1252 @kbd{S-Mouse-3} to access context sensitive online help. The following 1267 @kbd{S-Mouse-3} to access context sensitive online help. The following
1266 @tab A class name in an @code{OBJ_NEW} call. 1281 @tab A class name in an @code{OBJ_NEW} call.
1267 @item @i{Class Init} 1282 @item @i{Class Init}
1268 @tab Beyond the class name in an @code{OBJ_NEW} call. 1283 @tab Beyond the class name in an @code{OBJ_NEW} call.
1269 @item @i{Executive Command} 1284 @item @i{Executive Command}
1270 @tab An executive command like @code{.RUN}. Mostly useful in the shell. 1285 @tab An executive command like @code{.RUN}. Mostly useful in the shell.
1286 @item @i{Structure Tags}
1287 @tab In structure tags like @code{state.xsize}
1288 @item @i{Structure Tags}
1289 @tab In class tags like @code{self.value}.
1271 @item @i{Default} 1290 @item @i{Default}
1272 @tab The routine that would be selected for routine info display. 1291 @tab The routine that would be selected for routine info display.
1273 @end multitable 1292 @end multitable
1274 1293
1275 @cindex @code{OBJ_NEW}, special online help 1294 @cindex @code{OBJ_NEW}, special online help
1288 @item 1307 @item
1289 Online help for routines and keywords can be accessed through the 1308 Online help for routines and keywords can be accessed through the
1290 Routine Info display. Click with @kbd{Mouse-3} on an item to see the 1309 Routine Info display. Click with @kbd{Mouse-3} on an item to see the
1291 corresponding help (@pxref{Routine Info}). 1310 corresponding help (@pxref{Routine Info}).
1292 @item 1311 @item
1293 When using completion and Emacs pops up a window with possible 1312 When using completion and Emacs pops up a @file{*Completions*} buffer
1294 completions, clicking with @kbd{Mouse-3} on a completion item invokes 1313 with possible completions, clicking with @kbd{Mouse-3} on a completion
1295 help on that item (@pxref{Completion}). 1314 item invokes help on that item (@pxref{Completion}). Items for which
1315 help is available in the online system documentation (vs. just the
1316 program source itself) will be emphasized (e.g. colored blue).
1296 @end itemize 1317 @end itemize
1297 @noindent 1318 @noindent
1298 In both cases, a blue face indicates that the item is documented in the 1319 In both cases, a blue face indicates that the item is documented in the
1299 IDL manual, but an attempt will be made to visit non-blue items directly 1320 IDL manual, but an attempt will be made to visit non-blue items directly
1300 in the originating source file. 1321 in the originating source file.
1429 @end example 1450 @end example
1430 1451
1431 @cindex Completion, ambiguity 1452 @cindex Completion, ambiguity
1432 @cindex Completion, forcing function name 1453 @cindex Completion, forcing function name
1433 The only place where completion is ambiguous is procedure/function 1454 The only place where completion is ambiguous is procedure/function
1434 @emph{keywords} versus @emph{functions}. After @samp{plot,x_}, IDLWAVE 1455 @emph{keywords} versus @emph{functions}. After @samp{plot,x,_}, IDLWAVE
1435 will always assume a keyword to plot. You can force completion of a 1456 will always assume a keyword to @samp{plot}. However, a function is
1436 function name at such a location with a prefix arg: @kbd{C-u 1457 also a possible completion here. You can force completion of a function
1437 M-@key{TAB}}. 1458 name at such a location by using a prefix arg: @kbd{C-u M-@key{TAB}}.
1438 1459
1439 @cindex Scrolling the @file{*Completions*} window 1460 @cindex Scrolling the @file{*Completions*} window
1440 @cindex Completion, scrolling 1461 @cindex Completion, scrolling
1441 @cindex Completion, Online Help 1462 @cindex Completion, Online Help
1442 @cindex Online Help in @file{*Completions*} buffer 1463 @cindex Online Help in @file{*Completions*} buffer
1443 If the list of completions is too long to fit in the 1464 If the list of completions is too long to fit in the
1444 @file{*Completions*} window, the window can be scrolled by pressing 1465 @file{*Completions*} window, the window can be scrolled by pressing
1445 @kbd{M-@key{TAB}} repeatedly. Online help (if installed) for each 1466 @kbd{M-@key{TAB}} repeatedly. Online help (if installed) for each
1446 possible completion is available by clicking with @kbd{Mouse-3} on the 1467 possible completion is available by clicking with @kbd{Mouse-3} on the
1447 item. Items for which system online help (from the IDL manual) is 1468 item. Items for which system online help (from the IDL manual) is
1448 available will be displayed in a different font (e.g. colored blue). 1469 available will be emphasized (e.g. colored blue). For other items, the
1449 For other items, the corresponding source code or DocLib header will be 1470 corresponding source code or DocLib header will be used as the help
1450 used as the help text. 1471 text.
1472
1473 @cindex Completion, cancelling
1474 @cindex Cancelling completion
1475 Completion is not a blocking operation --- you are free to continue
1476 editing, enter commands, or simply ignore the @file{*Completions*}
1477 buffer during a completion operation. If, however, the most recent
1478 command was a completion, @kbd{C-g} will remove the buffer and restore
1479 the window configuration. You can also remove the buffer at any time
1480 with no negative consequences.
1451 1481
1452 @defopt idlwave-keyword-completion-adds-equal (@code{t}) 1482 @defopt idlwave-keyword-completion-adds-equal (@code{t})
1453 Non-@code{nil} means completion automatically adds @samp{=} after 1483 Non-@code{nil} means completion automatically adds @samp{=} after
1454 completed keywords. 1484 completed keywords.
1455 @end defopt 1485 @end defopt
1471 @end defopt 1501 @end defopt
1472 1502
1473 @menu 1503 @menu
1474 * Case of Completed Words:: CaseOFcomPletedWords 1504 * Case of Completed Words:: CaseOFcomPletedWords
1475 * Object Method Completion and Class Ambiguity:: obj->Method, what? 1505 * Object Method Completion and Class Ambiguity:: obj->Method, what?
1506 * Object Method Completion in the Shell::
1476 * Class and Keyword Inheritance:: obj->Method, _EXTRA=e 1507 * Class and Keyword Inheritance:: obj->Method, _EXTRA=e
1477 * Structure Tag Completion:: Completing state.Tag 1508 * Structure Tag Completion:: Completing state.Tag
1478 @end menu 1509 @end menu
1479 1510
1480 @node Case of Completed Words, Object Method Completion and Class Ambiguity, Completion, Completion 1511 @node Case of Completed Words, Object Method Completion and Class Ambiguity, Completion, Completion
1510 @defopt idlwave-complete-empty-string-as-lower-case (@code{nil}) 1541 @defopt idlwave-complete-empty-string-as-lower-case (@code{nil})
1511 Non-@code{nil} means the empty string is considered lower case for 1542 Non-@code{nil} means the empty string is considered lower case for
1512 completion. 1543 completion.
1513 @end defopt 1544 @end defopt
1514 1545
1515 @node Object Method Completion and Class Ambiguity, Class and Keyword Inheritance, Case of Completed Words, Completion 1546 @node Object Method Completion and Class Ambiguity, Object Method Completion in the Shell, Case of Completed Words, Completion
1516 @subsection Object Method Completion and Class Ambiguity 1547 @subsection Object Method Completion and Class Ambiguity
1517 @cindex Object methods 1548 @cindex Object methods
1518 @cindex Class ambiguity 1549 @cindex Class ambiguity
1519 @cindex @code{self} object, default class 1550 @cindex @code{self} object, default class
1520 An object method is not uniquely determined without the object's class. 1551 An object method is not uniquely determined without the object's class.
1535 M-@key{TAB}}. IDLWAVE will then prompt you for the class in order to 1566 M-@key{TAB}}. IDLWAVE will then prompt you for the class in order to
1536 narrow down the number of possible completions. The variable 1567 narrow down the number of possible completions. The variable
1537 @code{idlwave-query-class} can be configured to make such prompting the 1568 @code{idlwave-query-class} can be configured to make such prompting the
1538 default for all methods (not recommended), or selectively for very 1569 default for all methods (not recommended), or selectively for very
1539 common methods for which the number of completing keywords would be too 1570 common methods for which the number of completing keywords would be too
1540 large (e.g. @code{Init}). After you have specified the class for a 1571 large (e.g. @code{Init}).
1541 particular statement (e.g. when completing the method), IDLWAVE can 1572
1542 remember it for the rest of the editing session. Subsequent completions 1573 @cindex Saving object class on @code{->}
1543 in the same statement (e.g. keywords) can then reuse this class 1574 @cindex @code{->}
1544 information. This works by placing a text property on the method 1575 After you have specified the class for a particular statement (e.g. when
1545 invocation operator @samp{->}, after which the operator will be shown in 1576 completing the method), IDLWAVE can remember it for the rest of the
1546 a different face. This is not enabled by default --- the variable 1577 editing session. Subsequent completions in the same statement
1547 @code{idlwave-store-inquired-class} can be used to turn it on. 1578 (e.g. keywords) can then reuse this class information. This works by
1579 placing a text property on the method invocation operator @samp{->},
1580 after which the operator will be shown in a different face. This is not
1581 enabled by default --- the variable @code{idlwave-store-inquired-class}
1582 can be used to turn it on.
1548 1583
1549 @defopt idlwave-completion-show-classes (@code{1}) 1584 @defopt idlwave-completion-show-classes (@code{1})
1550 Non-@code{nil} means show classes in @file{*Completions*} buffer when 1585 Non-@code{nil} means show classes in @file{*Completions*} buffer when
1551 completing object methods and keywords. 1586 completing object methods and keywords.
1552 @end defopt 1587 @end defopt
1567 @defopt idlwave-class-arrow-face 1602 @defopt idlwave-class-arrow-face
1568 Face to highlight object operator arrows @samp{->} which carry a class 1603 Face to highlight object operator arrows @samp{->} which carry a class
1569 text property. 1604 text property.
1570 @end defopt 1605 @end defopt
1571 1606
1572 @node Class and Keyword Inheritance, Structure Tag Completion, Object Method Completion and Class Ambiguity, Completion 1607 @node Object Method Completion in the Shell, Class and Keyword Inheritance, Object Method Completion and Class Ambiguity, Completion
1608 @subsection Object Method Completion in the Shell
1609 @cindex Method Completion in Shell
1610 In the IDLWAVE Shell (@pxref{The IDLWAVE Shell}), objects on which
1611 methods are being invoked have a special property: they must exist as
1612 variables, and so their class can be determined (for instance, using the
1613 @code{obj_class()} function). In the Shell, when attempting completion,
1614 routine info, or online help within a method routine, a query is sent to
1615 determine the class of the object. If this query is successful, the
1616 class found will be used to select appropriate completions, routine
1617 info, or help. If unsuccessful, information from all known classes will
1618 be used (as in the buffer). Setting the variable
1619 @code{idlwave-store-inquired-class} can eliminate unnecessary repetitive
1620 queries for the object's class, and speed up completion.
1621
1622 @node Class and Keyword Inheritance, Structure Tag Completion, Object Method Completion in the Shell, Completion
1573 @subsection Class and Keyword Inheritance 1623 @subsection Class and Keyword Inheritance
1574 @cindex Inheritance, class 1624 @cindex Inheritance, class
1575 @cindex Keyword inheritance 1625 @cindex Keyword inheritance
1576 @cindex Inheritance, keyword 1626 @cindex Inheritance, keyword
1577 1627
1593 entire class inheritance chain. This is often referred to as 1643 entire class inheritance chain. This is often referred to as
1594 @emph{chaining}, and is characterized by chained method calls like 1644 @emph{chaining}, and is characterized by chained method calls like
1595 @w{@code{self->MySuperClass::SetProperty,_EXTRA=e}}. 1645 @w{@code{self->MySuperClass::SetProperty,_EXTRA=e}}.
1596 1646
1597 IDLWAVE can accommodate this special synergy between class and keyword 1647 IDLWAVE can accommodate this special synergy between class and keyword
1598 inheritance: if @code{_EXTRA} or @code{_REF_EXTRA} are detected among a 1648 inheritance: if @code{_EXTRA} or @code{_REF_EXTRA} is detected among a
1599 method's keyword parameters, all keywords of superclass versions of the 1649 method's keyword parameters, all keywords of superclass versions of the
1600 method being considered are included in completion. The completion 1650 method being considered are included in completion. There is of course
1601 buffer will label keywords based on their originating class. The 1651 no guarantee that this type of keyword chaining actually occurrs, but
1602 variable @code{idlwave-keyword-class-inheritance} can be used to 1652 for some methods it's a very convenient assumption. The variable
1603 configure which methods have keyword inheritance treated in this simple, 1653 @code{idlwave-keyword-class-inheritance} can be used to configure which
1604 class-driven way. By default, only @code{Init} and 1654 methods have keyword inheritance treated in this simple, class-driven
1605 @code{(Get|Set)Property} are. 1655 way. By default, only @code{Init} and @code{(Get|Set)Property} are.
1656 The completion buffer will label keywords based on their originating
1657 class.
1606 1658
1607 @defopt idlwave-support-inheritance (@code{t}) 1659 @defopt idlwave-support-inheritance (@code{t})
1608 Non-@code{nil} means consider inheritance during completion, online help etc. 1660 Non-@code{nil} means consider inheritance during completion, online help etc.
1609 @end defopt 1661 @end defopt
1610 1662
1611 @defopt idlwave-keyword-class-inheritance 1663 @defopt idlwave-keyword-class-inheritance
1612 A list of regular expressions to match methods for which simple 1664 A list of regular expressions to match methods for which simple
1613 class-driven keyword inheritance will be used for Completion. 1665 class-driven keyword inheritance will be used for Completion.
1614 @end defopt 1666 @end defopt
1615 1667
1616 @node Structure Tag Completion, , Class and Keyword Inheritance, Completion 1668 @node Structure Tag Completion, , Class and Keyword Inheritance, Completion
1619 @cindex Structure tag completion 1671 @cindex Structure tag completion
1620 1672
1621 In many programs, especially those involving widgets, large structures 1673 In many programs, especially those involving widgets, large structures
1622 (e.g. the @samp{state} structure) are used to communicate among 1674 (e.g. the @samp{state} structure) are used to communicate among
1623 routines. It is very convenient to be able to complete structure tags, 1675 routines. It is very convenient to be able to complete structure tags,
1624 in the same way as for instance variables of the @samp{self} object 1676 in the same way as for instance variables (tags) of the @samp{self}
1625 (@pxref{Object Method Completion and Class Ambiguity}). Add-in code for 1677 object (@pxref{Object Method Completion and Class Ambiguity}). Add-in
1626 structure tag completion is available in the form of a loadable 1678 code for structure tag completion is available in the form of a loadable
1627 completion module: @file{idlw-complete-structtag.el}. Tag completion in 1679 completion module: @file{idlw-complete-structtag.el}. Tag completion in
1628 structures is highly ambiguous (much more so than @samp{self} 1680 structures is highly ambiguous (much more so than @samp{self}
1629 completion), so @code{idlw-complete-structtag} makes an unusual and 1681 completion), so @code{idlw-complete-structtag} makes an unusual and very
1630 specific assumption: the exact same variable name is used to refer to 1682 specific assumption: the exact same variable name is used to refer to
1631 the structure in all parts of the program. So, if you consistently 1683 the structure in all parts of the program. This is entirely unenforced
1684 by the IDL language, but is a typical convention. If you consistently
1632 refer to the same structure with the same variable name 1685 refer to the same structure with the same variable name
1633 (e.g. @samp{state}), structure tags which are read from its definition 1686 (e.g. @samp{state}), structure tags which are read from its definition
1634 can be used for completion. 1687 in the same file can be used for completion.
1635 1688
1636 Structure tag completion is not enabled by default. To enable it, 1689 Structure tag completion is not enabled by default. To enable it,
1637 simply add the following to your @file{.emacs}: 1690 simply add the following to your @file{.emacs}:
1638 1691
1639 @lisp 1692 @lisp
1640 (add-hook 'idlwave-load-hook 1693 (add-hook 'idlwave-load-hook
1641 (lambda () (require 'idlw-complete-structtag))) 1694 (lambda () (require 'idlw-complete-structtag)))
1642 @end lisp 1695 @end lisp
1696
1697 Once enabled, you'll also be able to access online help on the structure
1698 tags, using the usual methods (@pxref{Online Help}).
1643 1699
1644 @node Routine Source, Resolving Routines, Completion, The IDLWAVE Major Mode 1700 @node Routine Source, Resolving Routines, Completion, The IDLWAVE Major Mode
1645 @section Routine Source 1701 @section Routine Source
1646 @cindex Routine source file 1702 @cindex Routine source file
1647 @cindex Module source file 1703 @cindex Module source file
1648 @cindex Source file, of a routine 1704 @cindex Source file, of a routine
1649 @kindex C-c C-v 1705 @kindex C-c C-v
1650 In addition to clicking on a @i{Source:} line in the routine info 1706 In addition to clicking on a @i{Source:} line in the routine info
1651 window, there is another way to find the source file of a routine. The 1707 window, there is another way to quickly visit the source file of a
1652 command @kbd{C-c C-v} (@code{idlwave-find-module}) asks for a module 1708 routine. The command @kbd{C-c C-v} (@code{idlwave-find-module}) asks
1653 name, offering the same default as @code{idlwave-routine-info} would 1709 for a module name, offering the same default as
1654 have used, taken from nearby buffer contents. In the minibuffer, 1710 @code{idlwave-routine-info} would have used, taken from nearby buffer
1655 specify a complete routine name (including any class part). IDLWAVE 1711 contents. In the minibuffer, specify a complete routine name (including
1656 will display the source file in another window, positioned at the 1712 any class part). IDLWAVE will display the source file in another
1657 routine in question. 1713 window, positioned at the routine in question.
1658 1714
1659 @cindex Buffers, killing 1715 @cindex Buffers, killing
1660 @cindex Killing autoloaded buffers 1716 @cindex Killing autoloaded buffers
1661 Since getting the source of a routine into a buffer is so easy with 1717 Since getting the source of a routine into a buffer is so easy with
1662 IDLWAVE, too many buffers visiting different IDL source files are 1718 IDLWAVE, too many buffers visiting different IDL source files are
1663 sometimes created. The special command @kbd{C-c C-k} 1719 sometimes created. The special command @kbd{C-c C-k}
1664 (@code{idlwave-kill-autoloaded-buffers}) can be used to remove these 1720 (@code{idlwave-kill-autoloaded-buffers}) can be used to easily remove
1665 buffers. 1721 these buffers.
1666 1722
1667 @node Resolving Routines, Code Templates, Routine Source, The IDLWAVE Major Mode 1723 @node Resolving Routines, Code Templates, Routine Source, The IDLWAVE Major Mode
1668 @section Resolving Routines 1724 @section Resolving Routines
1669 @cindex @code{RESOLVE_ROUTINE} 1725 @cindex @code{RESOLVE_ROUTINE}
1670 @cindex Compiling library modules 1726 @cindex Compiling library modules
1862 1918
1863 @lisp 1919 @lisp
1864 (add-hook 'idlwave-mode-hook 1920 (add-hook 'idlwave-mode-hook
1865 (lambda () 1921 (lambda ()
1866 (idlwave-define-abbrev "wb" "widget_base()" 1922 (idlwave-define-abbrev "wb" "widget_base()"
1867 (idlwave-keyword-abbrev 1)) 1923 (idlwave-keyword-abbrev 1))
1868 (idlwave-define-abbrev "ine" "IF N_Elements() EQ 0 THEN" 1924 (idlwave-define-abbrev "ine" "IF N_Elements() EQ 0 THEN"
1869 (idlwave-keyword-abbrev 11)))) 1925 (idlwave-keyword-abbrev 11))))
1870 @end lisp 1926 @end lisp
1871 1927
1872 Notice how the abbreviation (here @emph{wb}) and its expansion 1928 Notice how the abbreviation (here @emph{wb}) and its expansion
1873 (@emph{widget_base()}) are given as argument, and the single argument to 1929 (@emph{widget_base()}) are given as arguments, and the single argument to
1874 @code{idlwave-keyword-abbrev} (here @emph{1}) specifies how far back to 1930 @code{idlwave-keyword-abbrev} (here @emph{1}) specifies how far back to
1875 move the point upon expansion (in this example, to put it between the 1931 move the point upon expansion (in this example, to put it between the
1876 parentheses). 1932 parentheses).
1877 1933
1878 The abbreviations are expanded in upper or lower case, depending upon 1934 The abbreviations are expanded in upper or lower case, depending upon
1879 the variables @code{idlwave-abbrev-change-case} and (for reserved word 1935 the variables @code{idlwave-abbrev-change-case} and, for reserved word
1880 templates) @code{idlwave-reserved-word-upcase} (@pxref{Case Changes}). 1936 templates, @code{idlwave-reserved-word-upcase} (@pxref{Case Changes}).
1881 1937
1882 @defopt idlwave-abbrev-start-char (@code{"\"}) 1938 @defopt idlwave-abbrev-start-char (@code{"\"})
1883 A single character string used to start abbreviations in abbrev 1939 A single character string used to start abbreviations in abbrev mode.
1884 mode. 1940 Beware of common characters which might naturally occur in sequence with
1941 abbreviation strings.
1885 @end defopt 1942 @end defopt
1886 1943
1887 @defopt idlwave-abbrev-move (@code{t}) 1944 @defopt idlwave-abbrev-move (@code{t})
1888 Non-@code{nil} means the abbrev hook can move point, e.g. to end up 1945 Non-@code{nil} means the abbrev hook can move point, e.g. to end up
1889 between the parenthesis of a function call. 1946 between the parentheses of a function call.
1890 @end defopt 1947 @end defopt
1891 1948
1892 @node Actions, Doc Header, Abbreviations, The IDLWAVE Major Mode 1949 @node Actions, Doc Header, Abbreviations, The IDLWAVE Major Mode
1893 @section Actions 1950 @section Actions
1894 @cindex Actions 1951 @cindex Actions
1895 @cindex Coding standards, enforcing 1952 @cindex Coding standards, enforcing
1896 1953
1897 @emph{Actions} are special commands which are executed automatically 1954 @emph{Actions} are special formatting commands which are executed
1898 while you write code in order to check the structure of the program or 1955 automatically while you write code in order to check the structure of
1899 to enforce coding standards. Most actions which have been implemented 1956 the program or to enforce coding standards. Most actions which have
1900 in IDLWAVE are turned off by default, assuming that the average user 1957 been implemented in IDLWAVE are turned off by default, assuming that the
1901 wants her code the way she writes it. But if you are a lazy typist and 1958 average user wants her code the way she writes it. But if you are a
1902 want your code to adhere to certain standards, actions can be 1959 lazy typist and want your code to adhere to certain standards, actions
1903 helpful. 1960 can be helpful.
1904 1961
1905 Actions can be applied in three ways: 1962 Actions can be applied in three ways:
1906 1963
1907 @itemize @bullet 1964 @itemize @bullet
1908 @item 1965 @item
1929 @defopt idlwave-do-actions (@code{nil}) 1986 @defopt idlwave-do-actions (@code{nil})
1930 Non-@code{nil} means performs actions when indenting. 1987 Non-@code{nil} means performs actions when indenting.
1931 @end defopt 1988 @end defopt
1932 1989
1933 @menu 1990 @menu
1934 * Block Boundary Check:: Is the END correct 1991 * Block Boundary Check:: Is the END statement correct?
1935 * Padding Operators:: Enforcing space around `=' etc 1992 * Padding Operators:: Enforcing space around `=' etc
1936 * Case Changes:: Enforcing upper case keywords 1993 * Case Changes:: Enforcing upper case keywords
1937 @end menu 1994 @end menu
1938 1995
1939 @node Block Boundary Check, Padding Operators, Actions, Actions 1996 @node Block Boundary Check, Padding Operators, Actions, Actions
2181 Emacs packages which handles the communication with the IDL program. 2238 Emacs packages which handles the communication with the IDL program.
2182 Unfortunately IDL for Windows and MacOS do not have command-prompt 2239 Unfortunately IDL for Windows and MacOS do not have command-prompt
2183 versions and thus do not allow the interaction with 2240 versions and thus do not allow the interaction with
2184 Emacs@footnote{Please inform the maintainer if you come up with a way to 2241 Emacs@footnote{Please inform the maintainer if you come up with a way to
2185 make the IDLWAVE shell work on these systems.} --- so the IDLWAVE shell 2242 make the IDLWAVE shell work on these systems.} --- so the IDLWAVE shell
2186 currently only works under GNU and Unix. 2243 currently only works under Unix.
2187 2244
2188 @menu 2245 @menu
2189 * Starting the Shell:: How to launch IDL as a subprocess 2246 * Starting the Shell:: How to launch IDL as a subprocess
2190 * Using the Shell:: Interactively working with the Shell 2247 * Using the Shell:: Interactively working with the Shell
2191 * Debugging IDL Programs:: Compilation/Debugging 2248 * Commands Sent to the Shell::
2249 * Debugging IDL Programs::
2192 * Examining Variables:: 2250 * Examining Variables::
2193 * Custom Expression Examination:: 2251 * Custom Expression Examination::
2194 @end menu 2252 @end menu
2195 2253
2196 @node Starting the Shell, Using the Shell, The IDLWAVE Shell, The IDLWAVE Shell 2254 @node Starting the Shell, Using the Shell, The IDLWAVE Shell, The IDLWAVE Shell
2283 @cindex Hooks 2341 @cindex Hooks
2284 @defopt idlwave-shell-mode-hook 2342 @defopt idlwave-shell-mode-hook
2285 Hook for customizing @code{idlwave-shell-mode}. 2343 Hook for customizing @code{idlwave-shell-mode}.
2286 @end defopt 2344 @end defopt
2287 2345
2288 @node Using the Shell, Debugging IDL Programs, Starting the Shell, The IDLWAVE Shell 2346 @node Using the Shell, Commands Sent to the Shell, Starting the Shell, The IDLWAVE Shell
2289 @section Using the Shell 2347 @section Using the Shell
2290 @cindex Comint 2348 @cindex Comint
2291 @cindex Shell, basic commands 2349 @cindex Shell, basic commands
2292 2350
2293 The IDLWAVE shell works in the same fashion as other shell modes in 2351 The IDLWAVE shell works in the same fashion as other shell modes in
2299 @code{idlwave-shell-arrows-do-history}.}. The history is preserved 2357 @code{idlwave-shell-arrows-do-history}.}. The history is preserved
2300 between emacs and IDL sessions. Here is a list of commonly used 2358 between emacs and IDL sessions. Here is a list of commonly used
2301 commands: 2359 commands:
2302 2360
2303 @multitable @columnfractions .12 .88 2361 @multitable @columnfractions .12 .88
2304 @item @key{UP} 2362 @item @key{UP}, @key{M-p}
2305 @tab Cycle backwards in input history 2363 @tab Cycle backwards in input history
2306 @item @key{DOWN} 2364 @item @key{DOWN}, @key{M-n}
2307 @tab Cycle forwards in input history 2365 @tab Cycle forwards in input history
2308 @item @kbd{M-p}
2309 @tab Cycle backwards in input history @emph{matching input}
2310 @item @kbd{M-n}
2311 @tab Cycle forwards in input history @emph{matching input}
2312 @item @kbd{M-r} 2366 @item @kbd{M-r}
2313 @tab Previous input matching a regexp 2367 @tab Previous input matching a regexp
2314 @item @kbd{M-s} 2368 @item @kbd{M-s}
2315 @tab Next input that matches a regexp 2369 @tab Next input matching a regexp
2316 @item @kbd{return} 2370 @item @kbd{return}
2317 @tab Send input or copy line to current prompt 2371 @tab Send input or copy line to current prompt
2318 @item @kbd{C-c C-a} 2372 @item @kbd{C-c C-a}
2319 @tab Beginning of line; skip prompt 2373 @tab Beginning of line; skip prompt
2320 @item @kbd{C-c C-u} 2374 @item @kbd{C-c C-u}
2334 @item @kbd{C-c C-l} 2388 @item @kbd{C-c C-l}
2335 @tab List input history 2389 @tab List input history
2336 @end multitable 2390 @end multitable
2337 2391
2338 In addition to these standard @file{comint} commands, 2392 In addition to these standard @file{comint} commands,
2339 @code{idlwave-shell-mode} provides many of the commands which simplify 2393 @code{idlwave-shell-mode} provides many of the same commands which
2340 writing IDL code, including abbreviations, online help, and completion. 2394 simplify writing IDL code available in IDLWAVE buffers. This includes
2341 See @ref{Routine Info} and @ref{Online Help} and @ref{Completion} for more 2395 abbreviations, online help, and completion. See @ref{Routine Info} and
2342 information on these commands. 2396 @ref{Online Help} and @ref{Completion} for more information on these
2397 commands.
2343 2398
2344 @cindex Completion, in the shell 2399 @cindex Completion, in the shell
2345 @cindex Routine info, in the shell 2400 @cindex Routine info, in the shell
2346 @cindex Online Help, in the shell 2401 @cindex Online Help, in the shell
2347 @multitable @columnfractions .12 .88 2402 @multitable @columnfractions .12 .88
2410 @defopt idlwave-shell-input-mode-spells 2465 @defopt idlwave-shell-input-mode-spells
2411 The three regular expressions which match the magic spells for input 2466 The three regular expressions which match the magic spells for input
2412 modes. 2467 modes.
2413 @end defopt 2468 @end defopt
2414 2469
2415 @node Debugging IDL Programs, Examining Variables, Using the Shell, The IDLWAVE Shell 2470 @node Commands Sent to the Shell, Debugging IDL Programs, Using the Shell, The IDLWAVE Shell
2471 @section Commands Sent to the Shell
2472 @cindex Commands in shell, showing
2473 @cindex Showing commands in shell
2474
2475 The IDLWAVE buffers and shell interact very closely. In addition to the
2476 normal commands you enter at the @code{IDL>} prompt, many other special
2477 commands are sent to the shell, sometimes as a direct result of invoking
2478 a key command, menu item, or toolbar button, but also automatically, as
2479 part of the normal flow of information updates between the buffer and
2480 shell.
2481
2482 The commands sent include @code{breakpoint}, @code{.step} and other
2483 debug commands (@pxref{Debugging IDL Programs}), @code{.run} and other
2484 compilation statements (@pxref{Compiling Programs}), examination
2485 commands like @code{print} and @code{help} (@pxref{Examining
2486 Variables}), and other special purpose commands designed to keep
2487 information on the running shell current.
2488
2489 By default, much of this background shell input and output is hidden
2490 from the user, but this is configurable. The custom variable
2491 @code{idlwave-abbrev-show-commands} allows you to configure which
2492 commands sent to the shell are shown there. For a related customization
2493 for separating the output of @emph{examine} commands @xref{Examining
2494 Variables}.
2495
2496 @defopt idlwave-shell-show-commands (@code{'(run misc breakpoint)})
2497 A list of command types to echo in the shell when sent. Possible values
2498 are @code{run} for @code{.run}, @code{.compile} and other run commands,
2499 @code{misc} for lesser used commands like @code{window}, @code{retall},
2500 etc., @code{breakpoint} for breakpoint setting and clearing commands,
2501 and @code{debug} for other debug, stepping, and continue commands. In
2502 addition, if the variable is set to the single symbol @code{'everything},
2503 all the copious shell input is displayed (which is probably only useful
2504 for debugging purposes).
2505 @end defopt
2506
2507 @node Debugging IDL Programs, Examining Variables, Commands Sent to the Shell, The IDLWAVE Shell
2416 @section Debugging IDL Programs 2508 @section Debugging IDL Programs
2417 @cindex Debugging 2509 @cindex Debugging
2418 @cindex Keybindings for debugging 2510 @cindex Keybindings for debugging
2419 @cindex Toolbar 2511 @cindex Toolbar
2420 2512
2513 Programs can be compiled, run, and debugged directly from the source
2514 buffer in Emacs. IDLWAVE makes compiling and debugging IDL programs
2515 far less cumbersome by providing a full-featured,
2516 key/menu/toolbar-driven interface to commands like @code{breakpoint},
2517 @code{.step}, @code{.run}, etc.
2518
2519 The IDLWAVE shell installs key bindings both in the shell buffer and in
2520 all IDL code buffers of the current Emacs session, so debug commands
2521 work in both places (in the shell, commands operate on the last file
2522 compiled). On Emacs versions which support this, a debugging toolbar is
2523 also installed. The display of the toolbar can be toggled with @kbd{C-c
2524 C-d C-t} (@code{idlwave-shell-toggle-toolbar}).
2525
2526 @defopt idlwave-shell-use-toolbar (@code{t})
2527 Non-@code{nil} means use the debugging toolbar in all IDL related
2528 buffers.
2529 @end defopt
2530
2531 @menu
2532 * Debug Key Bindings::
2533 * Compiling Programs::
2534 * Breakpoints and Stepping::
2535 * Walking the Calling Stack::
2536 @end menu
2537
2538 @node Debug Key Bindings, Compiling Programs, Debugging IDL Programs, Debugging IDL Programs
2539 @subsection Debug Key Bindings
2421 @kindex C-c C-d 2540 @kindex C-c C-d
2422 Programs can be compiled, run, and debugged directly from the source 2541 @cindex Key bindings
2423 buffer in Emacs. The IDLWAVE shell installs key bindings both in the
2424 shell buffer and in all IDL code buffers of the current Emacs session.
2425 On Emacs versions which support this, it also installs a debugging
2426 toolbar. The display of the toolbar can be toggled with @kbd{C-c C-d
2427 C-t} (@code{idlwave-shell-toggle-toolbar}).
2428 2542
2429 The debugging key bindings are by default on the prefix key @kbd{C-c 2543 The debugging key bindings are by default on the prefix key @kbd{C-c
2430 C-d}, so for example setting a breakpoint is done with @kbd{C-c C-d 2544 C-d}, so for example setting a breakpoint is done with @kbd{C-c C-d
2431 C-b}, compiling a source file with @kbd{C-c C-d C-c}. If you find this 2545 C-b}, and compiling a source file with @kbd{C-c C-d C-c}. If you find
2432 too much work, you can add bindings for one or more modifier keys which 2546 this too much work, you can easily configure IDLWAVE to use one or more
2433 is not used by other commands. For example, if you write in 2547 modifier keys not in use by other commands, in lieu of the prefix
2434 @file{.emacs}: 2548 @kbd{C-c C-d} (though these bindings will typically also be available
2549 --- see @code{idlwave-shell-activate-prefix-keybindings}). For example,
2550 if you write in @file{.emacs}:
2435 2551
2436 @lisp 2552 @lisp
2437 (setq idlwave-shell-debug-modifiers '(control shift)) 2553 (setq idlwave-shell-debug-modifiers '(control shift))
2438 @end lisp 2554 @end lisp
2439 2555
2456 key, like @kbd{C-c C-d C-b}. 2572 key, like @kbd{C-c C-d C-b}.
2457 @end defopt 2573 @end defopt
2458 2574
2459 @defopt idlwave-shell-debug-modifiers (@code{nil}) 2575 @defopt idlwave-shell-debug-modifiers (@code{nil})
2460 List of modifier keys to use for additional binding of debugging 2576 List of modifier keys to use for additional binding of debugging
2461 commands in the shell and source buffers. 2577 commands in the shell and source buffers. Can be one or more of
2462 @end defopt 2578 @code{control}, @code{meta}, @code{super}, @code{hyper}, @code{alt}, and
2463 2579 @code{shift}.
2464 @defopt idlwave-shell-use-toolbar (@code{t}) 2580 @end defopt
2465 Non-@code{nil} means use the debugging toolbar in all IDL related 2581
2466 buffers. 2582 @node Compiling Programs, Breakpoints and Stepping, Debug Key Bindings, Debugging IDL Programs
2467 @end defopt
2468
2469
2470 @menu
2471 * Compiling Programs:: Compiling buffers under the shell
2472 * Breakpoints and Stepping:: Deciding where to stop and look
2473 * Walking the Calling Stack:: From where was this routine called?
2474 @end menu
2475
2476 @node Compiling Programs, Breakpoints and Stepping, Debugging IDL Programs, Debugging IDL Programs
2477 @subsection Compiling Programs 2583 @subsection Compiling Programs
2478 @cindex Compiling programs 2584 @cindex Compiling programs
2479 @cindex Programs, compiling 2585 @cindex Programs, compiling
2480 @cindex Default command line, executing 2586 @cindex Default command line, executing
2481 @cindex Executing a default command line 2587 @cindex Executing a default command line
2522 @kindex C-c C-d C-b 2628 @kindex C-c C-d C-b
2523 @kindex C-c C-d C-b 2629 @kindex C-c C-d C-b
2524 You can set breakpoints and step through a program with IDLWAVE. 2630 You can set breakpoints and step through a program with IDLWAVE.
2525 Setting a breakpoint in the current line of the source buffer is done 2631 Setting a breakpoint in the current line of the source buffer is done
2526 with @kbd{C-c C-d C-b} (@code{idlwave-shell-break-here}). With a prefix 2632 with @kbd{C-c C-d C-b} (@code{idlwave-shell-break-here}). With a prefix
2527 arg of 1 (i.e. @kbd{C-1 C-c C-d C-b}, the breakpoint gets a @code{/ONCE} 2633 arg of 1 (i.e. @kbd{C-1 C-c C-d C-b}), the breakpoint gets a
2528 keyword, meaning that it will be deleted after first use. With a 2634 @code{/ONCE} keyword, meaning that it will be deleted after first use.
2529 numeric prefix greater than one, the breakpoint will only be active the 2635 With a numeric prefix greater than one (e.g. @kbd{C-4 C-c C-d C-b}), the
2530 @code{nth} time it is hit. To clear the breakpoint in the current line, 2636 breakpoint will only be active the @code{nth} time it is hit. With a
2637 single non-numeric prefix (i.e. @kbd{C-u C-c C-d C-b}), prompt for a
2638 condition --- an IDL expression to be evaulated and trigger the
2639 breakpoint only if true. To clear the breakpoint in the current line,
2531 use @kbd{C-c C-d C-d} (@code{idlwave-clear-current-bp}). When executed 2640 use @kbd{C-c C-d C-d} (@code{idlwave-clear-current-bp}). When executed
2532 from the shell window, the breakpoint where IDL is currently stopped 2641 from the shell window, the breakpoint where IDL is currently stopped
2533 will be deleted. To clear all breakpoints, use @kbd{C-c C-d C-a} 2642 will be deleted. To clear all breakpoints, use @kbd{C-c C-d C-a}
2534 (@code{idlwave-clear-all-bp}). Breakpoint lines are highlighted in the 2643 (@code{idlwave-clear-all-bp}). Breakpoint lines are highlighted in the
2535 source code. 2644 source code. Note that IDL places breakpoints as close as possible on
2645 or after the line you specify. IDLWAVE queries the shell for the actual
2646 breakpoint location which was set, so the exact line you specify may not
2647 be marked.
2536 2648
2537 Once the program has stopped somewhere, you can step through it. The 2649 Once the program has stopped somewhere, you can step through it. The
2538 most important stepping commands are @kbd{C-c C-d C-s} to execute one 2650 most important stepping commands are @kbd{C-c C-d C-s} to execute one
2539 line of IDL code ("step into"); @kbd{C-c C-d C-n} to step a single line, 2651 line of IDL code ("step into"); @kbd{C-c C-d C-n} to step a single line,
2540 treating procedure and function calls as a single step ("step over"); 2652 treating procedure and function calls as a single step ("step over");
2541 @kbd{C-c C-d C-h} to continue execution to the line at the cursor and 2653 @kbd{C-c C-d C-h} to continue execution to the line at the cursor and
2542 @kbd{C-c C-d C-r} to continue execution. Here is a summary of the 2654 @kbd{C-c C-d C-r} to continue execution. @xref{Commands Sent to the
2655 Shell}, for information on displaying or hiding the breakpoint and
2656 stepping commands the shell receives. Here is a summary of the
2543 breakpoint and stepping commands: 2657 breakpoint and stepping commands:
2544 2658
2545 @multitable @columnfractions .23 .77 2659 @multitable @columnfractions .23 .77
2546 @item @kbd{C-c C-d C-b} 2660 @item @kbd{C-c C-d C-b}
2547 @tab Set breakpoint (@code{idlwave-shell-break-here}) 2661 @tab Set breakpoint (@code{idlwave-shell-break-here})
2601 will be highlighted. If you continue execution, IDLWAVE will 2715 will be highlighted. If you continue execution, IDLWAVE will
2602 automatically return to the current level. @xref{Examining Variables}, 2716 automatically return to the current level. @xref{Examining Variables},
2603 for information how to examine the value of variables and expressions on 2717 for information how to examine the value of variables and expressions on
2604 higher calling stack levels. 2718 higher calling stack levels.
2605 2719
2720 @ifhtml
2721 <A NAME="EXAMINE"></A>
2722 @end ifhtml
2606 @node Examining Variables, Custom Expression Examination, Debugging IDL Programs, The IDLWAVE Shell 2723 @node Examining Variables, Custom Expression Examination, Debugging IDL Programs, The IDLWAVE Shell
2607 @section Examining Variables 2724 @section Examining Variables
2608 @cindex @code{PRINT} expressions 2725 @cindex @code{PRINT} expressions
2609 @cindex @code{HELP}, on expressions 2726 @cindex @code{HELP}, on expressions
2610 @cindex Expressions, printing 2727 @cindex Expressions, printing
2902 @item 3019 @item
2903 Laurent Mugnier <mugnier@@onera.fr> 3020 Laurent Mugnier <mugnier@@onera.fr>
2904 @item 3021 @item
2905 Lubos Pochman <lubos@@rsinc.com> 3022 Lubos Pochman <lubos@@rsinc.com>
2906 @item 3023 @item
3024 Bob Portmann <portmann@@al.noaa.gov>
3025 @item
2907 Patrick M. Ryan <pat@@jaameri.gsfc.nasa.gov> 3026 Patrick M. Ryan <pat@@jaameri.gsfc.nasa.gov>
2908 @item 3027 @item
2909 Marty Ryba <ryba@@ll.mit.edu> 3028 Marty Ryba <ryba@@ll.mit.edu>
2910 @item 3029 @item
2911 Phil Williams <williams@@irc.chmcc.org> 3030 Phil Williams <williams@@irc.chmcc.org>
2948 @enumerate 3067 @enumerate
2949 @item 3068 @item
2950 @emph{Builtin routines} are defined inside IDL itself. The source 3069 @emph{Builtin routines} are defined inside IDL itself. The source
2951 code of such routines is not available. 3070 code of such routines is not available.
2952 @item 3071 @item
2953 Routines which are @emph{part of the current program}, defined in a 3072 Routines which are @emph{part of the current program}, are defined in a
2954 file which is explicitly compiled by the user. This file may or may not 3073 file explicitly compiled by the user. This file may or may not be
2955 be located on the IDL search path. 3074 located on the IDL search path.
2956 @item 3075 @item
2957 @emph{Library routines} are defined in files located on IDL's search 3076 @emph{Library routines} are defined in files located on IDL's search
2958 path, and will need not be manually compiled. When a library routine is 3077 path, and will not need to be manually compiled. When a library routine
2959 called for the first time, IDL will find the source file and compile it 3078 is called for the first time, IDL will find the source file and compile
2960 dynamically. A special sub-category of library routines are the 3079 it dynamically. A special sub-category of library routines are the
2961 @emph{system routines} distributed with IDL, and usually available in 3080 @emph{system routines} distributed with IDL, and usually available in
2962 the @file{lib} subdirectory of the IDL distribution. 3081 the @file{lib} subdirectory of the IDL distribution.
2963 @item 3082 @item
2964 External routines written in other languages (like Fortran or C) can be 3083 External routines written in other languages (like Fortran or C) can be
2965 called with @code{CALL_EXTERNAL}, linked into IDL via @code{LINKIMAGE}, 3084 called with @code{CALL_EXTERNAL}, linked into IDL via @code{LINKIMAGE},
3087 @code{idlwave-update-routine-info} with a double prefix argument: 3206 @code{idlwave-update-routine-info} with a double prefix argument:
3088 @w{@kbd{C-u C-u C-c C-i}}. This will rescan files in the previously 3207 @w{@kbd{C-u C-u C-c C-i}}. This will rescan files in the previously
3089 selected directories, write an updated version of the libinfo file and 3208 selected directories, write an updated version of the libinfo file and
3090 rebuild IDLWAVE's internal lists. If you give three prefix arguments 3209 rebuild IDLWAVE's internal lists. If you give three prefix arguments
3091 @w{@kbd{C-u C-u C-u C-c C-i}}, updating will be done with a background 3210 @w{@kbd{C-u C-u C-u C-c C-i}}, updating will be done with a background
3092 job@footnote{GNU and Unix systems only, I think.}. You can continue to work, 3211 job@footnote{Unix systems only, I think.}. You can continue to work,
3093 and the library catalog will be re-read when it is ready. 3212 and the library catalog will be re-read when it is ready.
3094 3213
3095 A note of caution: Depending on your local installation, the IDL 3214 A note of caution: Depending on your local installation, the IDL
3096 library can be very large. Parsing it for routine information will take 3215 library can be very large. Parsing it for routine information will take
3097 time and loading this information into Emacs can require a 3216 time and loading this information into Emacs can require a
3101 @defopt idlwave-libinfo-file 3220 @defopt idlwave-libinfo-file
3102 File for routine information of the IDL library. 3221 File for routine information of the IDL library.
3103 @end defopt 3222 @end defopt
3104 3223
3105 @defopt idlwave-library-path 3224 @defopt idlwave-library-path
3106 IDL library path for Windows and MacOS. Not needed under GNU and Unix. 3225 IDL library path for Windows and MacOS. Not needed under Unix.
3107 @end defopt 3226 @end defopt
3108 3227
3109 @defopt idlwave-system-directory 3228 @defopt idlwave-system-directory
3110 The IDL system directory for Windows and MacOS. Not needed under GNU and Unix. 3229 The IDL system directory for Windows and MacOS. Not needed under Unix.
3111 @end defopt 3230 @end defopt
3112 3231
3113 @defopt idlwave-special-lib-alist 3232 @defopt idlwave-special-lib-alist
3114 Alist of regular expressions matching special library directories. 3233 Alist of regular expressions matching special library directories.
3115 @end defopt 3234 @end defopt
3349 "print,size(___,/TNAME)")) 3468 "print,size(___,/TNAME)"))
3350 (idlwave-shell-define-key-both [f11] (idlwave-shell-examine 3469 (idlwave-shell-define-key-both [f11] (idlwave-shell-examine
3351 "help,___,/STRUCTURE")))) 3470 "help,___,/STRUCTURE"))))
3352 @end example 3471 @end example
3353 3472
3473 @ifhtml
3474 <A NAME="WIN_MAC"></A>
3475 @end ifhtml
3354 @node Windows and MacOS, Index, Configuration Examples, Top 3476 @node Windows and MacOS, Index, Configuration Examples, Top
3355 @appendix Windows and MacOS 3477 @appendix Windows and MacOS
3356 @cindex Windows 3478 @cindex Windows
3357 @cindex MacOS 3479 @cindex MacOS
3358 3480
3359 IDLWAVE was developed on a UNIX system. However, due to the portability 3481 IDLWAVE was developed on a UNIX system. However, due to the portability
3360 of Emacs, much of IDLWAVE does also work under different operating 3482 of Emacs, much of IDLWAVE does also work under different operating
3361 systems like Windows (with NTEmacs or NTXEmacs) or MacOS. 3483 systems like Windows (with NTEmacs or NTXEmacs) or MacOS.
3362 3484
3363 The only problem really is that RSI does not provide a command-line 3485 The only problem really is that RSI does not provide a command-line
3364 version of IDL for Windows or MacOS which IDLWAVE can interact 3486 version of IDL for Windows or MacOS with which IDLWAVE can
3365 with@footnote{Call your RSI representative and complain --- it should be 3487 interact@footnote{Call your RSI representative and complain --- it
3366 trivial for them to provide one. And if enough people ask for it, maybe 3488 should be trivial for them to provide one. And if enough people ask
3367 they will. The upcoming IDL for Mac OSX is slated to have a 3489 for it, maybe they will. The upcoming IDL for Mac OSX is slated to
3368 command-line version.}. Therefore the IDLWAVE Shell does not work and 3490 have a command-line version.}. Therefore the IDLWAVE Shell does not
3369 you have to rely on IDLDE to run and debug your programs. However, 3491 work and you have to rely on IDLDE to run and debug your programs.
3370 editing IDL source files with Emacs/IDLWAVE works with all bells and 3492 However, editing IDL source files with Emacs/IDLWAVE works with all
3371 whistles, including routine info, completion and fast online help. Only 3493 bells and whistles, including routine info, completion and fast online
3372 a small amount of additional information must be specified in your 3494 help. Only a small amount of additional information must be specified
3373 .emacs file: you must specify path names which on a GNU or UNIX system 3495 in your .emacs file: the path names which, on a UNIX system, are
3374 are automatically gathered by talking to the IDL program. 3496 automatically gathered by talking to the IDL program.
3375 3497
3376 Here is an example of the additional configuration needed for a Windows 3498 Here is an example of the additional configuration needed for a Windows
3377 system. I am assuming that IDLWAVE has been installed in 3499 system. I am assuming that IDLWAVE has been installed in
3378 @w{@samp{C:\Program Files\IDLWAVE}} and that IDL is installed in 3500 @w{@samp{C:\Program Files\IDLWAVE}} and that IDL is installed in
3379 @w{@samp{C:\RSI\IDL55}}. 3501 @w{@samp{C:\RSI\IDL55}}.