Mercurial > emacs
diff man/idlwave.texi @ 88155:d7ddb3e565de
sync with trunk
author | Henrik Enberg <henrik.enberg@telia.com> |
---|---|
date | Mon, 16 Jan 2006 00:03:54 +0000 |
parents | 23a1cea22d13 |
children |
line wrap: on
line diff
--- a/man/idlwave.texi Sun Jan 15 23:02:10 2006 +0000 +++ b/man/idlwave.texi Mon Jan 16 00:03:54 2006 +0000 @@ -2,35 +2,38 @@ @c %**start of header @setfilename ../info/idlwave @settitle IDLWAVE User Manual +@dircategory Emacs +@direntry +* IDLWAVE: (idlwave). Major mode and shell for IDL files. +@end direntry @synindex ky cp @syncodeindex vr cp @syncodeindex fn cp -@set VERSION 4.15 -@set EDITION 4.15 -@set IDLVERSION 5.5 -@set NSYSROUTINES 1324 -@set NSYSKEYWORDS 6129 -@set DATE September 2002 +@set VERSION 5.5 +@set EDITION 5.5 +@set IDLVERSION 6.1 +@set NSYSROUTINES 1850 +@set NSYSKEYWORDS 7685 +@set DATE March, 2005 @set AUTHOR J.D. Smith & Carsten Dominik -@set AUTHOR-EMAIL dominik@@astro.uva.nl +@set AUTHOR-EMAIL jdsmith@@as.arizona.edu @set MAINTAINER J.D. Smith @set MAINTAINER-EMAIL jdsmith@@as.arizona.edu -@set IDLWAVE-HOMEPAGE http://idlwave.org/ @c %**end of header - -@copying +@finalout + +@ifinfo This file documents IDLWAVE, a major mode for editing IDL files with Emacs, and interacting with an IDL shell run as a subprocess. This is edition @value{EDITION} of the IDLWAVE User Manual for IDLWAVE @value{VERSION} -Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software Foundation, -Inc. - -@quotation +Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. + Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.1 or +under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover texts being ``A GNU Manual'', and with the Back-Cover Texts as in (a) below. A copy of the @@ -45,27 +48,38 @@ Documentation License. If you want to distribute this document separately from the collection, you can do so by adding a copy of the license to the document, as described in section 6 of the license. -@end quotation -@end copying - -@dircategory Emacs -@direntry -* IDLWAVE: (idlwave). Major mode and shell for IDL files. -@end direntry - -@finalout +@end ifinfo @titlepage @title IDLWAVE User Manual @subtitle Emacs major mode and shell for IDL @subtitle Edition @value{EDITION}, @value{DATE} -@author by Carsten Dominik & J.D. Smith +@author by J.D. Smith & Carsten Dominik @page This is edition @value{EDITION} of the @cite{IDLWAVE User Manual} for IDLWAVE version @value{VERSION}, @value{DATE}. +@sp 2 +Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. +@sp 2 @cindex Copyright, of IDLWAVE -@insertcopying +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with the Front-Cover texts being ``A GNU +Manual'', and with the Back-Cover Texts as in (a) below. A copy of the +license is included in the section entitled ``GNU Free Documentation +License'' in the Emacs manual. + +(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify +this GNU Manual, like GNU software. Copies published by the Free +Software Foundation raise funds for GNU development.'' + +This document is part of a collection distributed under the GNU Free +Documentation License. If you want to distribute this document +separately from the collection, you can do so by adding a copy of the +license to the document, as described in section 6 of the license. @end titlepage @contents @@ -75,23 +89,23 @@ @node Top, Introduction, (dir), (dir) -IDLWAVE is a package which supports editing source for the -Interactive Data Language (IDL), and running IDL as an inferior -shell. +IDLWAVE is a package which supports editing source code written in the +Interactive Data Language (IDL), and running IDL as an inferior shell. @end ifnottex @menu -* Introduction:: What IDLWAVE is and what it's not +* Introduction:: What IDLWAVE is, and what it is not * IDLWAVE in a Nutshell:: One page quick-start guide * Getting Started:: Tutorial -* The IDLWAVE Major Mode:: The mode to edit IDL programs -* The IDLWAVE Shell:: The mode to run IDL as an inferior program -* Installation:: How to Install or Upgrade +* The IDLWAVE Major Mode:: The mode for editing IDL programs +* The IDLWAVE Shell:: The mode for running IDL as an inferior program * Acknowledgements:: Who did what -* Sources of Routine Info:: How does IDLWAVE know about routine XYZ -* Configuration Examples:: The user is king... +* Sources of Routine Info:: How does IDLWAVE know about routine XYZ +* HTML Help Browser Tips:: +* Configuration Examples:: The user is king * Windows and MacOS:: What still works, and how +* Troubleshooting:: When good computers turn bad * Index:: Fast access @detailmenu @@ -99,9 +113,9 @@ Getting Started (Tutorial) -* Lesson I -- Development Cycle:: -* Lesson II -- Customization:: -* Lesson III -- Library Catalog:: +* Lesson I -- Development Cycle:: +* Lesson II -- Customization:: +* Lesson III -- User Catalog:: The IDLWAVE Major Mode @@ -121,17 +135,22 @@ Code Formatting * Code Indentation:: Reflecting the logical structure -* Continued Statement Indentation:: +* Continued Statement Indentation:: * Comment Indentation:: Special indentation for comment lines * Continuation Lines:: Splitting statements over lines * Syntax Highlighting:: Font-lock support * Octals and Highlighting:: Why "123 causes problems +Online Help + +* Help with HTML Documentation:: +* Help with Source:: + Completion * Case of Completed Words:: CaseOFcomPletedWords * Object Method Completion and Class Ambiguity:: obj->Method, what? -* Object Method Completion in the Shell:: +* Object Method Completion in the Shell:: * Class and Keyword Inheritance:: obj->Method, _EXTRA=e * Structure Tag Completion:: Completing state.Tag @@ -145,78 +164,82 @@ * Starting the Shell:: How to launch IDL as a subprocess * Using the Shell:: Interactively working with the Shell -* Commands Sent to the Shell:: -* Debugging IDL Programs:: -* Examining Variables:: -* Custom Expression Examination:: +* Commands Sent to the Shell:: +* Debugging IDL Programs:: +* Examining Variables:: +* Custom Expression Examination:: Debugging IDL Programs -* Debug Key Bindings:: -* Compiling Programs:: -* Breakpoints and Stepping:: -* Walking the Calling Stack:: - -Installation - -* Installing IDLWAVE:: How to install the distribution -* Installing Online Help:: Where to get the additional files needed -* Upgrading from idl.el:: Necessary configuration changes +* A Tale of Two Modes:: +* Debug Key Bindings:: +* Breakpoints and Stepping:: +* Compiling Programs:: +* Walking the Calling Stack:: +* Electric Debug Mode:: Sources of Routine Info * Routine Definitions:: Where IDL Routines are defined. * Routine Information Sources:: So how does IDLWAVE know about... -* Library Catalog:: Scanning the Libraries for Routine Info +* Catalogs:: * Load-Path Shadows:: Routines defined in several places * Documentation Scan:: Scanning the IDL Manuals +Catalogs + +* Library Catalogs:: +* User Catalog:: + @end detailmenu @end menu @node Introduction, IDLWAVE in a Nutshell, Top, Top @chapter Introduction @cindex Introduction -@cindex CORBA (Common Object Request Broker Architecture) -@cindex Interface Definition Language @cindex Interactive Data Language @cindex cc-mode.el @cindex @file{idl.el} @cindex @file{idl-shell.el} @cindex Feature overview -IDLWAVE is a package which supports editing source files for the -Interactive Data Language (IDL@footnote{IDL is a registered trademark of -Research Systems, Inc., a Kodak Company}), and for running IDL as an -inferior shell@footnote{Note that this package has nothing to do with -the Interface Definition Language, part of the Common Object Request -Broker Architecture (CORBA)}. It can also be used for editing source -files for the related WAVE/CL language, but with only limited -support. - -IDLWAVE consists of two main parts: a major mode for editing IDL source -files files (@code{idlwave-mode}) and a mode for running the IDL program -as an inferior shell (@code{idlwave-shell-mode}). Although one mode can -be used without the other, both work together closely to form a complete -development environment. Here is a brief summary of what IDLWAVE does: +IDLWAVE is a package which supports editing source files written in +the Interactive Data Language, and running +IDL as an inferior shell@footnote{Note that this package has nothing +to do with the Interface Definition Language, part of the Common +Object Request Broker Architecture (CORBA)}@footnote{IDLWAVE can also +be used for editing source files for the related WAVE/CL language, but +with only limited support.}. It is a feature-rich replacement for the +IDLDE development environment included with IDL, and uses the full +power of Emacs to make editing and running IDL programs easier, +quicker, and more structured. + +IDLWAVE consists of two main parts: a major mode for editing IDL +source files (@code{idlwave-mode}) and a mode for running the IDL +program as an inferior shell (@code{idlwave-shell-mode}). Although +one mode can be used without the other, both work together closely to +form a complete development environment. Here is a brief summary of +what IDLWAVE does: @itemize @bullet -@item -Code indentation and formatting. +@item +Smart code indentation and automatic-formatting. @item Three level syntax highlighting support. -@item +@item Context-sensitive display of calling sequences and keywords for more -than 1000 native IDL routines, extendible to any number of additional -routines in your local IDL libraries. +than 1000 native IDL routines, extendible to any additional number of +local routines, and already available with many pre-scanned libraries. +@item +Routine name space conflict search with likelihood-of-use ranking. @item -Routine name space conflict search, likelihood-of-use ranking. -@item -Fast, context-sensitive online help. +Fast, context-sensitive online HTML help, or source-header help for +undocumented routines. @item -Context sensitive completion of routine names and keywords. +Context sensitive completion of routine names, keywords, system +variables, class names and much more. @item -Easy insertion of code templates. +Easy insertion of code templates and abbreviations of common constructs. @item Automatic corrections to enforce a variety of customizable coding standards. @@ -231,8 +254,8 @@ editing and all the completion and routine info capabilities present in IDL source buffers. @item -Compilation, execution and interactive debugging of programs directly -from the source buffer. +Compilation, execution and interactive single-keystroke debugging of +programs directly from the source buffer. @item Quick, source-guided navigation of the calling stack, with variable inspection, etc. @@ -261,12 +284,10 @@ @end itemize @end ifnottex -IDLWAVE is the successor to the @file{idl.el} and @file{idl-shell.el} -files written by Chris Chase. The modes and files had to be renamed -because of a name space conflict with CORBA's @code{idl-mode}, defined in -Emacs in the file @file{cc-mode.el}. If you have been using the old -files, check @ref{Upgrading from idl.el} for information on how to -switch. +IDLWAVE is the distant successor to the @file{idl.el} and +@file{idl-shell.el} files written by Chris Chase. The modes and files +had to be renamed because of a name space conflict with CORBA's +@code{idl-mode}, defined in Emacs in the file @file{cc-mode.el}. In this manual, each section ends with a list of related user options. Don't be confused by the sheer number of options available --- in most @@ -307,6 +328,8 @@ @tab Update IDLWAVE's knowledge about functions and procedures. @item @kbd{C-c C-v} @tab Visit the source code of a procedure/function. +@item @kbd{C-u C-c C-v} +@tab Visit the source code of a procedure/function in this buffer. @item @kbd{C-c C-h} @tab Insert a standard documentation header. @item @kbd{C-c @key{RET}} @@ -322,16 +345,22 @@ @tab Cycle back through IDL command history. @item @kbd{M-n} @tab Cycle forward. -@item @kbd{M-@key{TAB}} +@item @kbd{@key{TAB}} @tab Complete a procedure name, function name or keyword in the shell buffer. @item @kbd{C-c C-d C-c} @tab Save and compile the source file in the current buffer. @item @kbd{C-c C-d C-x} -@tab Goto next syntax error. +@tab Go to next syntax error. +@item @kbd{C-c C-d C-v} +@tab Switch to electric debug mode. @item @kbd{C-c C-d C-b} @tab Set a breakpoint at the nearest viable source line. @item @kbd{C-c C-d C-d} @tab Clear the nearest breakpoint. +@item @kbd{C-c C-d [} +@tab Go to the previous breakpoint. +@item @kbd{C-c C-d ]} +@tab Go to the next breakpoint. @item @kbd{C-c C-d C-p} @tab Print the value of the expression near point in IDL. @end multitable @@ -353,8 +382,6 @@ (setq idlwave-shell-automatic-start t) ;; Bind debugging commands with CONTROL and SHIFT modifiers (setq idlwave-shell-debug-modifiers '(control shift)) -;; Specify the online help files' location. -(setq idlwave-help-directory "~/.idlwave") @end lisp @ifhtml @@ -367,27 +394,27 @@ @cindex Getting Started @menu -* Lesson I -- Development Cycle:: -* Lesson II -- Customization:: -* Lesson III -- Library Catalog:: +* Lesson I -- Development Cycle:: +* Lesson II -- Customization:: +* Lesson III -- User Catalog:: @end menu @node Lesson I -- Development Cycle, Lesson II -- Customization, Getting Started, Getting Started @section Lesson I: Development Cycle The purpose of this tutorial is to guide you through a very basic -development cycle using IDLWAVE. We will paste a simple program into a -buffer and use the shell to compile, debug and run it. On the way we -will use many of the important IDLWAVE commands. Note however that -there are many more capabilities in IDLWAVE than covered here, which can -be discovered by reading the entire manual. +development cycle using IDLWAVE. We will paste a simple program into +a buffer and use the shell to compile, debug and run it. On the way +we will use many of the important IDLWAVE commands. Note, however, +that IDLWAVE has many more capabilities than covered here, which can +be discovered by reading the entire manual, or hovering over the +shoulder of your nearest IDLWAVE guru for a few days. It is assumed that you have access to Emacs or XEmacs with the full -IDLWAVE package including online help (@pxref{Installation}). We also -assume that you are familiar with Emacs and can read the nomenclature of -key presses in Emacs (in particular, @kbd{C} stands for @key{CONTROL} -and @kbd{M} for @key{META} (often the @key{ALT} key carries this -functionality)). +IDLWAVE package including online help. We also assume that you are +familiar with Emacs and can read the nomenclature of key presses in +Emacs (in particular, @kbd{C} stands for @key{CONTROL} and @kbd{M} for +@key{META} (often the @key{ALT} key carries this functionality)). Open a new source file by typing: @@ -395,9 +422,9 @@ @kbd{C-x C-f tutorial.pro @key{RET}} @end example -A buffer for this file will pop up, and it should be in IDLWAVE mode, as -shown in the mode line just below the editing window. Also, the menu -bar should contain entries @samp{IDLWAVE} and @samp{Debug}. +A buffer for this file will pop up, and it should be in IDLWAVE mode, +indicated in the mode line just below the editing window. Also, the +menu bar should contain @samp{IDLWAVE}. Now cut-and-paste the following code, also available as @file{tutorial.pro} in the IDLWAVE distribution. @@ -412,13 +439,13 @@ y1 = y * delta return, d + floor(m1*30.6)+floor(y1*365.25)+5 end - + function weekday,day,month,year ;; compute weekday number for date nr = daynr(day,month,year) return, nr mod 7 end - + pro plot_wday,day,month ;; Plot the weekday of a date in the first 10 years of this century. years = 2000,+indgen(10) @@ -431,31 +458,35 @@ @end example The indentation probably looks funny, since it's different from the -settings you use, so use the @key{TAB} key in each line to automatically -line it up (or more quickly @emph{select} the entire buffer with -@kbd{C-x h}, and indent the whole region with @kbd{C-M-\}). Notice how -different syntactical elements are highlighted in different colors, if -you have set up support for font-lock. +settings you use, so use the @key{TAB} key in each line to +automatically line it up (or, more quickly, @emph{select} the entire +buffer with @kbd{C-x h}, and indent the whole region with +@kbd{C-M-\}). Notice how different syntactical elements are +highlighted in different colors, if you have set up support for +font-lock. Let's check out two particular editing features of IDLWAVE. Place the cursor after the @code{end} statement of the @code{for} loop and press @key{SPC}. IDLWAVE blinks back to the beginning of the block and changes the generic @code{end} to the specific @code{endfor} -automatically. Now place the cursor in any line you would like to split -and press @kbd{M-@key{RET}}. The line is split at the cursor position, -with the continuation @samp{$} and indentation all taken care of. Use -@kbd{C-/} to undo the last change. - -The procedure @code{plot_wday} is supposed to plot the weekday of a -given date for the first 10 years of the 21st century. As in most code, -there are a few bugs, which we are going to use IDLWAVE to help us fix. +automatically (as long as the variable @code{idlwave-expand-generic-end} +is turned on --- @pxref{Lesson II -- Customization}). Now place the +cursor in any line you would like to split and press @kbd{M-@key{RET}}. +The line is split at the cursor position, with the continuation @samp{$} +and indentation all taken care of. Use @kbd{C-/} to undo the last +change. + +The procedure @code{plot_wday} is supposed to plot the day of the week +of a given date for the first 10 years of the 21st century. As in +most code, there are a few bugs, which we are going to use IDLWAVE to +help us fix. First, let's launch the IDLWAVE shell. You do this with the command -@kbd{C-c C-s}. The Emacs window will split and display IDL running in a -shell interaction buffer. Type a few commands like @code{print,!PI} to -convince yourself that you can work there just as well as in a terminal, -or the IDLDE. Use the arrow keys to cycle through your command history. -Are we having fun now? +@kbd{C-c C-s}. The Emacs window will split or another window will popup +to display IDL running in a shell interaction buffer. Type a few +commands like @code{print,!PI} to convince yourself that you can work +there just as well as in a terminal, or the IDLDE. Use the arrow keys +to cycle through your command history. Are we having fun now? Now go back to the source window and type @kbd{C-c C-d C-c} to compile the program. If you watch the shell buffer, you see that IDLWAVE types @@ -469,44 +500,47 @@ Now we want to use the command to plot the day of the week on January 1st. We could type the full command ourselves, but why do that? Go -back to the shell window, type @samp{plot_} and hit @key{TAB}. After a -bit of a delay (while IDLWAVE initializes its routine info database, if -necessary), the window will split to show all procedures it knows +back to the shell window, type @samp{plot_} and hit @key{TAB}. After +a bit of a delay (while IDLWAVE initializes its routine info database, +if necessary), the window will split to show all procedures it knows starting with that string, and @w{@code{plot_wday}} should be one of -them. Saving the buffer alerted IDLWAVE about this new routine. Click -with the middle mouse button on @code{plot_wday} and it will be copied -to the shell buffer, or if you prefer, add @samp{w} to @samp{plot_} to -make it unambiguous, hit @key{TAB} again, and the full routine name will -be completed. Now provide the two arguments: +them. Saving the buffer alerted IDLWAVE about this new routine. +Click with the middle mouse button on @code{plot_wday} and it will be +copied to the shell buffer, or if you prefer, add @samp{w} to +@samp{plot_} to make it unambiguous (depending on what other routines +starting with @samp{plot_} you have installed on your system), hit +@key{TAB} again, and the full routine name will be completed. Now +provide the two arguments: @example plot_wday,1,1 @end example -and press @key{RET}. This fails with an error message telling you the -@code{YT} keyword to plot is ambiguous. What are the allowed keywords -again? Go back to the source window and put the cursor into the `plot' -line, and press @kbd{C-c ?}. This shows the routine info window for the -plot routine, which contains a list of keywords, along with the argument -list. Oh, we wanted @code{YTITLE}. Fix that up. Recompile with -@kbd{C-c C-d C-c}. Jump back into the shell with @kbd{C-c C-s}, press -the @key{UP} arrow to recall the previous command and execute again. +@noindent and press @key{RET}. This fails with an error message telling +you the @code{YT} keyword to plot is ambiguous. What are the allowed +keywords again? Go back to the source window and put the cursor into +the `plot' line and press @kbd{C-c ?}. This shows the routine info +window for the plot routine, which contains a list of keywords, along +with the argument list. Oh, we wanted @code{YTITLE}. Fix that up. +Recompile with @kbd{C-c C-d C-c}. Jump back into the shell with +@kbd{C-c C-s}, press the @key{UP} arrow to recall the previous command +and execute again. This time we get a plot, but it is pretty ugly --- the points are all connected with a line. Hmm, isn't there a way for @code{plot} to use symbols instead? What was that keyword? Position the cursor on the plot line after a comma (where you'd normally type a keyword), and hit -@kbd{M-@key{Tab}}. A long list of plot's keywords appears. Aha, there -it is, @code{PSYM}. Middle click to insert it. An @samp{=} sign is -included for you too. Now what were the values of @code{PSYM} supposed -to be? With the cursor on or after the keyword, press @kbd{M-?} for -online help (alternatively, you could have right clicked on the colored -keyword itself in the completion list). The online help window will pop -up showing the documentation for the @code{PYSM} keyword. OK, let's use -diamonds=4. Fix this, recompile (you know the command by now: @kbd{C-c -C-d C-c}, go back to the shell (if it's vanished, you know the command -to recall it by now: @kbd{C-c C-s}) and execute again. Now things look -pretty good. +@kbd{M-@key{Tab}}. A long list of plot's keywords appears. Aha, +there it is, @code{PSYM}. Middle click to insert it. An @samp{=} +sign is included for you too. Now what were the values of @code{PSYM} +supposed to be? With the cursor on or after the keyword, press +@kbd{M-?} for online help (alternatively, you could have right clicked +on the colored keyword itself in the completion list). A browser will +pop up showing the HTML documentation for the @code{PYSM} keyword. +OK, let's use diamonds=4. Fix this, recompile (you know the command +by now: @kbd{C-c C-d C-c}), go back to the shell (if it's vanished, +you know what to do: @kbd{C-c C-s}) and execute again. Now things +look pretty good. Let's try a different day --- how about April fool's day? @@ -518,16 +552,17 @@ We've got a bug in the program, perhaps in the @code{daynr} function. Let's put a breakpoint on the last line there. Position the cursor on the @samp{return, d+...} line and press @kbd{C-c C-d C-b}. IDL sets a -breakpoint (as you see in the shell window), and the line is highlighted -in some way. Back to the shell buffer, re-execute the previous command. -IDL stops at the line with the breakpoint. Now hold down the SHIFT key -and click with the middle mouse button on a few variables there: -@samp{d}, @samp{y}, @samp{m}, @samp{y1}, etc. Maybe @code{d} isn't the -correct type. CONTROL-SHIFT middle-click on it for help. Well, it's an -integer, so that's not the problem. Aha, @samp{y1} is zero, but it -should be the year, depending on delta. Shift click @samp{delta} to see -that it's 0. Below, we see the offending line: @samp{y1=y*delta...} the -multiplication should have been a minus sign! So fix the line to read: +breakpoint (as you see in the shell window), and the break line is +indicated. Back to the shell buffer, re-execute the previous command. +IDL stops at the line with the breakpoint. Now hold down the SHIFT +key and click with the middle mouse button on a few variables there: +@samp{d}, @samp{y}, @samp{m}, @samp{y1}, etc. Maybe @code{d} isn't +the correct type. CONTROL-SHIFT middle-click on it for help. Well, +it's an integer, so that's not the problem. Aha, @samp{y1} is zero, +but it should be the year, depending on delta. Shift click +@samp{delta} to see that it's 0. Below, we see the offending line: +@samp{y1=y*delta...} the multiplication should have been a minus sign! +Hit @kbd{q} to exit the debugging mode, and fix the line to read: @example y1 = y - delta @@ -538,15 +573,15 @@ Change the code to plot 100 years and see that every 28 years, the sequence of weekdays repeats. -@node Lesson II -- Customization, Lesson III -- Library Catalog, Lesson I -- Development Cycle, Getting Started +@node Lesson II -- Customization, Lesson III -- User Catalog, Lesson I -- Development Cycle, Getting Started @section Lesson II: Customization -Emacs is probably the most customizable piece of software available, and -it would be a shame if you did not make use of this and adapt IDLWAVE to -your own preferences. Customizing Emacs or IDLWAVE is accomplished by -setting Lisp variables in the @file{.emacs} file in your home directory ---- but do not be dismayed; for the most part, you can just copy and work -from the examples given here. +Emacs is probably the most customizable piece of software ever +written, and it would be a shame if you did not make use of this and +adapt IDLWAVE to your own preferences. Customizing Emacs or IDLWAVE +is accomplished by setting Lisp variables in the @file{.emacs} file in +your home directory --- but do not be dismayed; for the most part, you +can just copy and work from the examples given here. Let's first use a boolean variable. These are variables which you turn on or off, much like a checkbox. A value of @samp{t} means on, a value @@ -561,13 +596,13 @@ source buffer will be converted to upper case when you press @key{SPC} or @key{RET} right after the word. Try it out! @samp{if} changes to @samp{IF}, @samp{begin} to @samp{BEGIN}. If you don't like this -behavior, remove the option again from your @file{.emacs} file. +behavior, remove the option again from your @file{.emacs} file and +restart Emacs. You likely have your own indentation preferences for IDL code. For example, some like to indent the main block of an IDL program from the -margin, different from the conventions used by RSI, and use only 3 -spaces as indentation between @code{BEGIN} and @code{END}. Try the -following lines in @file{.emacs}: +margin and use only 3 spaces as indentation between @code{BEGIN} and +@code{END}. Try the following lines in @file{.emacs}: @lisp (setq idlwave-main-block-indent 2) @@ -588,50 +623,52 @@ variables. You can access it through the IDLWAVE menu in one of the @file{.pro} buffers, menu item @code{Customize->Browse IDLWAVE Group}. Here you'll be presented with all the various variables grouped -into categories. You can navigate the hierarchy (e.g. Idlwave Code -Formatting->Idlwave Main Block Indent), read about the variables, change -them, and `Save for Future Sessions'. Few of these variables need -customization, but you can exercise considerable control over IDLWAVE's -functionality with them. +into categories. You can navigate the hierarchy (e.g. @samp{IDLWAVE +Code Formatting->Idlwave Abbrev And Indent Action->Idlwave Expand +Generic End} to turn on @code{END} expansion), read about the variables, +change them, and `Save for Future Sessions'. Few of these variables +need customization, but you can exercise considerable control over +IDLWAVE's functionality with them. You may also find the key bindings used for the debugging commands too -long and complicated. Often we have heard such complaints, ``Do I -really have to type @kbd{C-c C-d C-c} to run a simple command?'' Due to -Emacs rules and conventions, shorter bindings cannot be set by default, -but you can enable them. First, there is a way to assign all debugging -commands in a single sweep to other combinations. The only problem is -that we have to use something which Emacs does not need for other -important commands. One good option is to execute debugging commands by -holding down @key{CONTROL} and @key{SHIFT} while pressing a single -character: @kbd{C-S-b} for setting a breakpoint, @kbd{C-S-c} for -compiling the current source file, @kbd{C-S-a} for deleting all -breakpoints. You can enable this with: +long and complicated. Often we have heard complaints along the lines +of, ``Do I really have to go through the finger gymnastics of @kbd{C-c +C-d C-c} to run a simple command?'' Due to Emacs rules and +conventions, shorter bindings cannot be set by default, but you can +easily enable them. First, there is a way to assign all debugging +commands in a single sweep to another simpler combination. The only +problem is that we have to use something which Emacs does not need for +other important commands. One good option is to execute debugging +commands by holding down @key{CONTROL} and @key{SHIFT} while pressing +a single character: @kbd{C-S-b} for setting a breakpoint, @kbd{C-S-c} +for compiling the current source file, @kbd{C-S-a} for deleting all +breakpoints (try it, it's easier). You can enable this with: @lisp (setq idlwave-shell-debug-modifiers '(shift control)) @end lisp @noindent If you have a special keyboard with, for example, a -@key{HYPER} key, you could even shorten that: +@key{SUPER} key, you could even shorten that: @lisp -(setq idlwave-shell-debug-modifiers '(hyper)) +(setq idlwave-shell-debug-modifiers '(super)) @end lisp -@noindent to get compilation on @kbd{H-c}. Often, a modifier key like -@key{HYPER} or @key{SUPER} is bound or can be bound to an otherwise -unused key -- consult your system documentation. +@noindent to get compilation on @kbd{S-c}. Often, a modifier key like +@key{SUPER} or @key{HYPER} is bound or can be bound to an otherwise +unused key on your keyboard --- consult your system documentation. You can also assign specific commands to keys. This you must do in the -@emph{mode-hook}, a special function which is run when a new buffer gets -set up. Keybindings can only be done when the buffer exists. The -possibilities for key customization are endless. Here we set function -keys f5-f8 to common debugging commands. +@emph{mode-hook}, a special function which is run when a new IDLWAVE +buffer gets set up. The possibilities for key customization are +endless. Here we set function keys f4-f8 to common debugging commands. @lisp ;; First for the source buffer (add-hook 'idlwave-mode-hook (lambda () + (local-set-key [f4] 'idlwave-shell-retall) (local-set-key [f5] 'idlwave-shell-break-here) (local-set-key [f6] 'idlwave-shell-clear-current-bp) (local-set-key [f7] 'idlwave-shell-cont) @@ -639,43 +676,53 @@ ;; Then for the shell buffer (add-hook 'idlwave-shell-mode-hook (lambda () + (local-set-key [f4] 'idlwave-shell-retall) (local-set-key [f5] 'idlwave-shell-break-here) (local-set-key [f6] 'idlwave-shell-clear-current-bp) (local-set-key [f7] 'idlwave-shell-cont) (local-set-key [f8] 'idlwave-shell-clear-all-bp))) @end lisp -@node Lesson III -- Library Catalog, , Lesson II -- Customization, Getting Started -@section Lesson III: Library Catalog +@node Lesson III -- User Catalog, , Lesson II -- Customization, Getting Started +@section Lesson III: User and Library Catalogs We have already used the routine info display in the first part of this -tutorial. This was the key @kbd{C-c ?} which displays information about -the IDL routine near the cursor position. Wouldn't it be nice -to have the same available for your own library routines and for the -huge amount of code in major extension libraries like JHUPL or the -IDL-Astro library? To do this, you must give IDLWAVE a chance to study -these routines first. We call this @emph{Building the library catalog}. - -From the IDLWAVE entry in the menu bar, select @code{Routine Info/Select -Catalog Directories}. If necessary, start the shell first with @kbd{C-c -C-s} (@pxref{Starting the Shell}). IDLWAVE will find out about the IDL -@code{!PATH} variable and offer a list of directories on the path. -Simply select them all (or whichever you want) and click on the -@samp{Scan&Save} button. Then go for a cup of coffee while IDLWAVE -collects information for each and every IDL routine on your search path. -All this information is written to the file @file{.idlcat} in your home -directory and will from now one be automatically loaded whenever you use +tutorial. This was the invoked using @kbd{C-c ?}, and displays +information about the IDL routine near the cursor position. Wouldn't it +be nice to have the same kind of information available for your own +routines and for the huge amount of code in major libraries like JHUPL +or the IDL-Astro library? In many cases, you may already have this +information. Files named @file{.idlwave_catalog} in library directories +contain scanned information on the routines in that directory; many +popular libraries ship with these ``library catalogs'' pre-scanned. +Users can scan their own routines in one of two ways: either using the +supplied tool to scan directories and build their own +@file{.idlwave_catalog} files, or using the built-in method to create a +single ``user catalog'', which we'll show here. @xref{Catalogs}, for +more information on choosing which method to use. + +To build a user catalog, select @code{Routine Info/Select Catalog +Directories} from the IDLWAVE entry in the menu bar. If necessary, +start the shell first with @kbd{C-c C-s} (@pxref{Starting the Shell}). +IDLWAVE will find out about the IDL @code{!PATH} variable and offer a +list of directories on the path. Simply select them all (or whichever +you want --- directories with existing library catalogs will not be +selected by default) and click on the @samp{Scan&Save} button. Then +go for a cup of coffee while IDLWAVE collects information for each and +every IDL routine on your search path. All this information is +written to the file @file{.idlwave/idlusercat.el} in your home +directory and will from now on automatically load whenever you use IDLWAVE. You may find it necessary to rebuild the catalog on occasion -as your local libraries change. Try to use routine info (@kbd{C-c ?}) -or completion (@kbd{M-@key{TAB}}) while on any routine or partial routine -name you know to be located in the library. E.g., if you have scanned -the IDL-Astro library: +as your local libraries change, or build a library catalog for those +directories instead. Invoke routine info (@kbd{C-c ?}) or completion +(@kbd{M-@key{TAB}}) on any routine or partial routine name you know to +be located in the library. E.g., if you have scanned the IDL-Astro +library: @example - a=readf@key{M-<TAB>} + a=readf@key{M-@key{TAB}} @end example - expands to `readfits('. Then try @example @@ -690,11 +737,11 @@ @end example I hope you made it until here. Now you are set to work with IDLWAVE. -On the way you will want to change other things, and to learn more about -the possibilities not discussed in this short tutorial. Read the -manual, look at the documentation strings of interesting variables (with -@kbd{C-h v idlwave<-variable-name> @key{RET}}) and ask the remaining -questions on the newsgroup @code{comp.lang.idl-pvwave}. +On the way you will want to change other things, and to learn more +about the possibilities not discussed in this short tutorial. Read +the manual, look at the documentation strings of interesting variables +(with @kbd{C-h v idlwave<-variable-name> @key{RET}}) and ask the +remaining questions on the newsgroup @code{comp.lang.idl-pvwave}. @node The IDLWAVE Major Mode, The IDLWAVE Shell, Getting Started, Top @chapter The IDLWAVE Major Mode @@ -727,35 +774,26 @@ @menu * Code Indentation:: Reflecting the logical structure -* Continued Statement Indentation:: +* Continued Statement Indentation:: * Comment Indentation:: Special indentation for comment lines * Continuation Lines:: Splitting statements over lines * Syntax Highlighting:: Font-lock support * Octals and Highlighting:: Why "123 causes problems @end menu -The IDL language, with it's early roots in FORTRAN, modern +The IDL language, with its early roots in FORTRAN, modern implementation in C, and liberal borrowing of features of many vector -languages along its 25+ year history, has inherited an unusual mix of -syntax elements. Left to his or her own devices, a novice IDL -programmer will often conjure code which is very difficult to read and -impossible to adapt. Much can be gleaned from studying available IDL -code libraries for coding style pointers, but, due to the variety of -IDL syntax elements, replicating this style can be challenging at -best. Luckily, IDLWAVE understands the structure of IDL code very -well, and takes care of almost all formatting issues for you. After -configuring it to match your coding standards, you can rely on it to -help keep your code neat and organized. - -@cindex Foreign code, adapting -@cindex Indentation, of foreign code -@kindex C-M-\ -To re-indent a larger portion of code (e.g. when working with foreign code -written with different conventions), use @kbd{C-M-\} -(@code{indent-region}) after marking the relevant code. Useful marking -commands are @kbd{C-x h} (the entire file) or @kbd{C-M-h} (the -current subprogram). @xref{Actions}, for information how to impose -additional formatting conventions on foreign code. +and other languages along its 25+ year history, has inherited an +unusual mix of syntax elements. Left to his or her own devices, a +novice IDL programmer will often conjure code which is very difficult +to read and impossible to adapt. Much can be gleaned from studying +available IDL code libraries for coding style pointers, but, due to +the variety of IDL syntax elements, replicating this style can be +challenging at best. Luckily, IDLWAVE understands the structure of +IDL code very well, and takes care of almost all formatting issues for +you. After configuring it to match your coding standards, you can +rely on it to help keep your code neat and organized. + @node Code Indentation, Continued Statement Indentation, Code Formatting, Code Formatting @subsection Code Indentation @@ -769,7 +807,17 @@ @code{PRO}/@code{FUNCTION}/@code{BEGIN} and @code{END}), and continuation lines. -@defopt idlwave-main-block-indent (@code{0}) +@cindex Foreign code, adapting +@cindex Indentation, of foreign code +@kindex C-M-\ +To re-indent a larger portion of code (e.g. when working with foreign code +written with different conventions), use @kbd{C-M-\} +(@code{indent-region}) after marking the relevant code. Useful marking +commands are @kbd{C-x h} (the entire file) or @kbd{C-M-h} (the +current subprogram). @xref{Actions}, for information how to impose +additional formatting conventions on foreign code. + +@defopt idlwave-main-block-indent (@code{0}) Extra indentation for the main block of code. That is the block between the FUNCTION/PRO statement and the END statement for that program unit. @@ -827,12 +875,16 @@ maximum additional indentation beyond the basic indent to be tolerated, otherwise defaulting to a fixed-offset from the enclosing indent (the size of which offset is set in -@code{idlwave-continuation-indent}). Also, since the indentation -level can be somewhat dynamic in continued statements with special -continuation indentation, especially if +@code{idlwave-continuation-indent}). As a special case, continuations +of routine calls without any arguments or keywords will @emph{not} +align the continued line, under the assumption that you continued +because you needed the space. + +Also, since the indentation level can be somewhat dynamic in continued +statements with special continuation indentation, especially if @code{idlwave-max-extra-continuation-indent} is small, the key @kbd{C-u @key{TAB}} will re-indent all lines in the current statement. -Note that @code{idlwave-indent-to-open-paren}, if non-nil, overrides +Note that @code{idlwave-indent-to-open-paren}, if non-@code{nil}, overrides the @code{idlwave-max-extra-continuation-indent} limit, for parentheses only, forcing them always to line up. @@ -966,7 +1018,7 @@ @defopt idlwave-use-last-hang-indent (@code{nil}) Non-@code{nil} means use last match on line for -@code{idlwave-indent-regexp}. +@code{idlwave-indent-regexp}. @end defopt @node Syntax Highlighting, Octals and Highlighting, Continuation Lines, Code Formatting @@ -994,7 +1046,7 @@ @defopt idlwave-default-font-lock-items Items which should be fontified on the default fontification level -2. +2. @end defopt @node Octals and Highlighting, , Syntax Highlighting, Code Formatting @@ -1002,12 +1054,12 @@ @cindex Syntax highlighting, Octals @cindex Highlighting of syntax, Octals -A rare syntax highlighting problem results from the extremely -unfortunate notation for octal numbers in IDL: @code{"123}. This -unpaired quotation mark is very difficult to parse, given that it can be -mixed on a single line with any number of strings. Emacs will -incorrectly identify this as a string, and the highlighting of following -lines of code can be distorted, since the string is never terminated. +A rare syntax highlighting problem results from an extremely unfortunate +notation for octal numbers in IDL: @code{"123}. This unpaired quotation +mark is very difficult to parse, given that it can be mixed on a single +line with any number of strings. Emacs will incorrectly identify this +as a string, and the highlighting of following lines of code can be +distorted, since the string is never terminated. One solution to this involves terminating the mistakenly identified string yourself by providing a closing quotation mark in a comment: @@ -1041,15 +1093,16 @@ even thousands more (each with a few to tens of keywords and arguments). This large command set can make it difficult to remember the calling sequence and keywords for the routines you use, but -IDLWAVE can help. It builds up routine information using a wide -variety of sources: IDLWAVE in fact knows far more about the routines -on your system than IDL itself. It maintains a list of all built-in -routines, with calling sequences and keywords@footnote{This list is -created by scanning the IDL manuals and might contain (very few) -errors. Please report any errors to the maintainer, so that they can -be fixed.}. It also scans Emacs buffers and library files for routine -definitions, and queries the IDLWAVE-Shell for information about -routines currently compiled there. This information is updated +IDLWAVE can help. It builds up routine information from a wide +variety of sources; IDLWAVE in fact knows far more about the +@samp{.pro} routines on your system than IDL itself! It maintains a +list of all built-in routines, with calling sequences and +keywords@footnote{This list is created by scanning the IDL manuals and +might contain (very few) errors. Please report any errors to the +maintainer, so that they can be fixed.}. It also scans Emacs buffers +for routine definitions, queries the IDLWAVE-Shell for information +about routines currently compiled there, and automatically locates +library and user-created catalogs. This information is updated automatically, and so should usually be current. To force a global update and refresh the routine information, use @kbd{C-c C-i} (@code{idlwave-update-routine-info}). @@ -1071,13 +1124,13 @@ On positions 1,2 and 8, information about the @samp{plot} procedure will be shown. On positions 3,4, and 7, the @samp{alog} function will be described, while positions 5 and 6 will investigate the @samp{sin} -function. +function. When you ask for routine information about an object method, and the method exists in several classes, IDLWAVE queries for the class of the object, unless the class is already known through a text property on the @samp{->} operator (@pxref{Object Method Completion and Class -Ambiguity}), or by having been explicitly included in the call +Ambiguity}), or by having been explicity included in the call (e.g. @code{a->myclass::Foo}). @cindex Calling sequences @@ -1090,7 +1143,7 @@ Usage: XMANAGER, NAME, ID Keywords: BACKGROUND CATCH CLEANUP EVENT_HANDLER GROUP_LEADER JUST_REG MODAL NO_BLOCK -Source: SystemLib [CSB] /soft1/idl53/lib/xmanager.pro +Source: SystemLib [LCSB] /soft1/idl53/lib/xmanager.pro @end example @cindex Categories, of routines @@ -1102,20 +1155,22 @@ @cindex @code{!DIR}, IDL variable If a definition of this routine exists in several files accessible to -IDLWAVE, several @samp{Source} lines will point to the different files. -This may indicate that your routine is shadowing a library routine, -which may or may not be what you want (@pxref{Load-Path Shadows}). The -information about the calling sequence and keywords is derived from the -first source listed. Library routines are supported only if you have -scanned your local IDL libraries (@pxref{Library Catalog}). The source -entry consists of a @emph{source category}, a set of @emph{flags} and -the path to the @emph{source file}. The following categories exist: +IDLWAVE, several @samp{Source} lines will point to the different +files. This may indicate that your routine is shadowing a system +library routine, which may or may not be what you want +(@pxref{Load-Path Shadows}). The information about the calling +sequence and keywords is derived from the first source listed. +Library routines are available only if you have scanned your local IDL +directories or are using pre-scanned libraries (@pxref{Catalogs}). +The source entry consists of a @emph{source category}, a set of +@emph{flags} and the path to the @emph{source file}. The following +default categories exist: @multitable @columnfractions .15 .85 @item @i{System} @tab A system routine of unknown origin. When the system library has -been scanned (@pxref{Library Catalog}), this category will automatically -split into the next two. +been scanned as part of a catalog (@pxref{Catalogs}), this category +will automatically split into the next two. @item @i{Builtin} @tab A builtin system routine with no source code available. @item @i{SystemLib} @@ -1127,27 +1182,28 @@ @item @i{Other} @tab Any other routine with a file not known to be on the search path. @item @i{Unresolved} -@tab An otherwise unkown routine the shell lists as unresolved +@tab An otherwise unkown routine the shell lists as unresolved (referenced, but not compiled). @end multitable -You can create additional categories based on the routine's filepath -with the variable @code{idlwave-special-lib-alist}. This is useful for -easy discrimination of various libraries, or even versions of the same -library. +Any routines discovered in library catalogs (@pxref{Library +Catalogs}), will display the category assigned during creation, +e.g. @samp{NasaLib}. For routines not discovered in this way, you can +create additional categories based on the routine's filename using the +variable @code{idlwave-special-lib-alist}. @cindex Flags, in routine info @cindex Duplicate routines @cindex Multiply defined routines @cindex Routine definitions, multiple -The flags @code{[CSB]} indicate the source of the information IDLWAVE -has regarding the file: from a library catalog (@w{@code{[C--]}}, -@pxref{Library Catalog}), from the IDL Shell (@w{@code{[-S-]}}) or from -an Emacs buffer (@w{@code{[--B]}}). Combinations are possible (a -compiled library routine visited in a buffer might read -@w{@code{[CSB]}}). If a file contains multiple definitions of the same -routine, the file name will be prefixed with @samp{(Nx)} where @samp{N} -is the number of definitions. +The flags @code{[LCSB]} indicate the source of the information IDLWAVE +has regarding the file: from a library catalog (@w{@code{[L---]}}), +from a user catalog (@w{@code{[-C--]}}, from the IDL Shell +(@w{@code{[--S-]}}) or from an Emacs buffer (@w{@code{[---B]}}). +Combinations are possible (a compiled library routine visited in a +buffer might read @w{@code{[L-SB]}}). If a file contains multiple +definitions of the same routine, the file name will be prefixed with +@samp{(Nx)} where @samp{N} is the number of definitions. @cindex Online Help from the routine info buffer @cindex Active text, in routine info @@ -1162,7 +1218,7 @@ @item @i{Usage} @tab If online help is installed, a click with the @emph{right} mouse button on the @i{Usage:} line will access the help for the -routine (@pxref{Online Help}). +routine (@pxref{Online Help}). @item @i{Keyword} @tab Online help about keywords is also available with the @emph{right} mouse button. Clicking on a keyword with the @emph{middle} @@ -1198,54 +1254,31 @@ @end defopt +@ifhtml +<A NAME="ONLINE_HELP"></A> +@end ifhtml @node Online Help, Completion, Routine Info, The IDLWAVE Major Mode @section Online Help @cindex Online Help @cindex @file{idlw-help.txt} @cindex @file{idlw-help.el} -@cindex IDL manual, ASCII version @cindex Installing online help @cindex Online Help, Installation @cindex Speed, of online help -For IDL system routines, RSI provides extensive documentation. IDLWAVE -can access an ASCII version of this documentation very quickly and -accurately. This is @emph{much} faster than using the IDL online help -application, because IDLWAVE usually gets you to the right place in the -documentation directly, without any additional browsing and scrolling. -For this online help to work, an ASCII version of the IDL documentation, -which is not part of the standalone IDLWAVE distribution, is required. -The necessary help files can be downloaded from -@uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. The text -extracted from the PDF files is fine for normal documentation -paragraphs, but graphics and multiline equations will not be well -formatted. See also @ref{Documentation Scan}. - -@cindex Updated online help -@cindex Online help, updates -@cindex @code{<NEW>..</NEW>} -Occasionally RSI releases a synopsis of new features in an IDL release, -without simultaneously updating the documentation files, instead -preferring a @i{What's New} document which describes the changes. These -updates are incorporated directly into the IDLWAVE online help, and are -delimited in @code{<NEW>..</NEW>} blocks. - -@cindex Source code, as online help -@cindex DocLib header, as online help -For routines which are not documented in the IDL manual (for example -personal or library routines), the source code itself is used as help -text. If the requested information can be found in a (more or less) -standard DocLib file header, IDLWAVE shows the header (scrolling down to -appropriate keyword). Otherwise the routine definition statement -(@code{pro}/@code{function}) is shown. - -@cindex Structure tags, in online help -@cindex Class tags, in online help -Help is also available for class structure tags (@code{self.TAG}), and -generic structure tags, if structure tag completion is enabled -(@pxref{Structure Tag Completion}). This is implemented by visiting the -tag within the class or structure definition source itself. Help is not -available on built-in system class tags. + +IDLWAVE can display help from an HTML version of the IDL documentation +if it is available. This is @emph{much} faster than using the IDL +online help application, because IDLWAVE usually gets you to the right +place in the documentation directly --- e.g. a specific keyword of a +routine --- without any additional browsing and scrolling. There are +a variety of options for displaying the HTML help: see below. Help +for routines without HTML documentation is also available, using the +routine documentation header and/or source. + +To make this feature work, you should set +@code{idlwave-html-help-location} to the directory name of the +directory where the IDL help files are installed. @kindex M-? In any IDL program (or, as with most IDLWAVE commands, in the IDL @@ -1261,6 +1294,8 @@ @tab A keyword parameter of a routine. @item @i{System Variable} @tab System variables like @code{!DPI}. +@item @i{System Variable Tags} +@tab System variables tags like @code{!D.X_SIZE}. @item @i{IDL Statement} @tab Statements like @code{PRO}, @code{REPEAT}, @code{COMPILE_OPT}, etc. @item @i{Class name} @@ -1270,23 +1305,23 @@ @item @i{Executive Command} @tab An executive command like @code{.RUN}. Mostly useful in the shell. @item @i{Structure Tags} -@tab In structure tags like @code{state.xsize} -@item @i{Structure Tags} -@tab In class tags like @code{self.value}. +@tab Structure tags like @code{state.xsize} +@item @i{Class Tags} +@tab Class tags like @code{self.value}. @item @i{Default} @tab The routine that would be selected for routine info display. @end multitable @cindex @code{OBJ_NEW}, special online help Note that the @code{OBJ_NEW} function is special in that the help -displayed depends on the cursor position: If the cursor is on the -@samp{OBJ_NEW}, this function is described. If it is on the class name -inside the quotes, the documentation for the class is pulled up. If the -cursor is @emph{after} the class name, anywhere in the argument list, -the documentation for the corresponding @code{Init} method and its -keywords is targeted. - -@noindent Apart from source buffers, there are two more places from +displayed depends on the cursor position. If the cursor is on the +@samp{OBJ_NEW}, this function is described. If it is on the class +name inside the quotes, the documentation for the class is pulled up. +If the cursor is @emph{after} the class name, anywhere in the argument +list, the documentation for the corresponding @code{Init} method and +its keywords is targeted. + +Apart from an IDLWAVE buffer or shell, there are two more places from which online help can be accessed. @itemize @bullet @@ -1302,14 +1337,112 @@ program source itself) will be emphasized (e.g. colored blue). @end itemize @noindent -In both cases, a blue face indicates that the item is documented in the -IDL manual, but an attempt will be made to visit non-blue items directly -in the originating source file. - -@cindex Help application, key bindings -@cindex Key bindings, in help application -The help window is normally displayed in a separate frame. The -following commands can be used to navigate inside the help system: +In both cases, a blue face indicates that the item is documented in +the IDL manual, but an attempt will be made to visit non-blue items +directly in the originating source file. + + +@menu +* Help with HTML Documentation:: +* Help with Source:: +@end menu + +@node Help with HTML Documentation, Help with Source, Online Help, Online Help +@subsection Help with HTML Documentation +@cindex HTML Help +@cindex Help using HTML manuals +@cindex IDL manual, HTML version + +Help using the HTML documentation is invoked with the built-in Emacs +command @code{browse-url}, which displays the relevant help topic in a +browser of your choosing. There are many possible browsers to choose +among, with differing advantages and disadvantages. The variable +@code{idlwave-help-browser-function} controls which browser help is +sent to. This function is used to set the variable +@code{browse-url-browser-function} locally for IDLWAVE help only. +Customize this variable to see what choices of browsers your system +offers. + +Certain browsers like @code{w3} and @code{w3m} +(@uref{http://emacs-w3m.namazu.org/}, the author's help browser of +choice) are run within Emacs, and use Emacs buffers to display the +HTML help. This can be convenient, especially on small displays, and +images can even be displayed in-line on new Emacs versions. However, +better formatting results are often achieved with external browsers, +like Mozilla. IDLWAVE assumes any browser function containing "w3" is +displayed in a local buffer. If you are using another Emacs-local +browser for which this is not true, set the variable +@code{idlwave-help-browser-is-local}. + +@emph{N.B. For Windows users}: IDLWAVE can bring up help directly +from the Microsoft HTMLHelp documentation supplied with IDL: no +additional help files are needed. Be sure to set +@code{idlwave-system-directory} and the help file will be found +automatically (or, alternatively, specify its location directly with +@code{idlwave-html-help-location}). The variable +@code{idlwave-help-use-hh} controls whether HTMLHelp is used, and +which application is called to invoke it (@code{HH} is the default). +The free helper application @code{KEYHH} +(@uref{http://www.keyworks.net/keyhh.htm}) can be used instead, and is +preferrable, as it permits loading new help topics into the same help +window. @code{KEYHH} must be downloaded and installed separately. + +@xref{HTML Help Browser Tips}, for more information on selecting and +configuring a browser for use with IDL's HTML help system. + +@defopt idlwave-html-help-location @file{/usr/local/etc} +The directory where the @file{idl_html_help} dir or @file{idl.chm} +HTMLHelp files live. +@end defopt + +@defopt idlwave-help-use-hh @code{nil} +If set to @code{'hh} or @code{'keyhh}, use Windows native HTMLHelp +with the specified help application. +@end defopt + +@defopt idlwave-help-browser-function +The browser function to use to display IDLWAVE HTML help. Should be +one of the functions available for setting +@code{browse-url-browser-function}, which see. +@end defopt + +@defopt idlwave-help-browser-is-local +Is the browser selected in @code{idlwave-help-browser-function} run in a +local Emacs buffer? Defaults to @code{t} if the function contains +"-w3". +@end defopt + +@defopt idlwave-help-link-face +The face for links to IDLWAVE online help. +@end defopt + +@node Help with Source, , Help with HTML Documentation, Online Help +@subsection Help with Source +@cindex Help using routine source + +@cindex Source code, as online help +@cindex DocLib header, as online help +For routines which are not documented in an HTML manual (for example +personal or library routines), the source code itself is used as help +text. If the requested information can be found in a (more or less) +standard DocLib file header, IDLWAVE shows the header (scrolling down to +a keyword, if appropriate). Otherwise the routine definition statement +(@code{pro}/@code{function}) is shown. The doclib header sections which +are searched for include @samp{NAME} and @samp{KEYWORDS}. Localization +support can be added by customizing the @code{idlwave-help-doclib-name} +and @code{idlwave-help-doclib-keyword} variables. + +@cindex Structure tags, in online help +@cindex Class tags, in online help +Help is also available for class structure tags (@code{self.TAG}), and +generic structure tags, if structure tag completion is enabled +(@pxref{Structure Tag Completion}). This is implemented by visiting the +tag within the class or structure definition source itself. Help is not +available on built-in system class tags. + +The help window is normally displayed in the same frame, but can be +popped-up in a separate frame. The following commands can be used to +navigate inside the help system for source files: @multitable @columnfractions .15 .85 @item @kbd{@key{SPACE}} @@ -1318,29 +1451,6 @@ @tab Scroll forward one line. @item @kbd{@key{DEL}} @tab Scroll back one page. -@item @kbd{n, p} -@tab Browse to the next or previous topic (in physical sequence). -@item @kbd{b, f} -@tab Move back and forward through the help topic history. -@item @kbd{c} -@tab Clear the history. -@item @kbd{Mouse-2} -@tab Follow a link. Active links are displayed in a different font. -Items under @i{See Also} are active, and classes have links to their -methods and back. -@item @kbd{o} -@tab Open a topic. The topic can be selected with completion. -@item @kbd{*} -@tab Load the whole help file into Emacs, for global text searches. -@item @kbd{q} -@tab Kill the help window. -@end multitable - -@sp 1 -@noindent When the help text is a source file, the following commands -are also available: - -@multitable @columnfractions .15 .85 @item @kbd{h} @tab Jump to DocLib Header of the routine whose source is displayed as help. @@ -1352,13 +1462,12 @@ item in the DocLib header. @item @kbd{F} @tab Fontify the buffer like source code. See the variable @code{idlwave-help-fontify-source-code}. +@item @kbd{q} +@tab Kill the help window. @end multitable -@defopt idlwave-help-directory -The directory where idlw-help.txt and idlw-help.el are stored. -@end defopt - -@defopt idlwave-help-use-dedicated-frame (@code{t}) + +@defopt idlwave-help-use-dedicated-frame (@code{nil}) Non-@code{nil} means use a separate frame for Online Help if possible. @end defopt @@ -1379,18 +1488,21 @@ @end defopt @defopt idlwave-help-source-try-header (@code{t}) -Non-@code{nil} means try to find help in routine header when displaying source -file. +Non-@code{nil} means try to find help in routine header when +displaying source file. @end defopt -@defopt idlwave-help-link-face -The face for links in IDLWAVE online help. +@defopt idlwave-help-doclib-name (@code{"name"}) +The case-insensitive heading word in doclib headers to locate the +@emph{name} section. Can be a regexp, e.g. @code{"\\(name\\|nom\\)"}. @end defopt -@defopt idlwave-help-activate-links-aggressively (@code{t}) -Non-@code{nil} means make all possible links in help window active. +@defopt idlwave-help-doclib-keyword (@code{"KEYWORD"}) +The case-insensitive heading word in doclib headers to locate the +@emph{keywords} section. Can be a regexp. @end defopt + @node Completion, Routine Source, Online Help, The IDLWAVE Major Mode @section Completion @cindex Completion @@ -1404,12 +1516,13 @@ @kindex M-@key{TAB} @kindex C-c C-i IDLWAVE offers completion for class names, routine names, keywords, -system variables, class structure tags, regular structure tags and file -names. As in many programming modes, completion is bound to -@kbd{M-@key{TAB}} (or @kbd{@key{TAB}} in the IDLWAVE Shell --- -@pxref{Using the Shell}). Completion uses exactly the same internal -information as routine info, so when necessary (rarely) it can be -updated with @kbd{C-c C-i} (@code{idlwave-update-routine-info}). +system variables, system variable tags, class structure tags, regular +structure tags and file names. As in many programming modes, +completion is bound to @kbd{M-@key{TAB}} (or @kbd{@key{TAB}} in the +IDLWAVE Shell --- @pxref{Using the Shell}). Completion uses exactly +the same internal information as routine info, so when necessary +(rarely) it can be updated with @kbd{C-c C-i} +(@code{idlwave-update-routine-info}). The completion function is context sensitive and figures out what to complete based location of the point. Here are example lines and what @@ -1443,6 +1556,11 @@ also a possible completion here. You can force completion of a function name at such a location by using a prefix arg: @kbd{C-u M-@key{TAB}}. +Giving two prefix arguments (@kbd{C-u C-u M-@key{TAB}}) prompts for a +regular expression to search among the commands to be completed. As +an example, completing a blank line in this way will allow you to +search for a procedure matching a regexp. + @cindex Scrolling the @file{*Completions*} window @cindex Completion, scrolling @cindex Completion, Online Help @@ -1489,7 +1607,7 @@ @menu * Case of Completed Words:: CaseOFcomPletedWords * Object Method Completion and Class Ambiguity:: obj->Method, what? -* Object Method Completion in the Shell:: +* Object Method Completion in the Shell:: * Class and Keyword Inheritance:: obj->Method, _EXTRA=e * Structure Tag Completion:: Completing state.Tag @end menu @@ -1498,19 +1616,21 @@ @subsection Case of Completed Words @cindex Case of completed words @cindex Mixed case completion -The case of the completed words is determined by what is already in the -buffer. When the partial word being completed is all lower case, the -completion will be lower case as well. If at least one character is -upper case, the string will be completed in upper case or mixed case. -The default is to use upper case for procedures, functions and keywords, -and mixed case for object class names and methods, similar to the -conventions in the IDL manuals. These defaults can be changed with the -variable @code{idlwave-completion-case}. For instance, to enable -mixed-case completion for routines in addition to classes and methods, -you need an entry such as @code{routine . preserve} in that variable. -To enable total control over the case of completed items, independent of -buffer context, set @code{idlwave-completion-force-default-case} to -non-@code{nil}. +IDL is a case-insensitive language, so casing is a matter of style +only. IDLWAVE helps maintain a consistent casing style for completed +items. The case of the completed words is determined by what is +already in the buffer. As an exception, when the partial word being +completed is all lower case, the completion will be lower case as +well. If at least one character is upper case, the string will be +completed in upper case or mixed case, depending on the value of the +variable @code{idlwave-completion-case}. The default is to use upper +case for procedures, functions and keywords, and mixed case for object +class names and methods, similar to the conventions in the IDL +manuals. For instance, to enable mixed-case completion for routines +in addition to classes and methods, you need an entry such as +@code{(routine . preserve)} in that variable. To enable total control +over the case of completed items, independent of buffer context, set +@code{idlwave-completion-force-default-case} to non-@code{nil}. @defopt idlwave-completion-case Association list setting the case (UPPER/lower/Capitalized/MixedCase...) @@ -1554,7 +1674,7 @@ @code{idlwave-query-class} can be configured to make such prompting the default for all methods (not recommended), or selectively for very common methods for which the number of completing keywords would be too -large (e.g. @code{Init}). +large (e.g. @code{Init}). @cindex Saving object class on @code{->} @cindex @code{->} @@ -1568,8 +1688,9 @@ can be used to turn it on. @defopt idlwave-completion-show-classes (@code{1}) -Non-@code{nil} means show classes in @file{*Completions*} buffer when -completing object methods and keywords. +Non-@code{nil} means show up to that many classes in +@file{*Completions*} buffer when completing object methods and +keywords. @end defopt @defopt idlwave-completion-fontify-classes (@code{t}) @@ -1630,23 +1751,23 @@ @emph{chaining}, and is characterized by chained method calls like @w{@code{self->MySuperClass::SetProperty,_EXTRA=e}}. -IDLWAVE can accommodate this special synergy between class and keyword +IDLWAVE can accomodate this special synergy between class and keyword inheritance: if @code{_EXTRA} or @code{_REF_EXTRA} is detected among a -method's keyword parameters, all keywords of superclass versions of the -method being considered are included in completion. There is of course -no guarantee that this type of keyword chaining actually occurrs, but -for some methods it's a very convenient assumption. The variable -@code{idlwave-keyword-class-inheritance} can be used to configure which -methods have keyword inheritance treated in this simple, class-driven -way. By default, only @code{Init} and @code{(Get|Set)Property} are. -The completion buffer will label keywords based on their originating -class. +method's keyword parameters, all keywords of superclass versions of +the method being considered can be included in completion. There is +of course no guarantee that this type of keyword chaining actually +occurrs, but for some methods it's a very convenient assumption. The +variable @code{idlwave-keyword-class-inheritance} can be used to +configure which methods have keyword inheritance treated in this +simple, class-driven way. By default, only @code{Init} and +@code{(Get|Set)Property} are. The completion buffer will label +keywords based on their originating class. @defopt idlwave-support-inheritance (@code{t}) Non-@code{nil} means consider inheritance during completion, online help etc. @end defopt -@defopt idlwave-keyword-class-inheritance +@defopt idlwave-keyword-class-inheritance A list of regular expressions to match methods for which simple class-driven keyword inheritance will be used for Completion. @end defopt @@ -1676,7 +1797,7 @@ simply add the following to your @file{.emacs}: @lisp - (add-hook 'idlwave-load-hook + (add-hook 'idlwave-load-hook (lambda () (require 'idlw-complete-structtag))) @end lisp @@ -1696,7 +1817,9 @@ @code{idlwave-routine-info} would have used, taken from nearby buffer contents. In the minibuffer, specify a complete routine name (including any class part). IDLWAVE will display the source file in another -window, positioned at the routine in question. +window, positioned at the routine in question. You can also visit a +routine in the current buffer, with completion, by using a single prefix +(@kbd{C-u C-c C-v}). @cindex Buffers, killing @cindex Killing autoloaded buffers @@ -1719,9 +1842,9 @@ @code{idlwave-resolve} is one way to get a library module within reach of IDLWAVE's routine info collecting functions. A better way is to -scan (parts of) the library (@pxref{Library Catalog}). Routine info on -library modules will then be available without the need to compile the -modules first, and even without a running shell. +keep routine information available in catalogs (@pxref{Catalogs}). +Routine info on modules will then be available without the need to +compile the modules first, and even without a running shell. @xref{Sources of Routine Info}, for more information on the ways IDLWAVE collects data about routines, and how to update this information. @@ -1970,7 +2093,8 @@ @end itemize @defopt idlwave-do-actions (@code{nil}) -Non-@code{nil} means performs actions when indenting. +Non-@code{nil} means performs actions when indenting. Individual action +settings are described below and set separately. @end defopt @menu @@ -2069,7 +2193,7 @@ (idlwave-action-and-binding "\\<\\(pro\\|function\\)\\>[ \t]*\\<" '(capitalize-word 1) t) ;; Capitalize common block name - (idlwave-action-and-binding "\\<common\\>[ \t]+\\<" + (idlwave-action-and-binding "\\<common\\>[ \t]+\\<" '(capitalize-word 1) t))) @end lisp @@ -2080,7 +2204,7 @@ @defopt idlwave-abbrev-change-case (@code{nil}) Non-@code{nil} means all abbrevs will be forced to either upper or lower -case. Legal values are @code{nil}, @code{t}, and @code{down}. +case. Valid values are @code{nil}, @code{t}, and @code{down}. @end defopt @defopt idlwave-reserved-word-upcase (@code{nil}) @@ -2096,7 +2220,7 @@ @cindex Modification timestamp @cindex Header, for file documentation @cindex Timestamp, in doc header. -@cindex ChangeLog, in doc header. +@cindex Changelog, in doc header. @kindex C-c C-h @kindex C-c C-m @@ -2206,7 +2330,7 @@ -@node The IDLWAVE Shell, Installation, The IDLWAVE Major Mode, Top +@node The IDLWAVE Shell, Acknowledgements, The IDLWAVE Major Mode, Top @chapter The IDLWAVE Shell @cindex IDLWAVE shell @cindex Major mode, @code{idlwave-shell-mode} @@ -2220,21 +2344,21 @@ program as an inferior process of Emacs, and works closely with the IDLWAVE major mode in buffers. It can be used to work with IDL interactively, to compile and run IDL programs in Emacs buffers and to -debug these programs. The IDLWAVE shell is built upon @file{comint}, an +debug these programs. The IDLWAVE shell is built on @file{comint}, an Emacs packages which handles the communication with the IDL program. -Unfortunately IDL for Windows and MacOS do not have command-prompt -versions and thus do not allow the interaction with -Emacs@footnote{Please inform the maintainer if you come up with a way to -make the IDLWAVE shell work on these systems.} --- so the IDLWAVE shell -currently only works under Unix. +Unfortunately IDL for Windows does not have command-prompt versions +and thus do not allow the interaction with Emacs@footnote{Please +inform the maintainer if you come up with a way to make the IDLWAVE +shell work on these systems.} --- so the IDLWAVE shell currently only +works under Unix and MacOSX. @menu * Starting the Shell:: How to launch IDL as a subprocess * Using the Shell:: Interactively working with the Shell -* Commands Sent to the Shell:: -* Debugging IDL Programs:: -* Examining Variables:: -* Custom Expression Examination:: +* Commands Sent to the Shell:: +* Debugging IDL Programs:: +* Examining Variables:: +* Custom Expression Examination:: @end menu @node Starting the Shell, Using the Shell, The IDLWAVE Shell, The IDLWAVE Shell @@ -2249,22 +2373,23 @@ The IDLWAVE shell can be started with the command @kbd{M-x idlwave-shell}. In @code{idlwave-mode} the function is bound to @kbd{C-c C-s}. It creates a buffer @file{*idl*} which is used to -interact with the shell. If the shell is already running, @kbd{C-c C-s} -will simple switch to the shell buffer. The command @kbd{C-c C-l} -(@code{idlwave-shell-recenter-shell-window}) displays the shell window -without selecting it. The shell can also be started automatically when -another command tries to send a command to it. To enable auto start, -set the variable @code{idlwave-shell-automatic-start} to @code{t}. +interact with the shell. If the shell is already running, @kbd{C-c +C-s} will simply switch to the shell buffer. The command @kbd{C-c +C-l} (@code{idlwave-shell-recenter-shell-window}) displays the shell +window without selecting it. The shell can also be started +automatically when another command tries to send a command to it. To +enable auto start, set the variable +@code{idlwave-shell-automatic-start} to @code{t}. In order to create a separate frame for the IDLWAVE shell buffer, call @code{idlwave-shell} with a prefix argument: @kbd{C-u C-c C-s} or @kbd{C-u C-c C-l}. If you always want a dedicated frame for the shell window, configure the variable -@code{idlwave-shell-use-dedicated-frame}. - -To launch a quick IDLWAVE shell directly from a shell prompt without an -IDLWAVE buffer (e.g., as a replacement for running inside an xterm), -define an alias with the following content: +@code{idlwave-shell-use-dedicated-frame}. + +To launch a quick IDLWAVE shell directly from a shell prompt without +an IDLWAVE buffer (e.g., as a replacement for running inside an +xterm), define a system alias with the following content: @example emacs -geometry 80x32 -eval "(idlwave-shell 'quick)" @@ -2273,6 +2398,16 @@ Replace the @samp{-geometry 80x32} option with @samp{-nw} if you prefer the Emacs process to run directly inside the terminal window. +@cindex ENVI +@cindex IDL> Prompt + +To use IDLWAVE with ENVI or other custom packages which change the +@samp{IDL> } prompt, you must change the +@code{idlwave-shell-prompt-pattern}, which defaults to @samp{"^ ?IDL> +"}. Normally, you can just replace the @samp{IDL} in this expression +with the prompt you see. A suitable pattern which matches the prompt +for both ENVI and IDL simultaneously is @samp{"^ ?\\(ENVI\\|IDL\\)> "}. + @defopt idlwave-shell-explicit-file-name (@file{idl}) This is the command to run IDL. @end defopt @@ -2302,12 +2437,14 @@ Non-@code{nil} means preserve command history between sessions. @end defopt -@defopt idlwave-shell-command-history-file (@file{~/.idlwhist}) +@defopt idlwave-shell-command-history-file (@file{~/.idlwave/.idlwhist}) The file in which the command history of the idlwave shell is saved. +Unless it's an absolute path, it goes in +@code{idlwave-config-directory}. @end defopt - + @defopt idlwave-shell-use-dedicated-frame (@code{nil}) -Non-@code{nil} means IDLWAVE should use a special frame to display +Non-@code{nil} means IDLWAVE should use a special frame to display the shell buffer. @end defopt @@ -2476,18 +2613,22 @@ from the user, but this is configurable. The custom variable @code{idlwave-abbrev-show-commands} allows you to configure which commands sent to the shell are shown there. For a related customization -for separating the output of @emph{examine} commands @xref{Examining +for separating the output of @emph{examine} commands, see @ref{Examining Variables}. @defopt idlwave-shell-show-commands (@code{'(run misc breakpoint)}) A list of command types to echo in the shell when sent. Possible values are @code{run} for @code{.run}, @code{.compile} and other run commands, -@code{misc} for lesser used commands like @code{window}, @code{retall}, -etc., @code{breakpoint} for breakpoint setting and clearing commands, -and @code{debug} for other debug, stepping, and continue commands. In -addition, if the variable is set to the single symbol @code{'everything}, -all the copious shell input is displayed (which is probably only useful -for debugging purposes). +@code{misc} for lesser used commands like @code{window}, +@code{retall},@code{close}, etc., @code{breakpoint} for breakpoint +setting and clearing commands, and @code{debug} for other debug, +stepping, and continue commands. In addition, if the variable is set to +the single symbol @code{'everything}, all the copious shell input is +displayed (which is probably only useful for debugging purposes). +N.B. For hidden commands which produce output by side-effect, that +output remains hidden (e.g., stepping through a @code{print} command). +As a special case, any error message in the output will be displayed +(e.g., stepping to an error). @end defopt @node Debugging IDL Programs, Examining Variables, Commands Sent to the Shell, The IDLWAVE Shell @@ -2497,17 +2638,21 @@ @cindex Toolbar Programs can be compiled, run, and debugged directly from the source -buffer in Emacs. IDLWAVE makes compiling and debugging IDL programs -far less cumbersome by providing a full-featured, -key/menu/toolbar-driven interface to commands like @code{breakpoint}, -@code{.step}, @code{.run}, etc. - -The IDLWAVE shell installs key bindings both in the shell buffer and in -all IDL code buffers of the current Emacs session, so debug commands -work in both places (in the shell, commands operate on the last file -compiled). On Emacs versions which support this, a debugging toolbar is -also installed. The display of the toolbar can be toggled with @kbd{C-c -C-d C-t} (@code{idlwave-shell-toggle-toolbar}). +buffer in Emacs, walking through arbitrarily deeply nested code, +printing expressions and skipping up and down the calling stack along +the way. IDLWAVE makes compiling and debugging IDL programs far less +cumbersome by providing a full-featured, key/menu/toolbar-driven +interface to commands like @code{breakpoint}, @code{.step}, +@code{.run}, etc. It can even perform complex debug operations not +natively supported by IDL (like continuing to the line at the cursor). + +The IDLWAVE shell installs key bindings both in the shell buffer and +in all IDL code buffers of the current Emacs session, so debug +commands work in both places (in the shell, commands operate on the +last file compiled). On Emacs versions which support it, a debugging +toolbar is also installed. The toolbar display can be toggled with +@kbd{C-c C-d C-t} (@code{idlwave-shell-toggle-toolbar}). + @defopt idlwave-shell-use-toolbar (@code{t}) Non-@code{nil} means use the debugging toolbar in all IDL related @@ -2515,38 +2660,63 @@ @end defopt @menu -* Debug Key Bindings:: -* Compiling Programs:: -* Breakpoints and Stepping:: -* Walking the Calling Stack:: +* A Tale of Two Modes:: +* Debug Key Bindings:: +* Breakpoints and Stepping:: +* Compiling Programs:: +* Walking the Calling Stack:: +* Electric Debug Mode:: @end menu -@node Debug Key Bindings, Compiling Programs, Debugging IDL Programs, Debugging IDL Programs + +@node A Tale of Two Modes, Debug Key Bindings, Debugging IDL Programs, Debugging IDL Programs +@subsection A Tale of Two Modes +@cindex Electric Debug Mode +@cindex Debugging Interface + +The many debugging, compiling, and examination commands provided in +IDLWAVE are available simultaneously through two different interfaces: +the original, multi-key command interface, and the new Electric Debug +Mode. The functionality they offer is similar, but the way you interact +with them is quite different. The main difference is that, in Electric +Debug Mode, the source buffers are made read-only, and single +key-strokes are used to step through, examine expressions, set and +remove breakpoints, etc. The same variables, prefix arguments, and +settings apply to both versions, and both can be used interchangeably. +By default, when breakpoints are hit, Electric Debug Mode is enabled. +The traditional interface is described first. @xref{Electric Debug +Mode}, for more on that mode. Note that electric debug mode can be +prevented from activating automatically by customizing the variable +@code{idlwave-shell-automatic-electric-debug}. + +@node Debug Key Bindings, Breakpoints and Stepping, A Tale of Two Modes, Debugging IDL Programs @subsection Debug Key Bindings @kindex C-c C-d @cindex Key bindings -The debugging key bindings are by default on the prefix key @kbd{C-c -C-d}, so for example setting a breakpoint is done with @kbd{C-c C-d -C-b}, and compiling a source file with @kbd{C-c C-d C-c}. If you find -this too much work, you can easily configure IDLWAVE to use one or more +The standard debugging key bindings are always available by default on +the prefix key @kbd{C-c C-d}, so, for example, setting a breakpoint is +done with @kbd{C-c C-d C-b}, and compiling a source file with @kbd{C-c +C-d C-c}. You can also easily configure IDLWAVE to use one or more modifier keys not in use by other commands, in lieu of the prefix @kbd{C-c C-d} (though these bindings will typically also be available ---- see @code{idlwave-shell-activate-prefix-keybindings}). For example, -if you write in @file{.emacs}: +--- see @code{idlwave-shell-activate-prefix-keybindings}). For +example, if you include in @file{.emacs}: @lisp (setq idlwave-shell-debug-modifiers '(control shift)) @end lisp -@noindent a breakpoint can be set by pressing @kbd{b} while holding down +@noindent a breakpoint can then be set by pressing @kbd{b} while holding down @kbd{shift} and @kbd{control} keys, i.e. @kbd{C-S-b}. Compiling a source file will be on @kbd{C-S-c}, deleting a breakpoint @kbd{C-S-d}, -etc. In the remainder of this chapter we will assume that the @kbd{C-c -C-d} bindings are active, but each of these bindings will have an -equivalent single-keypress shortcut if modifiers are given in the -@code{idlwave-shell-debug-modifiers} variable (see @pxref{Lesson II -- -Customization}). +etc. In the remainder of this chapter we will assume that the +@kbd{C-c C-d} bindings are active, but each of these bindings will +have an equivalent shortcut if modifiers are given in the +@code{idlwave-shell-debug-modifiers} variable (@pxref{Lesson II -- +Customization}). A much simpler and faster form of debugging for +running code is also available by default --- see @ref{Electric Debug +Mode}. @defopt idlwave-shell-prefix-key (@kbd{C-c C-d}) The prefix key for the debugging map @@ -2559,53 +2729,13 @@ @end defopt @defopt idlwave-shell-debug-modifiers (@code{nil}) -List of modifier keys to use for additional binding of debugging -commands in the shell and source buffers. Can be one or more of -@code{control}, @code{meta}, @code{super}, @code{hyper}, @code{alt}, and -@code{shift}. +List of modifier keys to use for additional, alternative binding of +debugging commands in the shell and source buffers. Can be one or +more of @code{control}, @code{meta}, @code{super}, @code{hyper}, +@code{alt}, and @code{shift}. @end defopt -@node Compiling Programs, Breakpoints and Stepping, Debug Key Bindings, Debugging IDL Programs -@subsection Compiling Programs -@cindex Compiling programs -@cindex Programs, compiling -@cindex Default command line, executing -@cindex Executing a default command line - -@kindex C-c C-d C-c -In order to compile the current buffer under the IDLWAVE shell, press -@kbd{C-c C-d C-c} (@code{idlwave-save-and-run}). This first saves the -current buffer and then sends the command @samp{.run path/to/file} to the -shell. You can also execute @kbd{C-c C-d C-c} from the shell buffer, in -which case the most recently compiled buffer will be saved and -re-compiled. - -When developing or debugging a program, it is often necessary to execute -the same command line many times. A convenient way to do this is -@kbd{C-c C-d C-y} (@code{idlwave-shell-execute-default-command-line}). -This command first resets IDL from a state of interrupted execution by -closing all files and returning to the main interpreter level. Then a -default command line is send to the shell. To edit the default command -line, call @code{idlwave-shell-execute-default-command-line} with a -prefix argument: @kbd{C-u C-c C-d C-y}. - -@defopt idlwave-shell-mark-stop-line (@code{t}) -Non-@code{nil} means mark the source code line where IDL is currently -stopped. The value specifies the preferred method. Legal values are -@code{nil}, @code{t}, @code{arrow}, and @code{face}. -@end defopt - -@defopt idlwave-shell-overlay-arrow (@code{">"}) -The overlay arrow to display at source lines where execution halts, if -configured in @code{idlwave-shell-mark-stop-line}. -@end defopt - -@defopt idlwave-shell-stop-line-face -The face which highlights the source line where IDL is stopped, if -configured in @code{idlwave-shell-mark-stop-line}. -@end defopt - -@node Breakpoints and Stepping, Walking the Calling Stack, Compiling Programs, Debugging IDL Programs +@node Breakpoints and Stepping, Compiling Programs, Debug Key Bindings, Debugging IDL Programs @subsection Breakpoints and Stepping @cindex Breakpoints @cindex Stepping @@ -2613,24 +2743,33 @@ @kindex C-c C-d C-b @kindex C-c C-d C-b -You can set breakpoints and step through a program with IDLWAVE. -Setting a breakpoint in the current line of the source buffer is done -with @kbd{C-c C-d C-b} (@code{idlwave-shell-break-here}). With a prefix -arg of 1 (i.e. @kbd{C-1 C-c C-d C-b}), the breakpoint gets a +IDLWAVE helps you set breakpoints and step through code. Setting a +breakpoint in the current line of the source buffer is accomplished +with @kbd{C-c C-d C-b} (@code{idlwave-shell-break-here}). With a +prefix arg of 1 (i.e. @kbd{C-1 C-c C-d C-b}), the breakpoint gets a @code{/ONCE} keyword, meaning that it will be deleted after first use. -With a numeric prefix greater than one (e.g. @kbd{C-4 C-c C-d C-b}), the -breakpoint will only be active the @code{nth} time it is hit. With a -single non-numeric prefix (i.e. @kbd{C-u C-c C-d C-b}), prompt for a -condition --- an IDL expression to be evaulated and trigger the +With a numeric prefix greater than one (e.g. @kbd{C-4 C-c C-d C-b}), +the breakpoint will only be active the @code{nth} time it is hit. +With a single non-numeric prefix (i.e. @kbd{C-u C-c C-d C-b}), prompt +for a condition --- an IDL expression to be evaulated and trigger the breakpoint only if true. To clear the breakpoint in the current line, -use @kbd{C-c C-d C-d} (@code{idlwave-clear-current-bp}). When executed -from the shell window, the breakpoint where IDL is currently stopped -will be deleted. To clear all breakpoints, use @kbd{C-c C-d C-a} -(@code{idlwave-clear-all-bp}). Breakpoint lines are highlighted in the -source code. Note that IDL places breakpoints as close as possible on -or after the line you specify. IDLWAVE queries the shell for the actual -breakpoint location which was set, so the exact line you specify may not -be marked. +use @kbd{C-c C-d C-d} (@code{idlwave-clear-current-bp}). When +executed from the shell window, the breakpoint where IDL is currently +stopped will be deleted. To clear all breakpoints, use @kbd{C-c C-d +C-a} (@code{idlwave-clear-all-bp}). Breakpoints can also be disabled +and re-enabled: @kbd{C-c C-d C-\} +(@code{idlwave-shell-toggle-enable-current-bp}). + + +Breakpoint lines are highlighted or indicated with an icon in the +source code (different icons for conditional, after, and other break +types). Disabled breakpoints are @emph{grayed out} by default. Note +that IDL places breakpoints as close as possible on or after the line +you specify. IDLWAVE queries the shell for the actual breakpoint +location which was set, so the exact line you specify may not be +marked. You can re-sync the breakpoint list and display at any time +(e.g., if you add or remove some on the command line) using @kbd{C-c +C-d C-l}. Once the program has stopped somewhere, you can step through it. The most important stepping commands are @kbd{C-c C-d C-s} to execute one @@ -2651,6 +2790,14 @@ @tab Clear current breakpoint (@code{idlwave-shell-clear-current-bp}) @item @kbd{C-c C-d C-a} @tab Clear all breakpoints (@code{idlwave-shell-clear-all-bp}) +@item @kbd{C-c C-d [} +@tab Go to the previous breakpoint (@code{idlwave-shell-goto-previous-bp}) +@item @kbd{C-c C-d ]} +@tab Go to the next breakpoint (@code{idlwave-shell-goto-next-bp}) +@item @kbd{C-c C-d C-\} +@tab Disable/Enable current breakpoint (@code{idlwave-shell-toggle-enable-current-bp}) +@item @kbd{C-c C-d C-j} +@tab Set a breakpoint at the beginning of the enclosing routine. @item @kbd{C-c C-d C-s} @tab Step, into function calls (@code{idlwave-shell-step}) @item @kbd{C-c C-d C-n} @@ -2666,16 +2813,19 @@ @item @kbd{C-c C-d C-h} @tab Continue to line at cursor position (@code{idlwave-shell-to-here}) @item @kbd{C-c C-d C-r} -@tab Continue execution to next breakpoint (@code{idlwave-shell-cont}) +@tab Continue execution to next breakpoint, if any (@code{idlwave-shell-cont}) @item @kbd{C-c C-d C-up} @tab Show higher level in calling stack (@code{idlwave-shell-stack-up}) @item @kbd{C-c C-d C-down} @tab Show lower level in calling stack (@code{idlwave-shell-stack-down}) @end multitable +All of these commands have equivalents in Electric Debug Mode, which +provides faster access (@pxref{Electric Debug Mode}). + @defopt idlwave-shell-mark-breakpoints (@code{t}) Non-@code{nil} means mark breakpoints in the source file buffers. The -value indicates the preferred method. Legal values are @code{nil}, +value indicates the preferred method. Valid values are @code{nil}, @code{t}, @code{face}, and @code{glyph}. @end defopt @@ -2684,7 +2834,49 @@ @code{idlwave-shell-mark-breakpoints} has the value @code{face}. @end defopt -@node Walking the Calling Stack, , Breakpoints and Stepping, Debugging IDL Programs +@node Compiling Programs, Walking the Calling Stack, Breakpoints and Stepping, Debugging IDL Programs +@subsection Compiling Programs +@cindex Compiling programs +@cindex Programs, compiling +@cindex Default command line, executing +@cindex Executing a default command line + +@kindex C-c C-d C-c +In order to compile the current buffer under the IDLWAVE shell, press +@kbd{C-c C-d C-c} (@code{idlwave-save-and-run}). This first saves the +current buffer and then sends the command @samp{.run path/to/file} to the +shell. You can also execute @kbd{C-c C-d C-c} from the shell buffer, in +which case the most recently compiled buffer will be saved and +re-compiled. + +When developing or debugging a program, it is often necessary to execute +the same command line many times. A convenient way to do this is +@kbd{C-c C-d C-y} (@code{idlwave-shell-execute-default-command-line}). +This command first resets IDL from a state of interrupted execution by +closing all files and returning to the main interpreter level. Then a +default command line is send to the shell. To edit the default command +line, call @code{idlwave-shell-execute-default-command-line} with a +prefix argument: @kbd{C-u C-c C-d C-y}. If no default command line has +been set (or you give two prefix arguments), the last command on the +@code{comint} input history is sent. + +@defopt idlwave-shell-mark-stop-line (@code{t}) +Non-@code{nil} means mark the source code line where IDL is currently +stopped. The value specifies the preferred method. Valid values are +@code{nil}, @code{t}, @code{arrow}, and @code{face}. +@end defopt + +@defopt idlwave-shell-overlay-arrow (@code{">"}) +The overlay arrow to display at source lines where execution halts, if +configured in @code{idlwave-shell-mark-stop-line}. +@end defopt + +@defopt idlwave-shell-stop-line-face +The face which highlights the source line where IDL is stopped, if +configured in @code{idlwave-shell-mark-stop-line}. +@end defopt + +@node Walking the Calling Stack, Electric Debug Mode, Compiling Programs, Debugging IDL Programs @subsection Walking the Calling Stack @cindex Calling stack, walking @@ -2704,25 +2896,150 @@ higher calling stack levels. @ifhtml +<A NAME="EDEBUG"></A> +@end ifhtml +@node Electric Debug Mode, , Walking the Calling Stack, Debugging IDL Programs +@subsection Electric Debug Mode +@cindex Electric Debug Mode +@cindex @samp{*Debugging*} + +Even with a convenient debug key prefix enabled, repetitive stepping, +variable examination (@pxref{Examining Variables}), and other +debugging activities can be awkward and slow using commands which +require multiple keystrokes. Luckily, there's a better way, inspired +by the lisp e-debug mode, and available through the @emph{Electric +Debug Mode}. By default, as soon as a breakpoint is hit, this minor +mode is enabled. The buffer showing the line where execution has +halted is switched to Electric Debug Mode. This mode is visible as +@samp{*Debugging*} in the mode line, and a different face (violet by +default, where color is available) for the line stopped at point. The +buffer is made read-only and single-character bindings for the most +commonly used debugging commands are enabled: + +@multitable @columnfractions .2 .8 +@item @kbd{a} +@tab Clear all breakpoints (@code{idlwave-shell-clear-all-bp}) +@item @kbd{b} +@tab Set breakpoint, @kbd{C-u b} for a conditional break, @kbd{C-n b} for nth hit (@code{idlwave-shell-break-here}) +@item @kbd{d} +@tab Clear current breakpoint (@code{idlwave-shell-clear-current-bp}) +@item @kbd{h} +@tab Continue to the line at cursor position (@code{idlwave-shell-to-here}) +@item @kbd{i} +@tab Set breakpoint in function named here (@code{idlwave-shell-break-in}) +@item @kbd{[} +@tab Go to the previous breakpoint in the file (@code{idlwave-shell-goto-previous-bp}) +@item @kbd{]} +@tab Go to the next breakpoint in the file +(@code{idlwave-shell-goto-next-bp}) +@item @kbd{\} +@tab Disable/Enable current breakpoint (@code{idlwave-shell-toggle-enable-current-bp}) +@item @kbd{j} +@tab Set breakpoint at beginning of enclosing routine (@code{idlwave-shell-break-this-module}) +@item @kbd{k} +@tab Skip one statement (@code{idlwave-shell-skip}) +@item @kbd{m} +@tab Continue to end of function (@code{idlwave-shell-return}) +@item @kbd{n} +@tab Step, over function calls (@code{idlwave-shell-stepover}) +@item @kbd{o} +@tab Continue past end of function (@code{idlwave-shell-out}) +@item @kbd{p} +@tab Print expression near point or in region with @kbd{C-u p} (@code{idlwave-shell-print}) +@item @kbd{q} +@tab End the debugging session and return to the Shell's main level +(@code{idlwave-shell-retall}) +@item @kbd{r} +@tab Continue execution to next breakpoint, if any (@code{idlwave-shell-cont}) +@item @kbd{s} or @kbd{@key{SPACE}} +@tab Step, into function calls (@code{idlwave-shell-step}) +@item @kbd{t} +@tab Print a calling-level traceback in the shell +@item @kbd{u} +@tab Continue to end of block (@code{idlwave-shell-up}) +@item @kbd{v} +@tab Turn Electric Debug Mode off +(@code{idlwave-shell-electric-debug-mode}) +@item @kbd{x} +@tab Examine expression near point (or in region with @kbd{C-u x}) +with shortcut of examine type. +@item @kbd{z} +@tab Reset IDL (@code{idlwave-shell-reset}) +@item @kbd{+} or @kbd{=} +@tab Show higher level in calling stack (@code{idlwave-shell-stack-up}) +@item @kbd{-} or @kbd{_} +@tab Show lower level in calling stack (@code{idlwave-shell-stack-down}) +@item @kbd{?} +@tab Help on expression near point or in region with @kbd{C-u ?} +(@code{idlwave-shell-help-expression}) +@item @kbd{C-?} +@tab Show help on the commands available. +@end multitable + +Most single-character electric debug bindings use the final keystroke +of the equivalent multiple key commands (which are of course also +still available), but some differ (e.g. @kbd{t},@kbd{q},@kbd{x}). +Some have additional convenience bindings (like @kbd{@key{SPACE}} for +stepping). All prefix and other argument options described in this +section for the commands invoked by electric debug bindings are still +valid. For example, @kbd{C-u b} sets a conditional breakpoint, just +as it did with @kbd{C-u C-c C-d C-b}. + +You can toggle the electric debug mode at any time in a buffer using +@kbd{C-c C-d C-v} (@kbd{v} to turn it off while in the mode), or from +the Debug menu. Normally the mode will be enabled and disabled at the +appropriate times, but occassionally you might want to edit a file +while still debugging it, or switch to the mode for conveniently +setting lots of breakpoints. + +To quickly abandon a debugging session and return to normal editing at +the Shell's main level, use @kbd{q} (@code{idlwave-shell-retall}). +This disables electric debug mode in all IDLWAVE buffers@footnote{Note +that this binding is not symmetric: @kbd{C-c C-d C-q} is bound to +@code{idlwave-shell-quit}, which quits your IDL session.}. Help is +available for the command shortcuts with @kbd{C-?}. If you find this +mode gets in your way, you can keep it from automatically activating +by setting the variable @code{idlwave-shell-automatic-electric-debug} +to @code{nil}, or @code{'breakpoint}. If you'd like the convenient +electric debug shortcuts available also when run-time errors are +encountered, set to @code{t}. + +@defopt idlwave-shell-automatic-electric-debug (@code{'breakpoint}) +Whether to enter electric debug mode automatically when a breakpoint +or run-time error is encountered, and then disable it in all buffers +when the $MAIN$ level is reached (either through normal program +execution, or retall). In addition to @code{nil} for never, and +@code{t} for both breakpoints and errors, this can be +@code{'breakpoint} (the default) to enable it only at breakpoint +halts. +@end defopt + +@defopt idlwave-shell-electric-zap-to-file (@code{t}) +If set, when entering electric debug mode, select the window displaying +the file where point is stopped. This takes point away from the shell +window, but is useful for immediate stepping, etc. +@end defopt + +@ifhtml <A NAME="EXAMINE"></A> @end ifhtml @node Examining Variables, Custom Expression Examination, Debugging IDL Programs, The IDLWAVE Shell @section Examining Variables @cindex @code{PRINT} expressions @cindex @code{HELP}, on expressions -@cindex Expressions, printing -@cindex Expressions, help +@cindex Expressions, printing & help +@cindex Examining expressions @cindex Printing expressions @cindex Mouse binding to print expressions @kindex C-c C-d C-p -Do you find yourself repeatedly typing, e.g. @code{print,n_elements(x)}, -and similar statements to remind yourself of the -type/size/structure/value/etc. of variables and expressions in your code -or at the command line? IDLWAVE has a suite of special commands to -automate these types of variables or expression examinations. They work -by sending statements to the shell formatted to include the indicated -expression. +Do you find yourself repeatedly typing, +e.g. @code{print,n_elements(x)}, and similar statements to remind +yourself of the type/size/structure/value/etc. of variables and +expressions in your code or at the command line? IDLWAVE has a suite +of special commands to automate these types of variable or expression +examinations. They work by sending statements to the shell formatted +to include the indicated expression. These examination commands can be used in the shell or buffer at any time (as long as the shell is running), and are very useful when @@ -2730,7 +3047,7 @@ or while composing a long command in the IDLWAVE shell. In the latter case, the command is sent to the shell and its output is visible, but point remains unmoved in the command being composed --- you can inspect -the constituents of a command you're building without interrupting the +the contituents of a command you're building without interrupting the process of building it! You can even print arbitrary expressions from older input or output further up in the shell window --- any expression, variable, number, or function you see can be examined. @@ -2743,13 +3060,14 @@ The two most basic examine commands are bound to @kbd{C-c C-d C-p}, to print the expression at point, and @kbd{C-c C-d ?}, to invoke help on -this expression. The expression at point is either an array expression -or a function call, or the contents of a pair of parentheses. The -selected expression is highlighted, and simultaneously the resulting -output is highlighted in the shell. Calling the above commands with a -prefix argument will prompt for an expression instead of using the one -at point. Two prefix arguments (@kbd{C-u C-u C-c C-d C-p}) will use the -current region as expression. +this expression@footnote{Available as @kbd{p} and @kbd{?} in Electric +Debug Mode (@pxref{Electric Debug Mode})}. The expression at point is +either an array expression or a function call, or the contents of a +pair of parentheses. The selected expression is highlighted, and +simultaneously the resulting output is highlighted in the shell. +Calling the above commands with a prefix argument will use the current +region as expression instead of using the one at point. Two prefix +arguments (@kbd{C-u C-u C-c C-d C-p}) will prompt for an expression. For added speed and convenience, there are mouse bindings which allow you to click on expressions and examine their values. Use @@ -2757,10 +3075,10 @@ help (i.e. you need to hold down @key{META} and @key{CONTROL} while clicking with the middle mouse button). If you simply click, the nearest expression will be selected in the same manner as described -above. You can also @emph{drag} the mouse in order to highlight exactly -a specific expression or sub-expression to be examined. For custom -expression examination, and the customizable pop-up examine selection, -@xref{Custom Expression Examination}. +above. You can also @emph{drag} the mouse in order to highlight +exactly the specific expression or sub-expression you want to examine. +For custom expression examination, and the powerful customizable +pop-up examine selection, @xref{Custom Expression Examination}. @cindex Printing expressions, on calling stack @cindex Restrictions for expression printing @@ -2782,7 +3100,8 @@ @cindex ROUTINE_NAMES, IDL procedure N.B.: printing values of expressions on higher levels of the calling stack uses the @emph{unsupported} IDL routine @code{ROUTINE_NAMES}, -which may or may not be available in future versions of IDL. +which may or may not be available in future versions of IDL. Caveat +Examinor. @end itemize @defopt idlwave-shell-expression-face @@ -2792,14 +3111,14 @@ @end defopt @defopt idlwave-shell-output-face -The face for @code{idlwave-shell-output-overlay}. +The face for @code{idlwave-shell-output-overlay}. Allows to choose the font, color and other properties for the most recent output of IDL when examining an expression." @end defopt @defopt idlwave-shell-separate-examine-output (@code{t}) If non-@code{nil}, re-direct the output of examine commands to a special -@file{*Examine*} buffer, instead of in the shell itself. +@file{*Examine*} buffer, instead of in the shell itself. @end defopt @node Custom Expression Examination, , Examining Variables, The IDLWAVE Shell @@ -2812,45 +3131,53 @@ @code{widget_info()}). Rather than attempt to include them all, IDLWAVE provides two easy methods to customize your own commands, with a special mouse examine command, and two macros for generating your own examine -bindings. - -The most powerful and flexible mouse examine command is available on -@kbd{C-S-Mouse-2}. Just as for all the other mouse examine commands, it -permits click or drag expression selection, but instead of sending -hard-coded commands to the shell, it pops-up a customizable selection -list of examine functions to choose among, configured with the -@code{idlwave-shell-examine-alist} variable. This variable is a list of -key-value pairs (an @emph{alist} in Emacs parlance), where the keys name -the command, and the values are the command strings, in which the text -@code{___} (three underscores) will be replaced by the selected -expression before being sent to the shell. An example might be key -@code{Structure Help} with value @code{help,___,/STRUCTURE}. -@code{idlwave-shell-examine-alist} comes by default with a large list of -examine commands, but can be easily customized to add more. - -In addition to the pop-up mouse command, you can easily create your own -customized bindings to inspect expressions using the two convenience -macros @code{idlwave-shell-inspect} and -@code{idlwave-shell-mouse-inspect}. These create keyboard or -mouse-based custom inspections of variables, sharing all the same -properties of the built-in examine commands. Both functions take a -single string argument sharing the syntax of the +key and mouse bindings. + +The most powerful and flexible mouse examine command of all is +available on @kbd{C-S-Mouse-2}. Just as for all the other mouse +examine commands, it permits click or drag expression selection, but +instead of sending hard-coded commands to the shell, it pops-up a +customizable selection list of examine functions to choose among, +configured with the @code{idlwave-shell-examine-alist} +variable@footnote{In Electric Debug Mode (@pxref{Electric Debug +Mode}), the key @kbd{x} provides a single-character shortcut interface +to the same examine functions for the expression at point or marked by +the region.}. This variable is a list of key-value pairs (an +@emph{alist} in Emacs parlance), where the key gives a name to be +shown for the examine command, and the value is the command strings +itself, in which the text @code{___} (three underscores) will be +replaced by the selected expression before being sent to the shell. +An example might be key @code{Structure Help} with value +@code{help,___,/STRUCTURE}. In that case, you'd be prompted with +@emph{Structure Help}, which might send something like +@code{help,var,/STRUCTURE} to the shell for output. +@code{idlwave-shell-examine-alist} comes configured by default with a +large list of examine commands, but you can easily customize it to add +your own. + +In addition to configuring the functions available to the pop-up mouse +command, you can easily create your own customized bindings to inspect +expressions using the two convenience macros +@code{idlwave-shell-examine} and @code{idlwave-shell-mouse-examine}. +These create keyboard or mouse-based custom inspections of variables, +sharing all the same properties of the built-in examine commands. +Both functions take a single string argument sharing the syntax of the @code{idlwave-shell-examine-alist} values, e.g.: @lisp (add-hook 'idlwave-shell-mode-hook (lambda () - (idlwave-shell-define-key-both [s-down-mouse-2] - (idlwave-shell-mouse-examine + (idlwave-shell-define-key-both [s-down-mouse-2] + (idlwave-shell-mouse-examine "print, size(___,/DIMENSIONS)")) (idlwave-shell-define-key-both [f9] (idlwave-shell-examine "print, size(___,/DIMENSIONS)")) - (idlwave-shell-define-key-both [f10] (idlwave-shell-examine + (idlwave-shell-define-key-both [f10] (idlwave-shell-examine "print,size(___,/TNAME)")) (idlwave-shell-define-key-both [f11] (idlwave-shell-examine "help,___,/STRUCTURE")))) -@end lisp - +@end lisp + @noindent Now pressing @key{f9}, or middle-mouse dragging with the @key{SUPER} key depressed, will print the dimensions of the nearby or highlighted expression. Pressing @key{f10} will give the type string, @@ -2858,98 +3185,14 @@ see, the possibilities are only marginally finite. @defopt idlwave-shell-examine-alist -An alist of examine commands in which the keys name the command and are -displayed in the selection pop-up, and the values are custom IDL examine -command strings to send, after all instances of @code{___} are replaced -by the indicated expression. +An alist of examine commands in which the keys name the command and +are displayed in the selection pop-up, and the values are custom IDL +examine command strings to send, after all instances of @code{___} +(three underscores) are replaced by the indicated expression. @end defopt -@node Installation, Acknowledgements, The IDLWAVE Shell, Top -@chapter Installation -@cindex Installation - -@menu -* Installing IDLWAVE:: How to install the distribution -* Installing Online Help:: Where to get the additional files needed -* Upgrading from idl.el:: Necessary configuration changes -@end menu - -@node Installing IDLWAVE, Installing Online Help, Installation, Installation -@section Installing IDLWAVE - -@cindex FTP site -@cindex URL, homepage for IDLWAVE -@cindex Homepage for IDLWAVE -@cindex IDLWAVE, homepage -@cindex XEmacs package IDLWAVE -@cindex Emacs, distributed with IDLWAVE -@cindex Copyright, of IDL manual -IDLWAVE is part of Emacs 21.1 and later. It is also an XEmacs package -and can be installed from -@uref{ftp://ftp.xemacs.org/pub/xemacs/packages/,the XEmacs ftp site} -with the normal package management system on XEmacs 21. These -pre-installed versions should work out-of-the-box. However, the files -required for online help are not distributed with XEmacs/Emacs and have -to be installed separately@footnote{Due to copyright reasons, the ASCII -version of the IDL manual cannot be distributed under the GPL.} -(@pxref{Installing Online Help}). - -You can also download IDLWAVE and install it yourself from -@uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. Follow the -instructions in the INSTALL file. - -@node Installing Online Help, Upgrading from idl.el, Installing IDLWAVE, Installation -@section Installing Online Help -@cindex Installing online help -@cindex Online Help, Installation - -If you want to use the online help display, two additional files (an -ASCII version of the IDL documentation and a topics/code file) must be -installed. These files can also be downloaded from -@uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. You need to -place the files somewhere on your system and tell IDLWAVE where they are -with - -@lisp -(setq idlwave-help-directory "/path/to/help/files/") -@end lisp - -@node Upgrading from idl.el, , Installing Online Help, Installation -@section Upgrading from the old @b{@file{idl.el}} file -@cindex Upgrading from old @b{@file{idl.el}} -@cindex Renaming old variables -@cindex Old variables, renaming -@kindex M-@key{TAB} - -If you have been using the old @file{idl.el} and @file{idl-shell.el} -files and would like to use IDLWAVE, you need to update your -customization in @file{.emacs}. - -@enumerate -@item -Change all variable and function prefixes from @samp{idl-} to @samp{idlwave-}. -@item -Remove the now invalid @code{autoload} and @code{auto-mode-alist} forms -pointing to the @file{idl.el} and @file{idl-shell.el} files. Install -the new autoload forms. -@item -If you have been using the hook function recommended in earlier versions -to get a separate frame for the IDL shell, remove that command from your -@code{idlwave-shell-mode-hook}. Instead, set the variable -@code{idlwave-shell-use-dedicated-frame} with -@lisp -(setq idlwave-shell-use-dedicated-frame t) -@end lisp -@item -The key sequence @kbd{M-@key{TAB}} no longer inserts a TAB character. -Like in many other Emacs modes, @kbd{M-@key{TAB}} now does -completion. Inserting a TAB has therefore been moved to -@kbd{C-@key{TAB}}. On a character based terminal you can also use -@kbd{C-c @key{SPC}}. -@end enumerate - -@node Acknowledgements, Sources of Routine Info, Installation, Top +@node Acknowledgements, Sources of Routine Info, The IDLWAVE Shell, Top @chapter Acknowledgements @cindex Acknowledgements @cindex Maintainer, of IDLWAVE @@ -2973,10 +3216,11 @@ everything, modernized IDLWAVE with many new features, and developed the manual. -@item +@item @uref{mailto:jdsmith@@as.arizona.edu, @b{J.D. Smith}}, the current maintainer, as of version 4.10, helped shape object method completion -and most new features introduced in versions 4.x. +and most new features introduced in versions 4.x, and added +significant new capabilities for versions 5.x. @end itemize @noindent @@ -2985,43 +3229,45 @@ @itemize @minus @item -Ulrik Dickow <dickow@@nbi.dk> +Ulrik Dickow <dickow__at__nbi.dk> @item -Eric E. Dors <edors@@lanl.gov> +Eric E. Dors <edors__at__lanl.gov> @item -Stein Vidar H. Haugan <s.v.h.haugan@@astro.uio.no> +Stein Vidar H. Haugan <s.v.h.haugan__at__astro.uio.no> @item -David Huenemoerder <dph@@space.mit.edu> +David Huenemoerder <dph__at__space.mit.edu> @item -Kevin Ivory <Kevin.Ivory@@linmpi.mpg.de> +Kevin Ivory <Kevin.Ivory__at__linmpi.mpg.de> @item -Dick Jackson <dick@@d-jackson.com> +Dick Jackson <dick__at__d-jackson.com> @item -Xuyong Liu <liu@@stsci.edu> +Xuyong Liu <liu__at__stsci.edu> @item -Simon Marshall <Simon.Marshall@@esrin.esa.it> +Simon Marshall <Simon.Marshall__at__esrin.esa.it> @item -Craig Markwardt <craigm@@cow.physics.wisc.edu> +Craig Markwardt <craigm__at__cow.physics.wisc.edu> @item -Laurent Mugnier <mugnier@@onera.fr> +Laurent Mugnier <mugnier__at__onera.fr> @item -Lubos Pochman <lubos@@rsinc.com> +Lubos Pochman <lubos__at__rsinc.com> @item -Bob Portmann <portmann@@al.noaa.gov> +Bob Portmann <portmann__at__al.noaa.gov> @item -Patrick M. Ryan <pat@@jaameri.gsfc.nasa.gov> +Patrick M. Ryan <pat__at__jaameri.gsfc.nasa.gov> @item -Marty Ryba <ryba@@ll.mit.edu> +Marty Ryba <ryba__at__ll.mit.edu> @item -Phil Williams <williams@@irc.chmcc.org> +Phil Williams <williams__at__irc.chmcc.org> @item -Phil Sterne <sterne@@dublin.llnl.gov> +Phil Sterne <sterne__at__dublin.llnl.gov> +@item +Paul Sorenson <aardvark62__at__msn.com> @end itemize @noindent Thanks to everyone! -@node Sources of Routine Info, Configuration Examples, Acknowledgements, Top +@node Sources of Routine Info, HTML Help Browser Tips, Acknowledgements, Top @appendix Sources of Routine Info @cindex Sources of routine information @@ -3033,7 +3279,7 @@ @menu * Routine Definitions:: Where IDL Routines are defined. * Routine Information Sources:: So how does IDLWAVE know about... -* Library Catalog:: Scanning the Libraries for Routine Info +* Catalogs:: * Load-Path Shadows:: Routines defined in several places * Documentation Scan:: Scanning the IDL Manuals @end menu @@ -3051,14 +3297,14 @@ several places: @enumerate -@item +@item @emph{Builtin routines} are defined inside IDL itself. The source code of such routines is not available. @item Routines which are @emph{part of the current program}, are defined in a file explicitly compiled by the user. This file may or may not be located on the IDL search path. -@item +@item @emph{Library routines} are defined in files located on IDL's search path, and will not need to be manually compiled. When a library routine is called for the first time, IDL will find the source file and compile @@ -3072,7 +3318,7 @@ cannot provide routine info and completion for such external routines. @end enumerate -@node Routine Information Sources, Library Catalog, Routine Definitions, Sources of Routine Info +@node Routine Information Sources, Catalogs, Routine Definitions, Sources of Routine Info @appendixsec Routine Information Sources @cindex Routine info sources @cindex Builtin list of routines @@ -3087,21 +3333,21 @@ @enumerate @item -It has a @emph{builtin list} with the properties of the builtin IDL -routines. IDLWAVE @value{VERSION} is distributed with a list of +It has a @emph{builtin list} with information about the routines IDL +ships with. IDLWAVE @value{VERSION} is distributed with a list of @value{NSYSROUTINES} routines and @value{NSYSKEYWORDS} keywords, reflecting IDL version @value{IDLVERSION}. This list has been created by scanning the IDL manuals and is stored in the file -@file{idlw-rinfo.el}. @xref{Documentation Scan}, for information on how -to regenerate this file for new versions of IDL. - -@item +@file{idlw-rinfo.el}. @xref{Documentation Scan}, for information on +how to regenerate this file for new versions of IDL. + +@item It @emph{scans} all @emph{buffers} of the current Emacs session for routine definitions. This is done automatically when routine information or completion is first requested by the user. Each new -buffer and each buffer which is saved after making changes is also -scanned. The command @kbd{C-c C-i} (@code{idlwave-update-routine-info}) -can be used at any time to rescan all buffers. +buffer and each buffer saved after making changes is also scanned. The +command @kbd{C-c C-i} (@code{idlwave-update-routine-info}) can be used +at any time to rescan all buffers. @item If you have an IDLWAVE-Shell running in the Emacs session, IDLWAVE will @@ -3113,19 +3359,28 @@ routine data. @item -IDLWAVE can scan all or selected library source files and store the -result in a file which will be automatically loaded just like -@file{idlw-rinfo.el}. @xref{Library Catalog}, for information how to -scan library files. +Many popular libraries are distributed with routine information +already scanned into @emph{library catalogs} (@pxref{Library +Catalogs}). These per-directory catalog files can also be built by +the user with the supplied @file{idlwave_catalog} tool. + +@item +IDLWAVE can scan selected directories of source files and store the +result in a single @emph{user catalog} file which will be +automatically loaded just like @file{idlw-rinfo.el}. @xref{User +Catalog}, for information on how to scan files in this way. @end enumerate -Loading routine and catalog information is a time consuming process. -Depending on the system and network configuration it can take up to 30 -seconds. In order to minimize the waiting time upon your first -completion or routine info command in a session, IDLWAVE uses Emacs idle -time to do the initialization in 5 steps, yielding to user input in -between. If this gets into your way, set the variable -@code{idlwave-init-rinfo-when-idle-after} to 0 (zero). +Loading routine and catalog information can be a time consuming process, +especially over slow networks. Depending on the system and network +configuration it could take up to 30 seconds. In order to minimize the +wait time upon your first completion or routine info command in a +session, IDLWAVE uses Emacs idle time to do the initialization in six +steps, yielding to user input in between. If this gets into your way, +set the variable @code{idlwave-init-rinfo-when-idle-after} to 0 (zero). +The more routines documented in library and user catalogs, the slower +the loading will be, so reducing this number can help alleviate any long +load times. @defopt idlwave-init-rinfo-when-idle-after (@code{10}) Seconds of idle time before routine info is automatically initialized. @@ -3144,82 +3399,199 @@ Controls under what circumstances routine info is updated automatically. @end defopt -@node Library Catalog, Load-Path Shadows, Routine Information Sources, Sources of Routine Info -@appendixsec Library Catalog -@cindex Library scan -@cindex Library catalog +@ifhtml +<A NAME="CATALOGS"></A> +@end ifhtml +@node Catalogs, Load-Path Shadows, Routine Information Sources, Sources of Routine Info +@appendixsec Catalogs +@cindex Catalogs + +@emph{Catalogs} are files containing scanned information on individual +routines, including arguments and keywords, calling sequence, file path, +class and procedure vs. function type, etc. They represent a way of +extending the internal built-in information available for IDL system +routines (@pxref{Routine Info}) to other source collections. + +Starting with version 5.0, there are two types of catalogs available +with IDLWAVE. The traditional @emph{user catalog} and the newer +@emph{library catalogs}. Although they can be used interchangeably, the +library catalogs are more flexible, and preferred. There are few +occasions when a user catalog might be preferred --- read below. Both +types of catalogs can coexist without causing problems. + +To facilitate the catalog systems, IDLWAVE stores information it gathers +from the shell about the IDL search paths, and can write this +information out automatically, or on-demand (menu @code{Debug->Save Path +Info}). On systems with no shell from which to discover the path +information (e.g. Windows), a library path must be specified in +@code{idlwave-library-path} to allow library catalogs to be located, and +to setup directories for user catalog scan (@pxref{User Catalog} for +more on this variable). + +@defopt idlwave-auto-write-path (@code{t}) +Write out information on the !PATH and !DIR paths from IDL automatically +when they change and when the Shell is closed. These paths are needed +to locate library catalogs. +@end defopt + +@defopt idlwave-library-path +IDL library path for Windows and MacOS. Not needed under Unix/MacOSX. +@end defopt + +@defopt idlwave-system-directory +The IDL system directory for Windows and MacOS. Not needed under +Unix/MacOSX (obtained from the Shell). +@end defopt + +@defopt idlwave-config-directory (@file{~/.idlwave}) +Default path where IDLWAVE saves configuration information and any +user catalog. +@end defopt + +@menu +* Library Catalogs:: +* User Catalog:: +@end menu + +@ifhtml +<A NAME="LIBRARY_CATALOGS"></A> +@end ifhtml +@node Library Catalogs, User Catalog, Catalogs, Catalogs +@appendixsubsec Library Catalogs +@cindex @file{.idlwave_catalog} +@cindex Library catalogs +@cindex @code{idlwave_catalog} + +Library catalogs are files named @file{.idlwave_catalog} stored in +directories containing @code{.pro} routine files. They are discovered +on the IDL search path and loaded automatically when routine information +is read. Each catalog file documents the routines found in that +directory --- one catalog per directory. Every catalog has a library +name associated with it (e.g. @emph{AstroLib}). This name will be shown +briefly when the catalog is found, and in the routine info of routines +it documents. + +Many popular libraries of routines are shipped with IDLWAVE catalog +files by default, and so will be automatically discovered. Library +catalogs are scanned externally to Emacs using a tool provided with +IDLWAVE. Each catalog can be re-scanned independently of any other. +Catalogs can easily be made available system-wide with a common source +repository, providing uniform routine information, and lifting the +burden of scanning from the user (who may not even know they're using a +scanned catalog). Since all catalogs are independent, they can be +re-scanned automatically to gather updates, e.g. in a @file{cron} job. +Scanning is much faster than with the built-in user catalog method. One +minor disadvantage: the entire IDL search path is scanned for catalog +files every time IDLWAVE starts up, which might be slow over a network. + +A Perl tool to create library catalogs is distributed with IDLWAVE: +@code{idlwave_catalog}. It can be called quite simply: +@example +idlwave_catalog MyLib +@end example + +@noindent This would scan all directories recursively beneath the current and +populate them with @file{.idlwave_catalog} files, tagging the routines +found with the name library ``MyLib''. The full usage information: + +@example +Usage: idlwave_catalog [-l] [-v] [-d] [-s] [-f] [-h] libname + libname - Unique name of the catalog (4 or more alphanumeric + characters). + -l - Scan local directory only, otherwise recursively + catalog all directories at or beneath this one. + -v - Print verbose information. + -d - Instead of scanning, delete all .idlwave_catalog files + here or below. + -s - Be silent. + -f - Force overwriting any catalogs found with a different + library name. + -h - Print this usage. +@end example + +To re-load the library catalogs on the IDL path, force a system routine +info update using a single prefix to @code{idlwave-update-routine-info}: +@kbd{C-u C-c C-i}. + +@defopt idlwave-use-library-catalogs (@code{t}) +Whether to search for and load library catalogs. Only disable if +performance is a problem and the catalogs are not needed. +@end defopt + +@node User Catalog, , Library Catalogs, Catalogs +@appendixsubsec User Catalog +@cindex User catalog @cindex IDL library routine info @cindex Windows @cindex MacOS @cindex IDL variable @code{!DIR} @cindex @code{!DIR}, IDL variable - -IDLWAVE can extract routine information from library modules and store -that information in a file. To do this, the variable -@code{idlwave-libinfo-file} needs to contain the path to a file in an -existing directory (the default is @code{"~/.idlcat.el"}). Since the -file will contain lisp code, its name should end in @file{.el}. Under -Windows and MacOS, you also need to specify the search path for IDL -library files in the variable @code{idlwave-library-path}, and the -location of the IDL directory (the value of the @code{!DIR} system -variable) in the variable @code{idlwave-system-directory}, like -this@footnote{The initial @samp{+} leads to recursive expansion of the -path, just like in IDL}: +The user catalog is the old routine catalog system. It is produced +within Emacs, and stored in a single file in the user's home directory +(@file{.idlwave/idlusercat.el} by default). Although library catalogs +are more flexible, there may be reasons to prefer a user catalog +instead, including: + +@itemize @bullet +@item The scan is internal to Emacs, so you don't need a working Perl +installation, as you do for library catalogs. +@item Can be used to scan directories for which the user has no write +privileges. +@item Easy widget-based path selection. +@end itemize + +However, no routine info is available in the user catalog by default; +the user must actively complete a scan. In addition, this type of +catalog is all or nothing: if a single routine changes, the entire +catalog must be rescanned to update it. Creating the user catalog is +also much slower than scanning library catalogs. + +You can scan any of the directories on the currently known path. Under +Windows and MacOS (not OSX), you need to specify the IDL search path in +the variable @code{idlwave-library-path}, and the location of the IDL +directory (the value of the @code{!DIR} system variable) in the variable +@code{idlwave-system-directory}, like this@footnote{The initial @samp{+} +leads to recursive expansion of the path, just like in IDL}: @lisp (setq idlwave-library-path - '("+c:/RSI/IDL54/lib/" "+c:/user/me/idllibs" )) -(setq idlwave-system-directory "c:/RSI/IDL54/") + '("+c:/RSI/IDL56/lib/" "+c:/user/me/idllibs")) +(setq idlwave-system-directory "c:/RSI/IDL56/") @end lisp -@noindent Under GNU and UNIX, these values will be automatically inferred from -an IDLWAVE shell. - -The command @kbd{M-x idlwave-create-libinfo-file} can then be used to -scan library files. It brings up a widget in which you can select some -or all directories on the search path. If you only want to have routine -and completion info of some libraries, it is sufficient to scan those -directories. However, if you want IDLWAVE to detect possible name -conflicts with routines defined in other libraries, the whole pass -should be scanned. +@noindent Under GNU and UNIX, these values will be automatically gathered from +the IDLWAVE shell. + +The command @kbd{M-x idlwave-create-user-catalog-file} (or the menu item +@samp{IDLWAVE->Routine Info->Select Catalog Directories} can then be +used to create a user catalog. It brings up a widget in which you can +select some or all directories on the search path. Directories which +already contain a library catalog are marked with @samp{[LIB]}, and need +not be scanned (although there is no harm if you do so, other than the +additional memory used for the duplication). After selecting directories, click on the @w{@samp{[Scan & Save]}} button in the widget to scan all files in the selected directories and -write the resulting routine information into the file -@code{idlwave-libinfo-file}. In order to update the library information -from the same directories, call the command +write out the resulting routine information. In order to update the +library information using the directory selection, call the command @code{idlwave-update-routine-info} with a double prefix argument: @w{@kbd{C-u C-u C-c C-i}}. This will rescan files in the previously -selected directories, write an updated version of the libinfo file and -rebuild IDLWAVE's internal lists. If you give three prefix arguments -@w{@kbd{C-u C-u C-u C-c C-i}}, updating will be done with a background -job@footnote{Unix systems only, I think.}. You can continue to work, -and the library catalog will be re-read when it is ready. - -A note of caution: Depending on your local installation, the IDL -library can be very large. Parsing it for routine information will take -time and loading this information into Emacs can require a -significant amount of memory. However, having this information -available will be a great help. - -@defopt idlwave-libinfo-file -File for routine information of the IDL library. -@end defopt - -@defopt idlwave-library-path -IDL library path for Windows and MacOS. Not needed under Unix. -@end defopt - -@defopt idlwave-system-directory -The IDL system directory for Windows and MacOS. Not needed under Unix. -@end defopt +selected directories, write an updated version of the user catalog file +and rebuild IDLWAVE's internal lists. If you give three prefix +arguments @w{@kbd{C-u C-u C-u C-c C-i}}, updating will be done with a +background job@footnote{Unix systems only, I think.}. You can continue +to work, and the library catalog will be re-read when it is ready. If +you find you need to update the user catalog often, you should consider +building a library catalog for your routines instead (@pxref{Library +Catalogs}). @defopt idlwave-special-lib-alist -Alist of regular expressions matching special library directories. +Alist of regular expressions matching special library directories for +labeling in routine-info display. @end defopt -@node Load-Path Shadows, Documentation Scan, Library Catalog, Sources of Routine Info +@node Load-Path Shadows, Documentation Scan, Catalogs, Sources of Routine Info @appendixsec Load-Path Shadows @cindex Load-path shadows @cindex Shadows, load-path @@ -3229,18 +3601,19 @@ @cindex Application, testing for shadowing @cindex Buffer, testing for shadowing -IDLWAVE can compile a list of routines which are defined in several -different files. Since one definition will hide (shadow) the others +IDLWAVE can compile a list of routines which are (re-)defined in more +than one file. Since one definition will hide (shadow) the others depending on which file is compiled first, such multiple definitions are called "load-path shadows". IDLWAVE has several routines to scan for load path shadows. The output is placed into the special buffer @file{*Shadows*}. The format of the output is identical to the source section of the routine info buffer (@pxref{Routine Info}). The -different definitions of a routine are listed in the sequence of -@emph{likelihood of use}. So the first entry will be most likely the -one you'll get if an unsuspecting command uses that routine. Before -listing shadows, you should make sure that routine info is up-to-date by -pressing @kbd{C-c C-i}. Here are the different routines: +different definitions of a routine are ordered by @emph{likelihood of +use}. So the first entry will be most likely the one you'll get if an +unsuspecting command uses that routine. Before listing shadows, you +should make sure that routine info is up-to-date by pressing @kbd{C-c +C-i}. Here are the different routines (also available in the Menu +@samp{IDLWAVE->Routine Info}): @table @asis @item @kbd{M-x idlwave-list-buffer-load-path-shadows} @@ -3257,9 +3630,9 @@ This command checks all routines accessible to IDLWAVE for conflicts. @end table -For these commands to work properly you should have scanned the entire -load path, not just selected directories. Also, IDLWAVE should be able -to distinguish between the system library files (normally installed in +For these commands to work fully you need to scan the entire load path +in either a user or library catalog. Also, IDLWAVE should be able to +distinguish between the system library files (normally installed in @file{/usr/local/rsi/idl/lib}) and any site specific or user specific files. Therefore, such local files should not be installed inside the @file{lib} directory of the IDL directory. This is also advisable for @@ -3279,37 +3652,102 @@ on the load path is routine info display (@pxref{Routine Info}). @node Documentation Scan, , Load-Path Shadows, Sources of Routine Info -@appendixsec Documentation Scan -@cindex @file{get_rinfo} +@appendixsec Documentation Scan +@cindex @file{get_html_rinfo} @cindex @file{idlw-rinfo.el} -@cindex @file{idlw-help.txt} -@cindex @file{idlw-help.el} @cindex Scanning the documentation @cindex Perl program, to create @file{idlw-rinfo.el} -IDLWAVE derives it knowledge about system routines from the IDL +IDLWAVE derives its knowledge about system routines from the IDL manuals. The file @file{idlw-rinfo.el} contains the routine information -for the IDL system routines. The Online Help feature of IDLWAVE -requires ASCII versions of some IDL manuals to be available in a -specific format (@file{idlw-help.txt}), along with an Emacs-Lisp file -@file{idlw-help.el} with supporting code and pointers to the ASCII file. - -All 3 files can be derived from the IDL documentation. If you are -lucky, the maintainer of IDLWAVE will always have access to the newest -version of IDL and provide updates. The IDLWAVE distribution also -contains the Perl program @file{get_rinfo} which constructs these files -by scanning selected files from the IDL documentation. Instructions on -how to use @file{get_rinfo} are in the program itself. - -One particularly frustrating situation occurs when a new IDL version is -released without the associated documentation updates. Instead, a -@emph{What's New} file containing new and updated documentation is -shipped alongside the previous version's reference material. The -@file{get_rinfo} script can merge this new information into the standard -help text and routine information, as long as it is pre-formatted in a -simple way. See @file{get_rinfo} for more information. - -@node Configuration Examples, Windows and MacOS, Sources of Routine Info, Top +for the IDL system routines, and links to relevant sections of the HTML +documentation. The Online Help feature of IDLWAVE requires HTML +versions of the IDL manuals to be available. + +The HTML files and related images can be produced from the +@file{idl.chm} HTMLHelp file distributed with IDL using the free +Microsoft HTML Help Workshop. If you are lucky, the maintainer of +IDLWAVE will always have access to the newest version of IDL and +provide updates. The IDLWAVE distribution also contains the Perl +program @file{get_html_rinfo} which constructs the +@file{idlw-rinfo.el} file by scanning the HTML documents produced from +the IDL documentation. Instructions on how to use +@file{get_html_rinfo} are in the program itself. + +@node HTML Help Browser Tips, Configuration Examples, Sources of Routine Info, Top +@appendix HTML Help Browser Tips +@cindex Browser Tips + +There are a wide variety of possible browsers to use for displaying +the online HTML help available with IDLWAVE (starting with version +5.0). Since IDLWAVE runs on a many different system types, a single +browser configuration is not possible, but choices abound. + +Unfortunately, the HTML manuals decompiled from the original +source contain formatting structures which Netscape 4.x does not +handle well, though they are still readable. A much better choice is +Mozilla, or one of the Mozilla-derived browsers such as +@uref{http://galeon.sourceforge.net/,Galeon} (GNU/Linux), +@uref{http://www.mozilla.org/projects/camino/,Camino} (MacOSX), or +@uref{http://www.mozilla.org/projects/firebird/,Firebird} (all +platforms). Newer versions of Emacs provide a browser-function choice +@code{browse-url-gnome-moz} which uses the Gnome-configured browser. + +Note that the HTML files decompiled from Microsoft Help sources +contain specific references to the @samp{Symbol} font, which by default +is not permitted in normal encodings (it's invalid, technically). Though +it only impacts a few symbols, you can trick Mozilla-based browsers into +recognizing @samp{Symbol} by following the directions +@uref{http://hutchinson.belmont.ma.us/tth/Xfonts.html, here}. With this +fix in place, HTML help pages look almost identical to their PDF +equivalents (yet can be bookmarked, browsed as history, searched, etc.). + +@noindent Individual platform recommendations: + +@itemize @bullet +@item Windows: The native Microsoft HTMLHelp browser is preferred, +with even better results using the free +@uref{http://www.keyworks.net/keyhh.htm,@code{KEYHH}} program to +permit IDL help to be targetted to a single window. To use HTMLHelp, +specify @code{idlwave-help-use-hh} as @code{'hh} or @code{'keyhh}. +One bonus: since IDL is shipped with the @file{idl.chm} help file, you +don't need to download the HTML help package. @xref{Help with HTML +Documentation}. +@item Unix/MacOSX: The @uref{http://www.w3m.org,@code{w3m}} browser +and its associated +@uref{http://emacs-w3m.namazu.org/,@code{emacs-w3m}} emacs mode +provide in-buffer browsing with image display, and excellent speed and +formatting. Both the Emacs mode and the browser itself must be +downloaded separately. To use this browser, include + +@lisp +(setq idlwave-help-browser-function 'w3m-browse-url) +@end lisp + +in your @file{.emacs}. Setting a few other nice @code{w3m} options +cuts down on screen clutter: + +@lisp +(setq w3m-use-tab nil + w3m-use-header-line nil + w3m-use-toolbar nil) +@end lisp + +If you use a dedicated frame for help, you might want to add the +following, to get consistent behavior with the @kbd{q} key: + +@lisp +;; Close my help window when w3m closes. +(defadvice w3m-close-window (after idlwave-close activate) + (if (boundp 'idlwave-help-frame) + (idlwave-help-quit))) +@end lisp + +Note that you can open the file in an external browser from within +@code{w3m} using @kbd{M}. +@end itemize + +@node Configuration Examples, Windows and MacOS, HTML Help Browser Tips, Top @appendix Configuration Examples @cindex Configuration examples @cindex Example configuration @@ -3370,7 +3808,7 @@ (setq idlwave-main-block-indent 3) (setq idlwave-end-offset -3) (setq idlwave-continuation-indent 1) -(setq idlwave-begin-line-comment "^;[^;]") ; Leave ";" but not ";;" +(setq idlwave-begin-line-comment "^;[^;]") ; Leave ";" but not ";;" ; anchored at start of line. (setq idlwave-surround-by-blank t) ; Turn on padding ops =,<,> (setq idlwave-pad-keyword nil) ; Remove spaces for keyword '=' @@ -3388,6 +3826,18 @@ ("SETPROPERTY" .t) ("GETPROPERTY" .t))) +;; Using w3m for help (must install w3m and emacs-w3m) +(autoload 'w3m-browse-url "w3m" "Interface for w3m on Emacs." t) +(setq idlwave-help-browser-function 'w3m-browse-url + w3m-use-tab nil ; no tabs, location line, or toolbar + w3m-use-header-line nil + w3m-use-toolbar nil) + +;; Close my help window or frame when w3m closes with `q' +(defadvice w3m-close-window (after idlwave-close activate) + (if (boundp 'idlwave-help-frame) + (idlwave-help-quit))) + ;; Some setting can only be done from a mode hook. Here is an example: (add-hook 'idlwave-mode-hook (lambda () @@ -3395,6 +3845,7 @@ ;; Run other functions here (font-lock-mode 1) ; Turn on font-lock mode (idlwave-auto-fill-mode 0) ; Turn off auto filling + (setq idlwave-help-browser-function 'browse-url-w3) ;; Pad with 1 space (if -n is used then make the ;; padding a minimum of n spaces.) The defaults use -1 @@ -3424,10 +3875,10 @@ ;; (local-set-key "\C-j" 'idlwave-newline) ; My preference. ;; Some personal abbreviations - (define-abbrev idlwave-mode-abbrev-table + (define-abbrev idlwave-mode-abbrev-table (concat idlwave-abbrev-start-char "wb") "widget_base()" (idlwave-keyword-abbrev 1)) - (define-abbrev idlwave-mode-abbrev-table + (define-abbrev idlwave-mode-abbrev-table (concat idlwave-abbrev-start-char "on") "obj_new()" (idlwave-keyword-abbrev 1)) )) @@ -3445,12 +3896,12 @@ (add-hook 'idlwave-shell-mode-hook (lambda () ;; Set up some custom key and mouse examine commands - (idlwave-shell-define-key-both [s-down-mouse-2] - (idlwave-shell-mouse-examine + (idlwave-shell-define-key-both [s-down-mouse-2] + (idlwave-shell-mouse-examine "print, size(___,/DIMENSIONS)")) (idlwave-shell-define-key-both [f9] (idlwave-shell-examine "print, size(___,/DIMENSIONS)")) - (idlwave-shell-define-key-both [f10] (idlwave-shell-examine + (idlwave-shell-define-key-both [f10] (idlwave-shell-examine "print,size(___,/TNAME)")) (idlwave-shell-define-key-both [f11] (idlwave-shell-examine "help,___,/STRUCTURE")))) @@ -3459,27 +3910,25 @@ @ifhtml <A NAME="WIN_MAC"></A> @end ifhtml -@node Windows and MacOS, Index, Configuration Examples, Top +@node Windows and MacOS, Troubleshooting, Configuration Examples, Top @appendix Windows and MacOS @cindex Windows @cindex MacOS - -IDLWAVE was developed on a UNIX system. However, due to the portability -of Emacs, much of IDLWAVE does also work under different operating -systems like Windows (with NTEmacs or NTXEmacs) or MacOS. - -The only problem really is that RSI does not provide a command-line -version of IDL for Windows or MacOS with which IDLWAVE can -interact@footnote{Call your RSI representative and complain --- it -should be trivial for them to provide one. And if enough people ask -for it, maybe they will. The upcoming IDL for Mac OSX is slated to -have a command-line version.}. Therefore the IDLWAVE Shell does not -work and you have to rely on IDLDE to run and debug your programs. -However, editing IDL source files with Emacs/IDLWAVE works with all -bells and whistles, including routine info, completion and fast online -help. Only a small amount of additional information must be specified -in your .emacs file: the path names which, on a UNIX system, are -automatically gathered by talking to the IDL program. +@cindex MacOSX + +IDLWAVE was developed on a UNIX system. However, thanks to the +portability of Emacs, much of IDLWAVE does also work under different +operating systems like Windows (with NTEmacs or NTXEmacs) or MacOS. + +The only real problem is that there is no command-line +version of IDL for Windows or MacOS(<=9) with which IDLWAVE can +interact. As a result, the IDLWAVE Shell +does not work and you have to rely on IDLDE to run and debug your +programs. However, editing IDL source files with Emacs/IDLWAVE works +with all bells and whistles, including routine info, completion and fast +online help. Only a small amount of additional information must be +specified in your @file{.emacs} file: the path names which, on a UNIX +system, are automatically gathered by talking to the IDL program. Here is an example of the additional configuration needed for a Windows system. I am assuming that IDLWAVE has been installed in @@ -3487,11 +3936,11 @@ @w{@samp{C:\RSI\IDL55}}. @lisp -;; location of the lisp files (needed if IDLWAVE is not part of +;; location of the lisp files (needed if IDLWAVE is not part of ;; the X/Emacs installation) (setq load-path (cons "c:/program files/IDLWAVE" load-path)) -;; The location of the IDL library files, both from RSI and your own. +;; The location of the IDL library files, both standard and your own. ;; note that the initial "+" expands the path recursively (setq idlwave-library-path '("+c:/RSI/IDL55/lib/" "+c:/user/me/idllibs" )) @@ -3499,33 +3948,216 @@ ;; location of the IDL system directory (try "print,!DIR") (setq idlwave-system-directory "c:/RSI/IDL55/") -;; location of the IDLWAVE help files idlw-help.el and idlw-help.txt. -(setq idlwave-help-directory "c:/IDLWAVE") +;; specify using the HTMLHelp documentation for online help, with the +;; KEYHH helper routine (Windows only) +(setq idlwave-use-hh 'keyhh) ;; file in which to store the user catalog info -(setq idlwave-libinfo-file "c:/IDLWAVE/idlcat.el") +(setq idlwave-user-catalog-file "c:/IDLWAVE/idlcat.el") @end lisp @noindent Furthermore, Windows sometimes tries to outsmart you --- make sure you check the following things: @itemize @bullet -@item When you download the IDLWAVE distribution, make sure you save the -files under the names @file{idlwave.tar.gz} and -@file{idlwave-help-tar.gz}. -@item Be sure that your software for untarring/ungzipping is @emph{NOT} -doing smart CR/LF conversion (WinZip users will find this in -Options:Configuration:Miscellaneous, change the setting, then re-open -the archive). This adds one byte per line, throwing off the -byte-counts for the help file lookups and defeating fast online help lookup. +@item When you download the IDLWAVE distribution, make sure you save the +file under the names @file{idlwave.tar.gz}. @item M-TAB switches among running programs --- use Esc-TAB instead. @item Other issues as yet unnamed... @end itemize - -@node Index, , Windows and MacOS, Top +Windows users who'd like to make use of IDLWAVE's context-aware HTML +help can skip the browser and use the HTMLHelp functionality directly. +@xref{Help with HTML Documentation}. + +@ifhtml +<A NAME="TROUBLE"></A> +@end ifhtml +@node Troubleshooting, Index, Windows and MacOS, Top +@appendix Troubleshooting +@cindex Troubleshooting + +Although IDLWAVE usually installs and works without difficulty, a few +common problems and their solutions are documented below. + +@enumerate + +@item @strong{Whenever an IDL error occurs or a breakpoint is hit, I get +errors or strange behavior when I try to type anything into some of my +IDLWAVE buffers.} + +This is a @emph{feature}, not an error. You're in @emph{Electric +Debug Mode} (@pxref{Electric Debug Mode}). You should see +@code{*Debugging*} in the mode-line. The buffer is read-only and all +debugging and examination commands are available as single keystrokes; +@kbd{C-?} lists these shortcuts. Use @kbd{q} to quit the mode, and +customize the variable @code{idlwave-shell-automatic-electric-debug} +if you prefer not to enter electric debug on breakpoints@dots{} but +you really should try it before you disable it! You can also +customize this variable to enter debug mode when errors are +encountered too. + +@item @strong{I get errors like @samp{Searching for program: no such +file or directory, idl} when attempting to start the IDL shell.} + +IDLWAVE needs to know where IDL is in order to run it as a process. +By default, it attempts to invoke it simply as @samp{idl}, which +presumes such an executable is on your search path. You need to +ensure @samp{idl} is on your @samp{$PATH}, or specify the full +pathname to the idl program with the variable +@code{idlwave-shell-explicit-file-name}. Note that you may need to +set your shell search path in two places when running Emacs as an Aqua +application with MacOSX; see the next topic. + +@item @strong{IDLWAVE is disregarding my @samp{IDL_PATH} which I set +under MacOSX} + +If you run Emacs directly as an Aqua application, rather than from the +console shell, the environment is set not from your usual shell +configuration files (e.g. @file{.cshrc}), but from the file +@file{~/.MacOSX/environment.plist}. Either include your path settings +there, or start Emacs and IDLWAVE from the shell. + +@item @strong{I get errors like @samp{Symbol's function is void: +overlayp} when trying to start the shell in XEmacs} + +You don't have the @samp{fsf-compat} package installed, which IDLWAVE +needs to run under XEmacs. Install it and, if necessary, insert +@code{(require 'overlay)} in your @file{.emacs}. + +@item @strong{I'm getting errors like @samp{Symbol's value as variable is void: +cl-builtin-gethash} on completion or routine info.} + +This error arises if you upgraded Emacs from 20.x to 21.x without +re-installing IDLWAVE. Old Emacs and new Emacs are not byte-compatible +in compiled lisp files. Presumably, you kept the original .elc files in +place, and this is the source of the error. If you recompile (or just +"make; make install") from source, it should resolve this problem. +Another option is to recompile the @file{idlw*.el} files by hand using +@kbd{M-x byte-compile-file}. + +@item @strong{@kbd{M-@key{TAB}} doesn't complete words, it switches +windows on my desktop.} + +Your system is trapping @kbd{M-@key{TAB}} and using it for its own +nefarious purposes: Emacs never sees the keystrokes. On many Unix +systems, you can reconfigure your window manager to use another key +sequence for switching among windows. Another option is to use the +equivalent sequence @kbd{@key{ESC}-@key{TAB}}. + +@item @strong{When stopping at breakpoints or errors, IDLWAVE does not +seem to highlight the relevant line in the source.} + +IDLWAVE scans for error and halt messages and highlights the stop +location in the correct file. However, if you've changed the system +variable @samp{!ERROR_STATE.MSG_PREFIX}, it is unable to parse these +message correctly. Don't do that. + +@item @strong{IDLWAVE doesn't work correctly when using ENVI.} + +Though IDLWAVE was not written with ENVI in mind, it works just fine +with it, as long as you update the prompt it's looking for (@samp{IDL> +} by default). You can do this with the variable +@code{idlwave-shell-prompt-pattern} (@pxref{Starting the Shell}), e.g., +in your @file{.emacs}: + +@lisp +(setq idlwave-shell-prompt-pattern "^\\(ENVI\\|IDL\\)> ") +@end lisp + +@item @strong{Attempts to set breakpoints fail: no breakpoint is +indicated in the IDLWAVE buffer.} + +IDL changed its breakpoint reporting format starting with IDLv5.5. The +first version of IDLWAVE to support the new format is IDLWAVE v4.10. If +you have an older version and are using IDL >v5.5, you need to upgrade, +and/or make sure your recent version of IDLWAVE is being found on the +Emacs load-path (see the next entry). You can list the version being +used with @kbd{C-h v idlwave-mode-version @key{RET}}. + +@item @strong{I installed a new version of IDLWAVE, but the old +version is still being used} or @strong{IDLWAVE works, but when I +tried to install the optional modules @file{idlw-roprompt.el} or +@file{idlw-complete-structtag}, I get errors like @samp{Cannot open +load file}}. + +The problem is that your Emacs is not finding the version of IDLWAVE you +installed. Many Emacsen come with an older bundled copy of IDLWAVE +(e.g. v4.7 for Emacs 21.x), which is likely what's being used instead. +You need to make sure your Emacs @emph{load-path} contains the directory +where IDLWAVE is installed (@file{/usr/local/share/emacs/site-lisp}, by +default), @emph{before} Emacs' default search directories. You can +accomplish this by putting the following in your @file{.emacs}: + +@lisp +(setq load-path (cons "/usr/local/share/emacs/site-lisp" load-path)) +@end lisp + +@noindent You can check on your load-path value using @kbd{C-h v +load-path @key{RET}}. + +@item @strong{IDLWAVE is screwing up the formatting of my @file{.idl} files.} + +Actually, this isn't IDLWAVE at all, but @samp{idl-mode}, an unrelated +programming mode for CORBA's Interface Definition Language (you should +see @samp{(IDL)}, not @samp{(IDLWAVE)} in the mode-line). One +solution: don't name your file @file{.idl}, but rather @file{.pro}. +Another solution: make sure @file{.idl} files load IDLWAVE instead of +@samp{idl-mode} by adding the following to your @file{.emacs}: + +@lisp +(setcdr (rassoc 'idl-mode auto-mode-alist) 'idlwave-mode) +@end lisp + +@item @strong{The routine info for my local routines is out of date!} + +IDLWAVE collects routine info from various locations (@pxref{Routine +Information Sources}). Routines in files visited in a buffer or +compiled in the shell should be up to date. For other routines, the +information is only as current as the most recent scan. If you have a +rapidly changing set of routines, and you'd like the latest routine +information to be available for it, one powerful technique makes use of +the library catalog tool, @samp{idlwave_catalog}. Simply add a line to +your @samp{cron} file (@samp{crontab -e} will let you edit this on some +systems), like this: + +@example +45 3 * * 1-5 (cd /path/to/myidllib; /path/to/idlwave_catalog MyLib) +@end example + +@noindent where @samp{MyLib} is the name of your library. This will +rescan all @file{.pro} files at or below @file{/path/to/myidllib} every +week night at 3:45am. You can even scan site-wide libraries with this +method, and the most recent information will be available to all users. + +@item @strong{All the Greek-font characters in the HTML help are +displayed as Latin characters!} + +Unfortunately, the HTMLHelp files attempt to switch to +@samp{Symbol} font to display Greek characters, which is not really an +permitted method for doing this in HTML. There is a "workaround" for +many browsers: @xref{HTML Help Browser Tips}. + +@item @strong{In the shell, my long commands are truncated at 256 characters!} + +This actually happens when running IDL in an XTerm as well. There are +a couple of work arounds: @code{define_key,/control,'^d'} (e.g. in +your @file{$IDL_STARTUP} file) will disable the @samp{EOF} character +and give you a 512 character limit. You won't be able to use +@key{C-d} to quit the shell, however. Another possibility is +@code{!EDIT_INPUT=0}, which gives you an @emph{infinite} limit (OK, a +memory-bounded limit), but disables the processing of background +widget events (those with @code{/NO_BLOCK} passed to @code{XManager}). + +@end enumerate + +@node Index, , Troubleshooting, Top @unnumbered Index @printindex cp @bye + +@ignore + arch-tag: f1d73958-1423-4127-b8aa-f7b953d64492 +@end ignore