aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man/idlwave.texi560
1 files changed, 482 insertions, 78 deletions
diff --git a/man/idlwave.texi b/man/idlwave.texi
index b504a193153..8fadb52d049 100644
--- a/man/idlwave.texi
+++ b/man/idlwave.texi
@@ -9,12 +9,12 @@
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.2 12@set VERSION 4.7
13@set EDITION 4.2 13@set EDITION 4.7
14@set IDLVERSION 5.3 14@set IDLVERSION 5.4
15@set NSYSROUTINES 1251 15@set NSYSROUTINES 1287
16@set NSYSKEYWORDS 5287 16@set NSYSKEYWORDS 5724
17@set DATE June 2000 17@set DATE December 2000
18@set AUTHOR Carsten Dominik 18@set AUTHOR Carsten Dominik
19@set AUTHOR-EMAIL dominik@@astro.uva.nl 19@set AUTHOR-EMAIL dominik@@astro.uva.nl
20@set MAINTAINER Carsten Dominik 20@set MAINTAINER Carsten Dominik
@@ -108,6 +108,7 @@ shell.
108@menu 108@menu
109* Introduction:: What IDLWAVE is and what not 109* Introduction:: What IDLWAVE is and what not
110* IDLWAVE in a Nutshell:: One page quick-start guide 110* IDLWAVE in a Nutshell:: One page quick-start guide
111* Getting Started:: Tutorial
111* The IDLWAVE Major Mode:: The mode to edit IDL programs 112* The IDLWAVE Major Mode:: The mode to edit IDL programs
112* The IDLWAVE Shell:: The mode to run IDL as inferior program 113* The IDLWAVE Shell:: The mode to run IDL as inferior program
113* Installation:: How to Install or Upgrade 114* Installation:: How to Install or Upgrade
@@ -155,6 +156,7 @@ Debugging IDL Programs
155 156
156* Compiling Programs:: Compiling buffers under the shell 157* Compiling Programs:: Compiling buffers under the shell
157* Breakpoints and Stepping:: Deciding where to stop and look 158* Breakpoints and Stepping:: Deciding where to stop and look
159* Walking the Calling Stack:: From where was this routine called?
158* Examining Variables:: What is the value now? 160* Examining Variables:: What is the value now?
159 161
160Installation 162Installation
@@ -167,7 +169,7 @@ Sources of Routine Info
167 169
168* Routine Definitions:: Where IDL Routines are defined. 170* Routine Definitions:: Where IDL Routines are defined.
169* Routine Information Sources:: So how does IDLWAVE know about... 171* Routine Information Sources:: So how does IDLWAVE know about...
170* Library Scan:: Scanning the Libraries for Routine Info 172* Library Catalog:: Scanning the Libraries for Routine Info
171* Load-Path Shadows:: Routines defined in several places 173* Load-Path Shadows:: Routines defined in several places
172* Documentation Scan:: Scanning the IDL Manuals 174* Documentation Scan:: Scanning the IDL Manuals
173 175
@@ -269,10 +271,8 @@ things. For a full description of what a particular variable does and
269how to configure it, see the documentation string of that variable. 271how to configure it, see the documentation string of that variable.
270Some configuration examples are also given in the appendix. 272Some configuration examples are also given in the appendix.
271 273
272@node IDLWAVE in a Nutshell, The IDLWAVE Major Mode, Introduction, Top 274@node IDLWAVE in a Nutshell, Getting Started, Introduction, Top
273@chapter IDLWAVE in a Nutshell 275@chapter IDLWAVE in a Nutshell
274@cindex Quick-Start
275@cindex Getting Started
276@cindex Summary of important commands 276@cindex Summary of important commands
277@cindex IDLWAVE in a Nutshell 277@cindex IDLWAVE in a Nutshell
278@cindex Nutshell, IDLWAVE in a 278@cindex Nutshell, IDLWAVE in a
@@ -337,18 +337,345 @@ at point.
337;; Pad some operators with spaces 337;; Pad some operators with spaces
338(setq idlwave-do-actions t 338(setq idlwave-do-actions t
339 idlwave-surround-by-blank t) 339 idlwave-surround-by-blank t)
340;; Automatically expand END to ENDIF, ENDELSE, ...
341(setq idlwave-expand-generic-end t)
342;; Syntax Highlighting 340;; Syntax Highlighting
343(add-hook 'idlwave-mode-hook 'turn-on-font-lock) 341(add-hook 'idlwave-mode-hook 'turn-on-font-lock)
344;; Automatically start the shell when needed, in dedicated frame 342;; Automatically start the shell when needed
345(setq idlwave-shell-automatic-start t 343(setq idlwave-shell-automatic-start t)
346 idlwave-shell-use-dedicated-frame t) 344;; Bind debugging commands with CONTROL and SHIFT modifiers
345(setq idlwave-shell-debug-modifiers '(control shift))
347;; Where are the online help files? 346;; Where are the online help files?
348(setq idlwave-help-directory "~/.idlwave") 347(setq idlwave-help-directory "~/.idlwave")
349@end lisp 348@end lisp
350 349
351@node The IDLWAVE Major Mode, The IDLWAVE Shell, IDLWAVE in a Nutshell, Top 350@node Getting Started, The IDLWAVE Major Mode, IDLWAVE in a Nutshell, Top
351@chapter Getting Started (Tutorial)
352@cindex Quick-Start
353@cindex Tutorial
354@cindex Getting Started
355
356@section Lession I: Development Cycle
357
358The purpose of this tutorial is to guide you through a very basic
359development cycle with IDLWAVE. We will type a simple program into a
360buffer and use the shell to compile, debug and run this program. On the
361way we will use the most important commands in IDLWAVE. Note
362however that there is much more funtionality available in IDLWAVE than
363we cover here, and it will pay off greatly if eventually you go further
364and read the whole manual.
365
366I assume that you have access to Emacs or XEmacs with the full IDLWAVE
367package including online help (@pxref{Installation}). I also assume
368that you are familiar with Emacs and can read the nomenclature of key
369presses in Emacs (in particular, @kbd{C} stands for @key{CONTROL} and
370@kbd{M} for @key{META} (often the @key{ALT} key carries this
371functionality)).
372
373Open a new source file by typing
374
375@example
376@kbd{C-x C-f tutorial.pro @key{RET}}
377@end example
378
379A buffer for this file will pop up, and it should be in IDLWAVE mode.
380You can see this by looking at the mode line, just below the editing
381window. Also, the menu bar should contain entries @samp{IDLWAVE} and
382@samp{Debug}.
383
384Now cut-and-paste the following program, also available as
385@file{tutorial.pro} in the IDLWAVE distribution.
386
387@example
388function daynr,d,m,y
389 ;; compute a sequence number for a date
390 ;; works 1901-2099.
391 if y lt 100 then y = y+1900
392 if m le 2 then delta = 1 else delta = 0
393 m1 = m + delta*12 + 1
394 y1 = y * delta
395 return, d + floor(m1*30.6)+floor(y1*365.25)+5
396end
397
398function weekday,day,month,year
399 ;; compute weekday number for date
400 nr = daynr(day,month,year)
401 return, nr mod 7
402end
403
404pro plot_wday,day,month
405 ;; Plot the weekday of a date in the first 10 years of this century.
406 years = 2000,+indgen(10)
407 wdays = intarr(10)
408 for i=0,n_elements(wdays)-1 do begin
409 wdays[i] = weekday(day,month,years[i])
410 end
411 plot,years,wdays,YS=2,YT="Wday (0=sunday)"
412end
413@end example
414
415The indentation probably looks funny, since it's different from the
416settings you use, so use the @key{TAB} key in each line to automatically
417line it up (or more quickly @emph{select} the entire buffer with
418@kbd{C-x h} followed by @kbd{M-C-\}). Notice how different syntactical
419elements are highlighted in different colors, if you have set up support
420for font-lock.
421
422Let's check out two particular editing features of IDLWAVE. Place the
423cursor after the @code{end} statement of the @code{for} loop and press
424@key{SPC}. IDLWAVE blinks back to the beginning of the block and
425changes the generic @code{end} to the specific @code{endfor}
426automatically. Now place the cursor in any line you would like to split
427into two and press @kbd{M-@key{RET}}. The line is split at the cursor
428position, with the continuation @samp{$} and indentation all taken care
429of. Use @kbd{C-/} to undo the last change.
430
431The procedure @code{plot_wday} is supposed to plot the weekday of a given
432date for the first 10 years of the 21st century. I have put in a few
433bugs which we are going to fix now.
434
435First, let's launch the IDLWAVE shell. You do this with the command
436@kbd{C-c C-s}. The Emacs window will split and display IDL running in a
437shell interaction buffer. Type a few commands like @code{print,!PI} to
438convince yourself that you can work there like in an xterminal, or the
439IDLDE. Use the arrow keys to cycle through your command history. Are
440we having fun now?
441
442Now go back to the source window and type @kbd{C-c C-d C-c} to compile
443the program. If you watch the shell buffer, you see that IDLWAVE types
444@samp{.run tutorial.pro} for you. But the compilation fails because
445there is a comma in the line @samp{years=...}. The line with the error
446is highlighted and the cursor positioned at the error, so remove the
447comma (you should only need to hit Delete!). Compile again, using the
448same keystrokes as before. Notice that the file is saved for you. This
449time everything should work fine, and you should see the three routines
450compile.
451
452Now we want to use the command to plot the weekdays for January 1st. We
453could type the full command ourselves, but why do that? Go back to the
454shell window, type @samp{plot_} and hit @key{TAB}. After a bit of a
455delay (while IDLWAVE initializes its routine info database), the window
456will split to show all procedures it knows starting with that string,
457and @w{@code{plot_wday}} should be one of them. Saving the buffer was
458enough to tell IDLWAVE about this new routine. Click with the middle
459mouse button on @code{plot_wday} and it will be copied to the shell
460buffer, or if you prefer, add @samp{w} to @samp{plot_} to make it
461unambiguous, hit @key{TAB}, and the full routine name will be completed.
462Now provide the two arguments:
463
464@example
465plot_wday,1,1
466@end example
467
468
469and press @key{RET}. This fails with an error message telling you the
470@code{YT} keyword to plot is ambiguous. What are the allowed keywords
471again? Go back to the source window and put the cursor into the `plot'
472line, and press @kbd{C-c ?}. This pops up the routine info window for
473the plot routine, which contains a list of keywords, and the argument
474list. Oh, we wanted @code{YTITLE}. Fix that up. Recompile with
475@kbd{C-c C-d C-c}. Jump back into the shell with @kbd{C-c C-s}, press
476the @key{UP} arrow to recall the previous command and execute again.
477
478This time we get a plot, but it is pretty ugly -- the points are all
479connected with a line. Hmm, isn't there a way for @code{plot} to use
480symbols instead? What was that keyword? Position the cursor on the
481plot line after a comma (where you'd normally type a keyword), and hit
482@kbd{M-@key{Tab}}. A long list of plot's keywords appears. Aha, there
483it is, @code{PSYM}. Middle click to insert it. An @samp{=} sign is
484included for you too. Now what were the values of @code{PSYM} supposed
485to be? With the cursor on or after the keyword, press @kbd{M-?} for
486online help (alternatively, you could have right clicked on the colored
487keyword itself in the completion list). The online help window will pop
488up showing the documentation for the @code{PYSM} keyword. Ok, let's use
489diamonds=4. Fix this, recompile (you know the command by now: @kbd{C-c
490C-d C-c}, go back to the shell (if it's vanished, you know the command
491to recall it by now: @kbd{C-c C-s}) and execute again. Now things look
492pretty good.
493
494Lets try a different day - how about April fool's day?
495
496@example
497plot_wday,1,4
498@end example
499
500 Oops, this looks very wrong. All April fool's days cannot be
501Fridays! We've got a bug in the program, perhaps in the @code{daynr}
502function. Lets put a breakpoint on the last line there. Position the
503cursor on the @samp{return, d+...} line and press @kbd{C-c C-d C-b}.
504IDL sets a breakpoint (as you see in the shell window), and the line is
505highlighted in some way. Back to the shell buffer, re-execute the
506previous command. IDL stops at the line with the breakpoint. Now hold
507down the SHIFT key and click with the middle mouse button on a few
508variables there: @samp{d}, @samp{y}, @samp{m}, @samp{y1}, etc. Maybe
509@code{d} isn't the correct type. CONTROL-SHIFT middle-click on it for
510help. Well, it's an integer, so that's not the problem. Aha, @samp{y1}
511is zero, but it should be the year, depending on delta. Shift click
512@samp{delta} to see that it's 0. Below, we see the offending line:
513@samp{y1=y*delta...} the multiplication should have been a minus sign!
514So fix the line to
515
516@example
517y1 = y - delta
518@end example
519
520Now remove all breakpoints: @kbd{C-c C-d C-a}. Recompile and rerun the
521command. Everything should now work fine. How about those leap years?
522Change the code to plot 100 years and see that every 28 years, the
523sequence of weekdays repeats.
524
525@section Lession II: Customization
526
527Emacs is probably the most customizable piece of software available, and
528it would be a shame if you did not make use of this and adapt IDLWAVE to
529your own preferences. Customizing Emacs or IDLWAVE means that you have
530to set Lisp variables in the @file{.emacs} file in your home directory.
531This looks scary to many people because of all the parenthesis.
532However, you can just cut and paste the examples given here and work
533from there.
534
535Lets first use a boolean variable. These are variables which you turn
536on or off, much like a checkbox. A value of @samp{t} means on, a
537value of @samp{nil} means off. Copy the following line into your
538@file{.emacs} file, exit and restart Emacs.
539
540@lisp
541(setq idlwave-reserved-word-upcase t)
542@end lisp
543
544When this option is turned on, each reserved word you type into an IDL
545source buffer will be converted to upper case when you press @key{SPC}
546or @key{RET} right after the word. Try it out! @samp{if} changes to
547@samp{IF}, @samp{begin} to @samp{BEGIN}. If you don't like this
548behavior, remove the option again from your @file{.emacs} file.
549
550Now I bet you have your own indentation preferences for IDL code. For
551example, I like to indent the main block of an IDL program a bit,
552different from the conventions used by RSI. Also, I'd like to use only
5533 spaces as indentation between @code{BEGIN} and @code{END}. Try the
554following lines in @file{.emacs}
555
556@lisp
557(setq idlwave-main-block-indent 2)
558(setq idlwave-block-indent 3)
559(setq idlwave-end-offset -3)
560@end lisp
561
562Restart Emacs, take the program we developed in the first part of this
563tutorial and re-indent it with @kbd{C-c h} and @kbd{M-C-\}. You
564probably want to keep these lines in @file{.emacs}, with values adjusted
565to your likings. If you want to get more information about any of these
566variables, type, e.g., @kbd{C-h v idlwave-main-block-indent @key{RET}}.
567To find which variables can be customized, look for items marked
568@samp{User Option:} in the manual.
569
570If you cannot wrap your head around this Lisp stuff, there is another,
571more user-friendly way to customize all the IDLWAVE variables. You can
572access it through the IDLWAVE menu in one of the @file{.pro} buffers,
573option @code{Customize->Browse IDLWAVE Group}. Here you'll be presented
574with all the various variables grouped into categories. You can
575navigate the hierarchy (e.g. Idlwave Code Formatting->Idlwave Main Block
576Indent), read about the variables, change them, and `Save for Future
577Sessions'. Few of these variables need customization, but you can
578exercise considerable control over IDLWAVE's functionality with them.
579
580Many people I talk to find the key bindings used for the debugging
581commands too long and complicated. Do I always have to type @kbd{C-c
582C-d C-c} to get a single simple command? Due to Emacs rules and
583conventions I cannot make better bindings by default, but you can.
584First, there is a way to assign all debugging commands in a single sweep
585to other combinations. The only problem is that we have to use
586something which Emacs does not need for other important commands. A
587good option is to execute debugging commands by holding down
588@key{CONTROL} and @key{SHIFT} while pressing a single character:
589@kbd{C-S-b} for setting a breakpoint, @kbd{C-S-c} for compiling the
590current source file, @kbd{C-S-a} for deleting all breakpoints. You can
591have this with
592
593@lisp
594(setq idlwave-shell-debug-modifiers '(shift control))
595@end lisp
596
597If you have a special keyboard with for example a @key{HYPER} key, you
598could use
599
600@lisp
601(setq idlwave-shell-debug-modifiers '(hyper))
602@end lisp
603
604instead to get compilation on @kbd{H-c}.
605
606You can also assign specific commands to function keys. This you must
607do in the @emph{mode-hook}, a special function which is run when a new
608buffer gets set up. Keybindings can only be done when the buffer
609exists. The possibilities for key customization are endless. Here we
610set function keys f5-f8 to common debugging commands.
611
612@lisp
613;; First for the source buffer
614(add-hook 'idlwave-mode-hook
615 (lambda ()
616 (local-set-key [f5] 'idlwave-shell-break-here)
617 (local-set-key [f6] 'idlwave-shell-clear-current-bp)
618 (local-set-key [f7] 'idlwave-shell-cont)
619 (local-set-key [f8] 'idlwave-shell-clear-all-bp)))
620;; Then for the shell buffer
621(add-hook 'idlwave-shell-mode-hook
622 (lambda ()
623 (local-set-key [f5] 'idlwave-shell-break-here)
624 (local-set-key [f6] 'idlwave-shell-clear-current-bp)
625 (local-set-key [f7] 'idlwave-shell-cont)
626 (local-set-key [f8] 'idlwave-shell-clear-all-bp)))
627@end lisp
628
629@section Lession III: Library Catalog
630
631We have already used the routine info display in the first part of this
632tutorial. This was the key @kbd{C-c ?} which displays information about
633the IDL routine near the cursor position. Wouldn't it be nice
634to have the same available for your own library routines and for the
635huge amount of code in major extension libraries like JHUPL or the
636IDL-Astro library? To do this, you must give IDLWAVE a chance to study
637these routines first. We call this @emph{Building the library catalog}.
638
639From the IDLWAVE entry in the menu bar, select @code{Routine Info/Select
640Catalog Directories}. If necessary, start the shell first with @kbd{C-c
641C-s} (@pxref{Starting the Shell}). IDLWAVE will find out about the IDL
642@code{!PATH} variable and offer a list of directories on the path.
643Simply select them all (or whichever you want) and click on the
644@samp{Scan&Save} button. Then go for a cup of coffee while IDLWAVE
645collects information for each and every IDL routine on your search path.
646All this information is written to the file @file{.idlcat} in your home
647directory and will from now one be automatically loaded whenever you use
648IDLWAVE. Try to use routine info (@kbd{C-c ?}) or completion
649(@kbd{M-<TAB>}) while on any routine or partial routine name you know to
650be located in the library. E.g., if you have scanned the IDL-Astro
651library:
652
653@example
654 a=readf@key{M-<TAB>}
655@end example
656
657
658expands to `readfits('. Then try
659
660@example
661 a=readfits(@key{C-c ?}
662@end example
663
664and you get:
665
666@example
667Usage: Result = READFITS(filename, header, heap)
668...
669@end example
670
671I hope you made it until here. Now you are set to work with IDLWAVE.
672On the way you will want to change other things, and to learn more about
673the possibilities not discussed in this short tutorial. Read the
674manual, look at the documentation strings of interesting variables (with
675@kbd{C-h v idlwave<-variable-name> @key{RET}}) and ask the remaining
676questions on @code{comp.lang.idl-pvwave}.
677
678@node The IDLWAVE Major Mode, The IDLWAVE Shell, Getting Started, Top
352@chapter The IDLWAVE Major Mode 679@chapter The IDLWAVE Major Mode
353@cindex IDLWAVE major mode 680@cindex IDLWAVE major mode
354@cindex Major mode, @code{idlwave-mode} 681@cindex Major mode, @code{idlwave-mode}
@@ -626,7 +953,7 @@ This may indicate that your routine is shadowing a library routine,
626which may or may not be what you want (@pxref{Load-Path Shadows}). The 953which may or may not be what you want (@pxref{Load-Path Shadows}). The
627information about the calling sequence and the keywords is derived from 954information about the calling sequence and the keywords is derived from
628the first source listed. Library routines can only be supported if you 955the first source listed. Library routines can only be supported if you
629have scanned the local IDL library (@pxref{Library Scan}). The source 956have scanned the local IDL library (@pxref{Library Catalog}). The source
630entry consists of a @emph{source category}, a set of @emph{flags} and 957entry consists of a @emph{source category}, a set of @emph{flags} and
631the path to the @emph{source file}. The following categories 958the path to the @emph{source file}. The following categories
632exist: 959exist:
@@ -635,7 +962,7 @@ exist:
635@item @i{System} 962@item @i{System}
636@tab A system routine, but we do not know if it is @i{Builtin} or 963@tab A system routine, but we do not know if it is @i{Builtin} or
637@i{SystemLib}. When the system library has bee scanned 964@i{SystemLib}. When the system library has bee scanned
638(@pxref{Library Scan}), this category will automatically split into the 965(@pxref{Library Catalog}), this category will automatically split into the
639next two. 966next two.
640@item @i{Builtin} 967@item @i{Builtin}
641@tab A builtin routine with no source code available. 968@tab A builtin routine with no source code available.
@@ -659,7 +986,7 @@ with the variable @code{idlwave-special-lib-alist}.
659@cindex Multiply defined routines 986@cindex Multiply defined routines
660@cindex Routine definitions, multiple 987@cindex Routine definitions, multiple
661The flags @code{[CSB]} indicate if the file is known to IDLWAVE from the 988The flags @code{[CSB]} indicate if the file is known to IDLWAVE from the
662library catalog (@w{@code{[C--]}}, @pxref{Library Scan}), from the Shell 989library catalog (@w{@code{[C--]}}, @pxref{Library Catalog}), from the Shell
663(@w{@code{[-S-]}}) or from an Emacs buffer (@w{@code{[--B]}}). 990(@w{@code{[-S-]}}) or from an Emacs buffer (@w{@code{[--B]}}).
664Combinations are possible. If a file contains multiple definitions of 991Combinations are possible. If a file contains multiple definitions of
665the same routine, the file name will be prefixed with @samp{(Nx)} where 992the same routine, the file name will be prefixed with @samp{(Nx)} where
@@ -691,6 +1018,11 @@ Another click on the same line switches back to the buffer from which
691@kbd{C-c ?} was called. If you use the @emph{right} mouse button, the 1018@kbd{C-c ?} was called. If you use the @emph{right} mouse button, the
692source will not be visited by a buffer, but displayed in the online help 1019source will not be visited by a buffer, but displayed in the online help
693window. 1020window.
1021@item @i{Classes}
1022@tab The @i{Classes} line is only included in the routine info window if
1023the current class inherits from other classes. You can click with the
1024@emph{middle} mouse button to display routine info about the current
1025method in other classes on the inheritance chain.
694@end multitable 1026@end multitable
695 1027
696@defopt idlwave-resize-routine-help-window (@code{t}) 1028@defopt idlwave-resize-routine-help-window (@code{t})
@@ -870,6 +1202,10 @@ file.
870The face for links to IDLWAVE online help. 1202The face for links to IDLWAVE online help.
871@end defopt 1203@end defopt
872 1204
1205@defopt idlwave-help-activate-links-agressively (@code{t})
1206Non-@code{nil} means, make all possible links in help window active.
1207@end defopt
1208
873@node Completion, Routine Source, Online Help, The IDLWAVE Major Mode 1209@node Completion, Routine Source, Online Help, The IDLWAVE Major Mode
874@section Completion 1210@section Completion
875@cindex Completion 1211@cindex Completion
@@ -905,6 +1241,9 @@ x = obj_new('IDL* @r{Class name}
905x = obj_new('MyCl',a* @r{Keyword to @code{Init} method in class @code{MyCl}} 1241x = obj_new('MyCl',a* @r{Keyword to @code{Init} method in class @code{MyCl}}
906pro A* @r{Class name} 1242pro A* @r{Class name}
907pro * @r{Fill in @code{Class::} of first method in this file} 1243pro * @r{Fill in @code{Class::} of first method in this file}
1244!v* @r{System variable}
1245!version.t* @r{Structure tag of system variable}
1246self.g* @r{Class structure tag in methods}
908@end example 1247@end example
909 1248
910@cindex Scrolling the @file{*Completions*} window 1249@cindex Scrolling the @file{*Completions*} window
@@ -979,7 +1318,8 @@ current method in all available classes will be considered. In the
979will be shown next to the item (see option 1318will be shown next to the item (see option
980@code{idlwave-completion-show-classes}). As a special case, the class 1319@code{idlwave-completion-show-classes}). As a special case, the class
981of an object called @samp{self} object is always the class of the 1320of an object called @samp{self} object is always the class of the
982current routine. 1321current routine. All classes it inherits from are considered as well
1322where appropriate.
983 1323
984@cindex Forcing class query. 1324@cindex Forcing class query.
985@cindex Class query, forcing 1325@cindex Class query, forcing
@@ -996,6 +1336,10 @@ property in the object operator @samp{->}. This is not enabled by
996default - the variable @code{idlwave-store-inquired-class} can be used 1336default - the variable @code{idlwave-store-inquired-class} can be used
997to turn it on. 1337to turn it on.
998 1338
1339@defopt idlwave-support-inheritance (@code{t})
1340Non-@code{nil} means, treat inheritance with completion, online help etc.
1341@end defopt
1342
999@defopt idlwave-completion-show-classes (@code{1}) 1343@defopt idlwave-completion-show-classes (@code{1})
1000Non-@code{nil} means, show classes in @file{*Completions*} buffer when 1344Non-@code{nil} means, show classes in @file{*Completions*} buffer when
1001completing object methods and keywords. 1345completing object methods and keywords.
@@ -1055,7 +1399,7 @@ taken from context, but you get a chance to edit it.
1055 1399
1056@code{idlwave-resolve} is one way to get a library module within reach 1400@code{idlwave-resolve} is one way to get a library module within reach
1057of IDLWAVE's routine info collecting functions. A better way is to 1401of IDLWAVE's routine info collecting functions. A better way is to
1058scan (parts of) the library (@pxref{Library Scan}). Routine info on 1402scan (parts of) the library (@pxref{Library Catalog}). Routine info on
1059library modules will then be available without the need to compile the 1403library modules will then be available without the need to compile the
1060modules first, and even without a running shell. 1404modules first, and even without a running shell.
1061 1405
@@ -1115,7 +1459,7 @@ The templates are expanded in upper or lower case, depending upon the
1115variables @code{idlwave-abbrev-change-case} and 1459variables @code{idlwave-abbrev-change-case} and
1116@code{idlwave-reserved-word-upcase}. 1460@code{idlwave-reserved-word-upcase}.
1117 1461
1118@defopt idlwave-abbrev-start-char 1462@defopt idlwave-abbrev-start-char (@code{"\"})
1119A single character string used to start abbreviations in abbrev 1463A single character string used to start abbreviations in abbrev
1120mode. 1464mode.
1121@end defopt 1465@end defopt
@@ -1197,7 +1541,7 @@ Non-@code{nil} means point blinks to block beginning for
1197@code{idlwave-show-begin}. 1541@code{idlwave-show-begin}.
1198@end defopt 1542@end defopt
1199 1543
1200@defopt idlwave-expand-generic-end (@code{nil}) 1544@defopt idlwave-expand-generic-end (@code{t})
1201Non-@code{nil} means expand generic END to ENDIF/ENDELSE/ENDWHILE etc. 1545Non-@code{nil} means expand generic END to ENDIF/ENDELSE/ENDWHILE etc.
1202@end defopt 1546@end defopt
1203 1547
@@ -1498,13 +1842,22 @@ Hook for customizing @code{idlwave-shell-mode}.
1498 1842
1499The IDLWAVE shell works in the same fashion as other shell modes in 1843The IDLWAVE shell works in the same fashion as other shell modes in
1500Emacs. It provides command history, command line editing and job 1844Emacs. It provides command history, command line editing and job
1501control. Here is a list of commonly used commands. 1845control. The @key{UP} and @key{DOWN} arrows cycle through the input
1846history just like in an X terminal@footnote{This is different from
1847normal Emacs/Comint behavior, but more like an xterm. If you prefer the
1848default comint functionality, check the variable
1849@code{idlwave-shell-arrows-do-history}.}. Here is a list of
1850commonly used commands.
1502 1851
1503@multitable @columnfractions .12 .88 1852@multitable @columnfractions .12 .88
1853@item @key{UP}
1854@tab Cycle backwards in input history
1855@item @key{DOWN}
1856@tab Cycle forwards in input history
1504@item @kbd{M-p} 1857@item @kbd{M-p}
1505@tab Cycle backwards in input history matching input 1858@tab Cycle backwards in input history @emph{matching input}
1506@item @kbd{M-n} 1859@item @kbd{M-n}
1507@tab Cycle forwards 1860@tab Cycle forwards in input history @emph{matching input}
1508@item @kbd{M-r} 1861@item @kbd{M-r}
1509@tab Previous input matching a regexp 1862@tab Previous input matching a regexp
1510@item @kbd{M-s} 1863@item @kbd{M-s}
@@ -1559,12 +1912,24 @@ information on these commands.
1559@tab Compile a library routine (@code{idlwave-resolve}) 1912@tab Compile a library routine (@code{idlwave-resolve})
1560@end multitable 1913@end multitable
1561 1914
1915@defopt idlwave-shell-arrows-do-history (@code{t})
1916Non-@code{nil} means @key{UP} and @key{DOWN} arrows move through command
1917history like xterm.
1918@end defopt
1919
1920@defopt idlwave-shell-comint-settings
1921Alist of special settings for the comint variables in the IDLWAVE Shell.
1922@end defopt
1923
1562@defopt idlwave-shell-file-name-chars 1924@defopt idlwave-shell-file-name-chars
1563The characters allowed in file names, as a string. Used for file name 1925The characters allowed in file names, as a string. Used for file name
1564completion. 1926completion.
1565@end defopt 1927@end defopt
1566 1928
1567@page 1929@defopt idlwave-shell-graphics-window-size
1930Size of IDL graphics windows popped up by special IDLWAVE command.
1931@end defopt
1932
1568@cindex Input mode 1933@cindex Input mode
1569@cindex Character input mode (Shell) 1934@cindex Character input mode (Shell)
1570@cindex Line input mode (Shell) 1935@cindex Line input mode (Shell)
@@ -1609,11 +1974,21 @@ C-t} (@code{idlwave-shell-toggle-toolbar}).
1609 1974
1610The debugging keybindings are by default on the prefix key @kbd{C-c 1975The debugging keybindings are by default on the prefix key @kbd{C-c
1611C-d}, so for example setting a breakpoint is done with @kbd{C-c C-d 1976C-d}, so for example setting a breakpoint is done with @kbd{C-c C-d
1612C-b}. If you find this too much work and your ALT key is still 1977C-b}, compiling a source file with @kbd{C-c C-d C-c}. If you find this
1613available, turn on the variable 1978too much work you can choose a combination of modifier keys which is not
1614@code{idlwave-shell-activate-alt-keybindings} in order to get breakpoint 1979used by other commands. For example, if you write in @file{.emacs}
1615setting on @kbd{A-b}. In the remainder of this chapter we will assume 1980
1616that the @kbd{C-c C-d} bindings are active. 1981@lisp
1982(setq idlwave-shell-debug-modifiers '(control shift))
1983@end lisp
1984
1985a breakpoint can be set by pressing @kbd{b} while holding down
1986@kbd{shift} and @kbd{control} keys, i.e. @kbd{C-S-b}. Compiling a
1987source file will be on @kbd{C-S-c}, deleting a breakpoint @kbd{C-S-d}
1988etc. In the remainder of this chapter we will assume that the @kbd{C-c
1989C-d} bindings are active, but each of these bindings will have an
1990equivalent single-keypress shortcut with the modifiers given in the
1991@code{idlwave-shell-debug-modifiers} variable.
1617 1992
1618@defopt idlwave-shell-prefix-key (@kbd{C-c C-d}) 1993@defopt idlwave-shell-prefix-key (@kbd{C-c C-d})
1619The prefix key for the debugging map 1994The prefix key for the debugging map
@@ -1625,9 +2000,9 @@ Non-@code{nil} means, debug commands will be bound to the prefix
1625key, like @kbd{C-c C-d C-b}. 2000key, like @kbd{C-c C-d C-b}.
1626@end defopt 2001@end defopt
1627 2002
1628@defopt idlwave-shell-activate-alt-keybindings (@code{nil}) 2003@defopt idlwave-shell-debug-modifiers (@code{nil})
1629Non-@code{nil} means, debug commands will be bound to alternate 2004List of modifier keys to use for binding debugging commands in the shell
1630keys, like @kbd{A-b}. 2005and in source buffers.
1631@end defopt 2006@end defopt
1632 2007
1633@defopt idlwave-shell-use-toolbar (@code{t}) 2008@defopt idlwave-shell-use-toolbar (@code{t})
@@ -1639,6 +2014,7 @@ buffers.
1639@menu 2014@menu
1640* Compiling Programs:: Compiling buffers under the shell 2015* Compiling Programs:: Compiling buffers under the shell
1641* Breakpoints and Stepping:: Deciding where to stop and look 2016* Breakpoints and Stepping:: Deciding where to stop and look
2017* Walking the Calling Stack:: From where was this routine called?
1642* Examining Variables:: What is the value now? 2018* Examining Variables:: What is the value now?
1643@end menu 2019@end menu
1644 2020
@@ -1682,7 +2058,7 @@ The face which highlights the source line where IDL is
1682stopped. 2058stopped.
1683@end defopt 2059@end defopt
1684 2060
1685@node Breakpoints and Stepping, Examining Variables, Compiling Programs, Debugging IDL Programs 2061@node Breakpoints and Stepping, Walking the Calling Stack, Compiling Programs, Debugging IDL Programs
1686@subsection Breakpoints and Stepping 2062@subsection Breakpoints and Stepping
1687@cindex Breakpoints 2063@cindex Breakpoints
1688@cindex Stepping 2064@cindex Stepping
@@ -1693,16 +2069,23 @@ stopped.
1693You can set breakpoints and step through a program with IDLWAVE. 2069You can set breakpoints and step through a program with IDLWAVE.
1694Setting a breakpoint in the current line of the source buffer is done 2070Setting a breakpoint in the current line of the source buffer is done
1695with @kbd{C-c C-d C-b} (@code{idlwave-shell-break-here}). With a prefix 2071with @kbd{C-c C-d C-b} (@code{idlwave-shell-break-here}). With a prefix
1696arg of 1, the breakpoint gets a @code{/ONCE} keyword, meaning that it 2072arg of 1 (i.e. @kbd{C-1 C-c C-d C-b}, the breakpoint gets a @code{/ONCE}
1697will be deleted after first use. With a numeric prefix greater than 2073keyword, meaning that it will be deleted after first use. With a
1698one, the breakpoint will only be active the @code{nth} time it is hit. 2074numeric prefix greater than one, the breakpoint will only be active the
1699To clear the breakpoint in the current line, use @kbd{C-c C-d C-d} 2075@code{nth} time it is hit. To clear the breakpoint in the current line,
1700(@code{idlwave-clear-current-bp}). To clear all breakpoints, use 2076use @kbd{C-c C-d C-d} (@code{idlwave-clear-current-bp}). When executed
1701@kbd{C-c C-d C-a} (@code{idlwave-clear-all-bp}). Breakpoint lines are 2077from the shell window, the breakpoint where IDL is currently stopped
1702highlighted in the source code. 2078will be deleted. To clear all breakpoints, use @kbd{C-c C-d C-a}
1703 2079(@code{idlwave-clear-all-bp}). Breakpoint lines are highlighted in the
1704Once the program has stopped somewhere, you can step through it. Here 2080source code.
1705is a summary of the breakpoint and stepping commands: 2081
2082Once the program has stopped somewhere, you can step through it. The
2083most important stepping commands are @kbd{C-c C-d C-s} to execute one
2084line of IDL code; @kbd{C-c C-d C-n} to do one step but treat procedure
2085and function calls as a single step; @kbd{C-c C-d C-h} to continue
2086execution to the line where the cursor is in and @kbd{C-c C-d C-r} to
2087continue execution. Here is a summary of the breakpoint and stepping
2088commands:
1706 2089
1707@multitable @columnfractions .23 .77 2090@multitable @columnfractions .23 .77
1708@item @kbd{C-c C-d C-b} 2091@item @kbd{C-c C-d C-b}
@@ -1746,12 +2129,31 @@ The face for breakpoint lines in the source code if
1746@code{idlwave-shell-mark-breakpoints} has the value @code{face}. 2129@code{idlwave-shell-mark-breakpoints} has the value @code{face}.
1747@end defopt 2130@end defopt
1748 2131
1749@node Examining Variables, , Breakpoints and Stepping, Debugging IDL Programs 2132@node Walking the Calling Stack, Examining Variables, Breakpoints and Stepping, Debugging IDL Programs
2133@subsection Walking the Calling Stack
2134@cindex Calling stack, walking
2135
2136When debugging a program, it can be very useful to check in what context
2137the current routine was called, and why the arguments of the call are
2138the way they are. For this one needs to examine the calling stack. If
2139execution is stopped somewhere deep in a program, you can use the
2140commands @kbd{C-c C-d C-@key{UP}} (@code{idlwave-shell-stack-up}) and
2141@kbd{C-c C-d C-@key{DOWN}} (@code{idlwave-shell-stack-down}) or the
2142corresponding toolbar buttons to move through the calling stack. The
2143mode line of the shell window will indicate where you are on the stack
2144with a token like @samp{[-3:MYPRO]}, and the line of IDL code which did
2145the current call will be highlighted. When you continue execution,
2146IDLWAVE will automatically return to the current level. @xref{Examining
2147Variables} for information how to examine the value of variables and
2148expressions on higher calling stack levels.
2149
2150@node Examining Variables, , Walking the Calling Stack, Debugging IDL Programs
1750@subsection Examining Variables 2151@subsection Examining Variables
1751@cindex @code{PRINT} expressions 2152@cindex @code{PRINT} expressions
1752@cindex @code{HELP}, on expressions 2153@cindex @code{HELP}, on expressions
1753@cindex Expressions, printing 2154@cindex Expressions, printing
1754@cindex Expressions, help 2155@cindex Expressions, help
2156@cindex Printing expressions
1755@cindex Mouse binding to print expressions 2157@cindex Mouse binding to print expressions
1756 2158
1757@kindex C-c C-d C-p 2159@kindex C-c C-d C-p
@@ -1765,23 +2167,21 @@ argument will prompt for an expression instead of using the one at
1765point. 2167point.
1766 2168
1767It is very convenient to click with the mouse on expressions to retrieve 2169It is very convenient to click with the mouse on expressions to retrieve
1768their value. Expression printing is also bound to @kbd{S-mouse-2} and 2170their value. Use @kbd{S-mouse-2} to print an expression and
1769expression help to @kbd{C-S-mouse-2}. I.e. you need to hold down 2171@kbd{C-S-mouse-2} to get help on an expression. I.e. you need to hold
1770@key{SHIFT} and @key{CONTROL} while clicking with the mouse. 2172down @key{SHIFT} and @key{CONTROL} while clicking with the middle mouse
2173buton.
1771 2174
1772@cindex Calling stack, motion
1773@cindex Printing expressions, on calling stack 2175@cindex Printing expressions, on calling stack
1774@cindex Restrictions for expression printing 2176@cindex Restrictions for expression printing
1775Printing of expressions also works on higher levels of the calling 2177Printing of expressions also works on higher levels of the calling
1776stack. This means that you can examine the values of variables and 2178stack. This means that you can examine the values of variables and
1777expressions inside the routine which called the current routine etc. 2179expressions inside the routine which called the current routine etc.
1778Use the commands @kbd{C-c C-d C-@key{UP}} 2180@xref{Walking the Calling Stack} for information on how to step back to
1779(@code{idlwave-shell-stack-up}) and @kbd{C-c C-d C-@key{DOWN}} 2181higher levels on the calling stack. Commands which print values of
1780(@code{idlwave-shell-stack-down}) or the corresponding toolbar buttons 2182variables and expressions will then use the values of variables in the
1781to move through the calling stack. The mode line of the shell window 2183calling routine. The following restrictions apply for all levels except
1782will indicate the routine and the calling stack level which define the 2184the current:
1783context for printing expressions. The following restrictions apply for
1784all levels except the current:
1785 2185
1786@itemize @bullet 2186@itemize @bullet
1787@item 2187@item
@@ -1902,14 +2302,14 @@ The main contributors to the IDLWAVE package have been:
1902 2302
1903@itemize @minus 2303@itemize @minus
1904@item 2304@item
1905@uref{mailto:chase@@att.com, @b{Chris Chase}} wrote 2305@uref{mailto:chase@@att.com, @b{Chris Chase}}, the original author.
1906@file{idl.el} and @file{idl-shell.el} and maintained them for several 2306Chris wrote @file{idl.el} and @file{idl-shell.el} and maintained them
1907years. 2307for several years.
1908 2308
1909@item 2309@item
1910@uref{mailto:dominik@@astro.uva.nl, @b{Carsten Dominik}} has been in 2310@uref{mailto:dominik@@astro.uva.nl, @b{Carsten Dominik}}, current author
1911charge of the package since version 3.0. He renamed the package to 2311and maintainer. I have been in charge of the package since version
1912IDLWAVE, rewrote and added large parts and is the current maintainer. 23123.0. I am also responsible for the manual.
1913 2313
1914@item 2314@item
1915@uref{mailto:jdsmith@@astrosun.tn.cornell.edu, @b{J.D. Smith}} has 2315@uref{mailto:jdsmith@@astrosun.tn.cornell.edu, @b{J.D. Smith}} has
@@ -1937,6 +2337,8 @@ Xuyong Liu <liu@@stsci.edu>
1937@item 2337@item
1938Simon Marshall <Simon.Marshall@@esrin.esa.it> 2338Simon Marshall <Simon.Marshall@@esrin.esa.it>
1939@item 2339@item
2340Craig Markwardt <craigm@@cow.physics.wisc.edu>
2341@item
1940Laurent Mugnier <mugnier@@onera.fr> 2342Laurent Mugnier <mugnier@@onera.fr>
1941@item 2343@item
1942Lubos Pochman <lubos@@rsinc.com> 2344Lubos Pochman <lubos@@rsinc.com>
@@ -1965,7 +2367,7 @@ IDLWAVE must know about the accessible routines.
1965@menu 2367@menu
1966* Routine Definitions:: Where IDL Routines are defined. 2368* Routine Definitions:: Where IDL Routines are defined.
1967* Routine Information Sources:: So how does IDLWAVE know about... 2369* Routine Information Sources:: So how does IDLWAVE know about...
1968* Library Scan:: Scanning the Libraries for Routine Info 2370* Library Catalog:: Scanning the Libraries for Routine Info
1969* Load-Path Shadows:: Routines defined in several places 2371* Load-Path Shadows:: Routines defined in several places
1970* Documentation Scan:: Scanning the IDL Manuals 2372* Documentation Scan:: Scanning the IDL Manuals
1971@end menu 2373@end menu
@@ -2003,7 +2405,7 @@ cannot provide routine info and completion for external
2003routines. 2405routines.
2004@end enumerate 2406@end enumerate
2005 2407
2006@node Routine Information Sources, Library Scan, Routine Definitions, Sources of Routine Info 2408@node Routine Information Sources, Library Catalog, Routine Definitions, Sources of Routine Info
2007@section Routine Information Sources 2409@section Routine Information Sources
2008@cindex Routine info sources 2410@cindex Routine info sources
2009@cindex Builtin list of routines 2411@cindex Builtin list of routines
@@ -2046,7 +2448,7 @@ the shell again at any time.
2046@item 2448@item
2047IDLWAVE can scan all or selected library files and store the result in a 2449IDLWAVE can scan all or selected library files and store the result in a
2048file which will be automatically loaded just like 2450file which will be automatically loaded just like
2049@file{idlw-rinfo.el}. @xref{Library Scan}, for information how to 2451@file{idlw-rinfo.el}. @xref{Library Catalog}, for information how to
2050scan library files. 2452scan library files.
2051@end enumerate 2453@end enumerate
2052 2454
@@ -2063,9 +2465,10 @@ Non-@code{nil} means query the shell for info about compiled routines.
2063Controls under what circumstances routine info is updated automatically. 2465Controls under what circumstances routine info is updated automatically.
2064@end defopt 2466@end defopt
2065 2467
2066@node Library Scan, Load-Path Shadows, Routine Information Sources, Sources of Routine Info 2468@node Library Catalog, Load-Path Shadows, Routine Information Sources, Sources of Routine Info
2067@section Library Scan 2469@section Library Catalog
2068@cindex Library scan 2470@cindex Library scan
2471@cindex Library catalog
2069@cindex IDL library routine info 2472@cindex IDL library routine info
2070@cindex Windows 2473@cindex Windows
2071@cindex MacOS 2474@cindex MacOS
@@ -2126,7 +2529,7 @@ The IDL system directory for Windows and MacOS. Not needed under UNIX.
2126Alist of regular expressions matching special library directories. 2529Alist of regular expressions matching special library directories.
2127@end defopt 2530@end defopt
2128 2531
2129@node Load-Path Shadows, Documentation Scan, Library Scan, Sources of Routine Info 2532@node Load-Path Shadows, Documentation Scan, Library Catalog, Sources of Routine Info
2130@section Load-Path Shadows 2533@section Load-Path Shadows
2131@cindex Load-path shadows 2534@cindex Load-path shadows
2132@cindex Shadows, load-path 2535@cindex Shadows, load-path
@@ -2140,11 +2543,14 @@ IDLWAVE can compile a list of routines which are defined in several
2140different files. Since one definition will hide (shadow) the others 2543different files. Since one definition will hide (shadow) the others
2141depending on which file is compiled first, such multiple definitions are 2544depending on which file is compiled first, such multiple definitions are
2142called "load-path shadows". IDLWAVE has several routines to scan for 2545called "load-path shadows". IDLWAVE has several routines to scan for
2143load path shadows. The output is placed into s special buffer 2546load path shadows. The output is placed into the special buffer
2144@file{*Shadows*}. The format of the output is identical to the source 2547@file{*Shadows*}. The format of the output is identical to the source
2145section of the routine info buffer (@pxref{Routine Info}). Before 2548section of the routine info buffer (@pxref{Routine Info}). The
2146calling these routines, you should make sure that routine info is 2549different definitions of a routine are listed in the sequence of
2147up-to-date by pressing @kbd{C-c C-i}. Here are the different routines: 2550@emph{likelyhood of use}. So the first entry will be most likely the
2551one you'll get if an unsuspecting command uses that routine. Before
2552listing shadows, you should make sure that routine info is up-to-date by
2553pressing @kbd{C-c C-i}. Here are the different routines:
2148 2554
2149@table @asis 2555@table @asis
2150@item @kbd{M-x idlwave-list-buffer-load-path-shadows} 2556@item @kbd{M-x idlwave-list-buffer-load-path-shadows}
@@ -2158,8 +2564,7 @@ the application, use @code{RESOLVE_ALL} to compile any routines used by
2158your code, update the routine info inside IDLWAVE with @kbd{C-c C-i} and 2564your code, update the routine info inside IDLWAVE with @kbd{C-c C-i} and
2159then check for shadowing. 2565then check for shadowing.
2160@item @kbd{M-x idlwave-list-all-load-path-shadows} 2566@item @kbd{M-x idlwave-list-all-load-path-shadows}
2161This command finally checks all routines accessible to IDLWAVE for 2567This command checks all routines accessible to IDLWAVE for conflicts.
2162shadowing conflicts.
2163@end table 2568@end table
2164 2569
2165For these commands to work properly you should have scanned the entire 2570For these commands to work properly you should have scanned the entire
@@ -2239,8 +2644,7 @@ break with widely used standards.
2239have in my @file{.emacs}: 2644have in my @file{.emacs}:
2240 2645
2241@lisp 2646@lisp
2242(setq idlwave-shell-activate-alt-keybindings t 2647(setq idlwave-shell-debug-modifiers '(control shift)
2243 idlwave-expand-generic-end t
2244 idlwave-store-inquired-class t 2648 idlwave-store-inquired-class t
2245 idlwave-shell-automatic-start t 2649 idlwave-shell-automatic-start t
2246 idlwave-main-block-indent 2 2650 idlwave-main-block-indent 2