changeset 46527:a687c07c44a6

Updated to IDLWAVE version 4.14.
author J.D. Smith <jdsmith@as.arizona.edu>
date Thu, 18 Jul 2002 18:51:26 +0000
parents cca2aba11d94
children 0fc136f66777
files man/idlwave.texi
diffstat 1 files changed, 1446 insertions(+), 707 deletions(-) [+]
line wrap: on
line diff
--- a/man/idlwave.texi	Thu Jul 18 18:19:18 2002 +0000
+++ b/man/idlwave.texi	Thu Jul 18 18:51:26 2002 +0000
@@ -1,86 +1,94 @@
 \input texinfo  @c -*-texinfo-*-
 @c %**start of header
-@setfilename ../info/idlwave
+@setfilename idlwave
 @settitle IDLWAVE User Manual
-@dircategory Emacs
+@dircategory Editors
 @direntry
-* IDLWAVE: (idlwave).	Major mode and shell for IDL and WAVE/CL files.
+* IDLWAVE: (idlwave).	Major mode and shell for IDL files.
 @end direntry
 @synindex ky cp
 @syncodeindex vr cp
 @syncodeindex fn cp
-@set VERSION 4.7
-@set EDITION 4.7
-@set IDLVERSION 5.4
-@set NSYSROUTINES 1287
-@set NSYSKEYWORDS 5724
-@set DATE December 2000
-@set AUTHOR Carsten Dominik
+@set VERSION 4.14
+@set EDITION 4.14
+@set IDLVERSION 5.5
+@set NSYSROUTINES 1322
+@set NSYSKEYWORDS 5952
+@set DATE June 2002
+@set AUTHOR J.D. Smith & Carsten Dominik
 @set AUTHOR-EMAIL dominik@@astro.uva.nl
-@set MAINTAINER John-David Smith
-@set MAINTAINER-EMAIL jdsmith@@astro.cornell.edu
-@set IDLWAVE-HOMEPAGE http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave
+@set MAINTAINER J.D. Smith
+@set MAINTAINER-EMAIL jdsmith@@as.arizona.edu
+@set IDLWAVE-HOMEPAGE http://idlwave.org/
 @c %**end of header
 @finalout
 
 @ifinfo 
-This file documents IDLWAVE, a major mode for editing IDL and
-WAVE/CL files with Emacs.  It also implements a shell for running IDL as
-a subprocess.
-
-This is edition @value{EDITION} of the IDLWAVE User Manual for
-IDLWAVE @value{VERSION}
-
-Copyright (c) 1999, 2000, 2001 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
-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.
+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.
+
+Permission is granted to make and distribute verbatim
+copies of this manual provided the copyright notice and
+this permission notice are preserved on all copies.
+     
+@ignore
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries a copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+     
+@end ignore
+Permission is granted to copy and distribute modified
+versions of this manual under the conditions for
+verbatim copying, provided that the entire resulting
+derived work is distributed under the terms of a permission
+notice identical to this one.
+     
+Permission is granted to copy and distribute
+translations of this manual into another language,
+under the above conditions for modified versions,
+except that this permission notice may be stated in a
+translation approved by the Free Software Foundation.
 @end ifinfo
 
 @titlepage
 @title IDLWAVE User Manual
-@subtitle Major Emacs mode and shell for IDL and WAVE/CL files
+@subtitle Emacs major mode and shell for IDL
 @subtitle Edition @value{EDITION}, @value{DATE}
 
-@author by Carsten Dominik
+@author by Carsten Dominik & J.D. Smith
 @page
+Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+@sp 2
 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 Free Software Foundation, Inc.
-@sp 2
+
 @cindex Copyright, of IDLWAVE
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 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.
+Permission is granted to make and distribute verbatim
+copies of this manual provided the copyright notice and
+this permission notice are preserved on all copies.
+     
+Permission is granted to copy and distribute modified
+versions of this manual under the conditions for
+verbatim copying, provided that the entire resulting
+derive work is distributed under the terms of a permission
+notice identical to this one.
+     
+Permission is granted to copy and distribute
+translations of this manual into another language,
+under the above conditions for modified versions,
+except that this permission notice may be stated in a
+translation approved by the Free Software Foundation.
+
 @end titlepage
 @contents
 
@@ -90,25 +98,33 @@
 
 @node Top, Introduction, (dir), (dir)
 
-IDLWAVE is a package to support editing command files for the
-Interactive Data Language (IDL), and for running IDL as an inferior
+IDLWAVE is a package which supports editing source for the
+Interactive Data Language (IDL), and running IDL as an inferior
 shell.
 
 @end ifnottex
 
 @menu
-* Introduction::                What IDLWAVE is and what not
+* Introduction::                What IDLWAVE is and what it's 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 inferior program
+* The IDLWAVE Shell::           The mode to run IDL as an inferior program
 * Installation::                How to Install or Upgrade               
-* Acknowledgement::             Who helped   
+* Acknowledgements::            Who did what
 * Sources of Routine Info::     How does IDLWAVE know about routine XYZ     
 * Configuration Examples::      The user is king...
+* Windows and MacOS::           What still works, and how
 * Index::                       Fast access
 
-@detailmenu --- The Detailed Node Listing ---
+@detailmenu
+ --- The Detailed Node Listing ---
+
+Getting Started (Tutorial)
+
+* Lesson I -- Development Cycle::  
+* Lesson II -- Customization::  
+* Lesson III -- Library Catalog::  
 
 The IDLWAVE Major Mode
 
@@ -116,9 +132,10 @@
 * Routine Info::                Calling Sequence and Keyword List
 * Online Help::                 One key press from source to help
 * Completion::                  Completing routine names and Keywords
-* Routine Source::              How to visit the source file of routine XYZ
+* Routine Source::              Finding routines, the easy way
 * Resolving Routines::          Force the Shell to compile a routine
-* Code Templates::              Abbreviations for frequent constructs
+* Code Templates::              Frequent code constructs
+* Abbreviations::               Abbreviations for common commands
 * Actions::                     Changing case, Padding, End checking
 * Doc Header::                  Inserting a standard header
 * Motion Commands::             Moving through the structure of a program
@@ -127,9 +144,18 @@
 Code Formatting
 
 * Code Indentation::            Reflecting the logical structure
+* 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
+
+Completion
+
+* Case of Completed Words::     CaseOFcomPletedWords
+* Object Method Completion and Class Ambiguity::  obj->Method, what?
+* Class and Keyword Inheritance::  obj->Method, _EXTRA=e
+* Structure Tag Completion::    Completing state.Tag
 
 Actions
 
@@ -142,12 +168,14 @@
 * Starting the Shell::          How to launch IDL as a subprocess
 * Using the Shell::             Interactively working with the Shell
 * Debugging IDL Programs::      Compilation/Debugging
+* Examining Variables::         
+* Custom Expression Examination::  
 
 Debugging IDL Programs
 
 * Compiling Programs::          Compiling buffers under the shell
 * Breakpoints and Stepping::    Deciding where to stop and look
-* Examining Variables::         What is the value now?
+* Walking the Calling Stack::   From where was this routine called?
 
 Installation
 
@@ -177,89 +205,99 @@
 @cindex @file{idl-shell.el}
 @cindex Feature overview
 
-IDLWAVE is a package to support editing command files for the
-Interactive Data Language (IDL), and for running IDL as an inferior
-shell.  It also can be used for WAVE/CL command files, but the support
-for these is limited.  Note that this package has nothing to do with the
-Interface Definition Language as part of the Common Object Request
-Broker Architecture (CORBA).
-
-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 CORBAs @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 consists of two parts: A major mode for editing command files
-(@code{idlwave-mode}) and a mode to allow running the IDL program as an
-inferior shell (@code{idlwave-shell-mode}).  Both modes work closely
-together and form a complete development environment.
-
-Here is a brief summary of what IDLWAVE does.
+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. Note that this package has nothing to do with the Interface
+Definition Language, part of the Common Object Request Broker
+Architecture (CORBA).
+
+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:
 
 @itemize @bullet
 @item 
 Code indentation and formatting.
 @item
-Font-lock support on three levels. 
+Three level syntax highlighting support.
 @item 
-Display of calling sequence and keywords of more than 1000 IDL
-routines and any routines in your local IDL library.
+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.
 @item
-Name space conflict search.
+Name space conflict search, with likelihood ranking.
 @item
-Fast context-sensitive online help.
+Fast, context-sensitive online help.
 @item
 Context sensitive completion of routine names and keywords.
 @item
-Insertion of code templates.
+Easy insertion of code templates.
 @item
-Actions to enforce coding standards during typing.
+Automatic corrections to enforce a variety of customizable coding
+standards.
 @item
-Block structure check.
+Integrity checks and auto-termination of logical blocks.
 @item
 Support for @file{imenu} (Emacs) and @file{func-menu} (XEmacs).
 @item
 Documentation support.
 @item
-Running IDL as inferior process.
+Running IDL as an inferior Shell with history search, command line
+editing and all the completion and routine info capabilities present in
+IDL source buffers.
 @item
-Shell with history search, command line editing and completion.
+Compilation, execution and interactive debugging of programs directly
+from the source buffer.
 @item
-Compilation, execution and debugging of programs directly from the source
-buffer.  
+Quick, source-guided navigation of the calling stack, with variable
+inspection, etc.
 @item
-Examining expressions with a mouse click.
+Examining variables and expressions with a mouse click.
+@item
+And much, much more...
 @end itemize
 
 @ifnottex
 @cindex Screenshots
-Here are a number of screenshots showing IDLWAVE in action.
+Here are a number of screenshots showing IDLWAVE in action:
 
 @itemize @bullet
 @item
-@uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/font-lock.gif,
-XEmacs 21.1 with formatted and fontified code} 
+@uref{http://idlwave.org/screenshots/emacs_21_nav.gif,An IDLWAVE buffer}
 @item
-@uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/rinfo.gif,
-XEmacs 21.1 displaying routine info}
+@uref{http://idlwave.org/screenshots/emacs_21_keys.gif,A keyword being completed}
 @item
-@uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/complete.gif, 
-XEmacs 21.1 completing a keyword}
+@uref{http://idlwave.org/screenshots/emacs_21_help.gif,Online help text.}
 @item
-@uref{http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave/shell.gif,
-XEmacs 21.1 with debugging toolbar; execution stopped at a breakpoint} 
+@uref{http://idlwave.org/screenshots/emacs_21_ri.gif,Routine information displayed}
+@item
+@uref{http://idlwave.org/screenshots/emacs_21_bp.gif,Debugging code
+stopped at a breakpoint}
 @end itemize
 @end ifnottex
 
-In this manual, each section contains a list of user options related to
-the subject.  Don't be confused by the shear number of options available 
--- in most cases the default settings are just fine.  The variables are
-listed here to make sure you know where to look if you want to change
-things.  For a full description of what a particular variable does and
-how to configure it, see the documentation string of that variable.
-Some configuration examples are also given in the appendix.
+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.
+
+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
+cases the default settings are just fine.  The variables are listed here
+to make sure you know where to look if you want to change anything.  For
+a full description of what a particular variable does and how to
+configure it, see the documentation string of that variable (available
+with @kbd{C-h v}).  Some configuration examples are also given in the
+appendix.
 
 @node IDLWAVE in a Nutshell, Getting Started, Introduction, Top
 @chapter IDLWAVE in a Nutshell
@@ -274,24 +312,26 @@
 @tab Indent the current line relative to context.
 @item @kbd{C-M-\}
 @tab Re-indent all lines in the current region.
+@item @kbd{C-u @key{TAB}}
+@tab Re-indent all lines in the current statement.
 @item @kbd{M-@key{RET}}
-@tab Start a continuation line.  Or split the current line at point.
+@tab Start a continuation line, or split the current line at point.
 @item @kbd{M-q}
 @tab Fill the current comment paragraph.
 @item @kbd{C-c ?}
-@tab Display calling sequence, keywords of the procedure/function call
+@tab Display calling sequence and keywords for the procedure or function call
 at point.
 @item @kbd{M-?}
-@tab Context sensitive online help.
+@tab Load context sensitive online help for nearby routine, keyword, etc.
 @item @kbd{M-@key{TAB}}
 @tab Complete a procedure name, function name or keyword in the buffer.
 @item @kbd{C-c C-i}
 @tab Update IDLWAVE's knowledge about functions and procedures.
 @item @kbd{C-c C-v}
-@tab Find the source code of a procedure/function.
+@tab Visit the source code of a procedure/function.
 @item @kbd{C-c C-h}
 @tab Insert a standard documentation header.
-@item @kbd{C-c C-m}
+@item @kbd{C-c @key{RET}}
 @tab Insert a new timestamp and history item in the documentation header.
 @end multitable
 
@@ -301,7 +341,7 @@
 @item @kbd{C-c C-s}
 @tab Start IDL as a subprocess and/or switch to the interaction buffer.
 @item @kbd{M-p}
-@tab Cycle back through IDL command history matching command line input.
+@tab Cycle back through IDL command history.
 @item @kbd{M-n}
 @tab Cycle forward.
 @item @kbd{M-@key{TAB}}
@@ -311,19 +351,21 @@
 @item @kbd{C-c C-d C-x}
 @tab Goto next syntax error.
 @item @kbd{C-c C-d C-b}
-@tab Set a breakpoint at the current source line.
+@tab Set a breakpoint at the nearest viable source line.
 @item @kbd{C-c C-d C-d}
-@tab Clear the current breakpoint.
+@tab Clear the nearest breakpoint.
 @item @kbd{C-c C-d C-p}
-@tab Ask IDL to print the value of the expression near point.
+@tab Print the value of the expression near point in IDL.
 @end multitable
 
 @subheading Commonly used Settings in @file{.emacs}
 @lisp
 ;; Change the indentation preferences
-(setq idlwave-main-block-indent 2         ; default  0
-      idlwave-block-indent 2              ; default  4
-      idlwave-end-offset -2)              ; default -4
+(setq idlwave-main-block-indent 2   ; default  0
+      idlwave-block-indent 2        ; default  4
+      idlwave-end-offset -2)        ; default -4
+;; Start autoloading routine info after 2 idle seconds
+(setq idlwave-init-rinfo-when-idle-after 2)
 ;; Pad some operators with spaces
 (setq idlwave-do-actions t
       idlwave-surround-by-blank t)
@@ -333,7 +375,7 @@
 (setq idlwave-shell-automatic-start t)
 ;; Bind debugging commands with CONTROL and SHIFT modifiers
 (setq idlwave-shell-debug-modifiers '(control shift))
-;; Where are the online help files?
+;; Specify the online help files' location.
 (setq idlwave-help-directory "~/.idlwave")
 @end lisp
 
@@ -343,35 +385,40 @@
 @cindex Tutorial
 @cindex Getting Started
 
-@section Lession I: Development Cycle
+@menu
+* Lesson I -- Development Cycle::  
+* Lesson II -- Customization::  
+* Lesson III -- Library 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 with IDLWAVE.  We will type a simple program into a
-buffer and use the shell to compile, debug and run this program.  On the
-way we will use the most important commands in IDLWAVE.  Note
-however that there is much more funtionality available in IDLWAVE than
-we cover here, and it will pay off greatly if eventually you go further
-and read the whole manual.
-
-I assume that you have access to Emacs or XEmacs with the full IDLWAVE
-package including online help (@pxref{Installation}).  I 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
+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.
+
+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)).
 
-Open a new source file by typing
+Open a new source file by typing:
 
 @example
 @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.
-You can see this by looking at the mode line, just below the editing
-window.  Also, the menu bar should contain entries @samp{IDLWAVE} and
-@samp{Debug}.
-
-Now cut-and-paste the following program, also available as
+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}.
+
+Now cut-and-paste the following code, also available as
 @file{tutorial.pro} in the IDLWAVE distribution.
 
 @example
@@ -396,76 +443,75 @@
   years = 2000,+indgen(10)
   wdays = intarr(10)
   for i=0,n_elements(wdays)-1 do begin
-     wdays[i] =  weekday(day,month,years[i])
+      wdays[i] =  weekday(day,month,years[i])
   end
-  plot,years,wdays,YS=2,YT="Wday (0=sunday)"
+  plot,years,wdays,YS=2,YT="Wday (0=Sunday)"
 end
 @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} followed by @kbd{C-M-\}).  Notice how different syntactical
-elements are highlighted in different colors, if you have set up support
-for font-lock.
+@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
-into two 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.  I have put in a few
-bugs which we are going to fix now.
+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.
 
 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 like in an xterminal, or the
-IDLDE.  Use the arrow keys to cycle through your command history.  Are
-we having fun now?
+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
 @samp{.run tutorial.pro} for you.  But the compilation fails because
 there is a comma in the line @samp{years=...}.  The line with the error
 is highlighted and the cursor positioned at the error, so remove the
-comma (you should only need to hit Delete!).  Compile again, using the
-same keystrokes as before.  Notice that the file is saved for you.  This
-time everything should work fine, and you should see the three routines
-compile.
-
-Now we want to use the command to plot the weekdays for 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), 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 was
-enough to tell 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}, and the full routine name will be completed.
-Now provide the two arguments:
+comma (you should only need to hit @kbd{Delete}!).  Compile again, using
+the same keystrokes as before.  Notice that the file is automatically
+saved for you.  This time everything should work fine, and you should
+see the three routines compile.
+
+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
+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:
 
 @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 pops up the routine info window for
-the plot routine, which contains a list of keywords, and the argument
+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
+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
@@ -475,33 +521,32 @@
 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
+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.
 
-Lets try a different day - how about April fool's day?
+Let's try a different day --- how about April fool's day?
 
 @example
 plot_wday,1,4
 @end example
 
-   Oops, this looks very wrong.  All April fool's days cannot be
-Fridays!  We've got a bug in the program, perhaps in the @code{daynr}
-function.  Lets 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
+Oops, this looks very wrong.  All April fool's days cannot be Fridays!
+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:
 
 @example
 y1 = y - delta
@@ -512,19 +557,19 @@
 Change the code to plot 100 years and see that every 28 years, the
 sequence of weekdays repeats.
 
-@section Lession II: Customization
+@node  Lesson II -- Customization, Lesson III -- Library 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 means that you have
-to set Lisp variables in the @file{.emacs} file in your home directory.
-This looks scary to many people because of all the parenthesis.
-However, you can just cut and paste the examples given here and work
-from there.
-
-Lets 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 of @samp{nil} means off.  Copy the following line into your
+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
+of @samp{nil} means off.  Copy the following line into your
 @file{.emacs} file, exit and restart Emacs.
 
 @lisp
@@ -537,11 +582,11 @@
 @samp{IF}, @samp{begin} to @samp{BEGIN}.  If you don't like this
 behavior, remove the option again from your @file{.emacs} file.
 
-Now I bet you have your own indentation preferences for IDL code.  For
-example, I like to indent the main block of an IDL program a bit,
-different from the conventions used by RSI.  Also, I'd like to use only
-3 spaces as indentation between @code{BEGIN} and @code{END}.  Try the
-following lines in @file{.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}:
 
 @lisp
 (setq idlwave-main-block-indent 2)
@@ -549,55 +594,58 @@
 (setq idlwave-end-offset -3)
 @end lisp
 
-Restart Emacs, take the program we developed in the first part of this
-tutorial and re-indent it with @kbd{C-c h} and @kbd{C-M-\}.  You
-probably want to keep these lines in @file{.emacs}, with values adjusted
-to your likings.  If you want to get more information about any of these
-variables, type, e.g., @kbd{C-h v idlwave-main-block-indent @key{RET}}.
-To find which variables can be customized, look for items marked
-@samp{User Option:} in the manual.
-
-If you cannot wrap your head around this Lisp stuff, there is another,
-more user-friendly way to customize all the IDLWAVE variables.  You can
-access it through the IDLWAVE menu in one of the @file{.pro} buffers,
-option @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.
-
-Many people I talk to find the key bindings used for the debugging
-commands too long and complicated.  Do I always have to type @kbd{C-c
-C-d C-c} to get a single simple command?  Due to Emacs rules and
-conventions I cannot make better bindings by default, but you can.
-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.  A
-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
-have this with
+Restart Emacs, and re-indent the program we developed in the first part
+of this tutorial with @kbd{C-c h} and @kbd{C-M-\}.  You may want to keep
+these lines in @file{.emacs}, with values adjusted to your likings.  If
+you want to get more information about any of these variables, type,
+e.g., @kbd{C-h v idlwave-main-block-indent @key{RET}}.  To find which
+variables can be customized, look for items marked @samp{User Option:}
+throughout this manual.
+
+If you cannot seem to master this Lisp customization in @file{.emacs},
+there is another, more user-friendly way to customize all the IDLWAVE
+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.
+
+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:
 
 @lisp
 (setq idlwave-shell-debug-modifiers '(shift control))
 @end lisp
 
-If you have a special keyboard with for example a @key{HYPER} key, you
-could use
+@noindent If you have a special keyboard with, for example, a
+@key{HYPER} key, you could even shorten that:
 
 @lisp
 (setq idlwave-shell-debug-modifiers '(hyper))
 @end lisp
 
-instead to get compilation on @kbd{H-c}.
-
-You can also assign specific commands to function 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.
+@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.
+
+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.
 
 @lisp
 ;; First for the source buffer
@@ -616,7 +664,8 @@
     (local-set-key [f8] 'idlwave-shell-clear-all-bp)))
 @end lisp
 
-@section Lession III: Library Catalog
+@node  Lesson III -- Library Catalog,  , Lesson II -- Customization, Getting Started
+@section Lesson III: Library Catalog
 
 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 
@@ -635,10 +684,11 @@
 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
-IDLWAVE.  Try to use routine info (@kbd{C-c ?}) or completion
-(@kbd{M-<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:
+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:
 
 @example
     a=readf@key{M-<TAB>}
@@ -663,25 +713,26 @@
 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 @code{comp.lang.idl-pvwave}.
+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
 @cindex IDLWAVE major mode
 @cindex Major mode, @code{idlwave-mode}
 
-The IDLWAVE major mode supports editing IDL and WAVE/CL command files.
-In this chapter we describe the main features of the mode and how to
-customize them.
+The IDLWAVE major mode supports editing IDL source files.  In this
+chapter we describe the main features of the mode and how to customize
+them.
 
 @menu
 * Code Formatting::             Making code look nice
 * Routine Info::                Calling Sequence and Keyword List
 * Online Help::                 One key press from source to help
 * Completion::                  Completing routine names and Keywords
-* Routine Source::              How to visit the source file of routine XYZ
+* Routine Source::              Finding routines, the easy way
 * Resolving Routines::          Force the Shell to compile a routine
-* Code Templates::              Abbreviations for frequent constructs
+* Code Templates::              Frequent code constructs
+* Abbreviations::               Abbreviations for common commands
 * Actions::                     Changing case, Padding, End checking
 * Doc Header::                  Inserting a standard header
 * Motion Commands::             Moving through the structure of a program
@@ -695,20 +746,25 @@
 
 @menu
 * Code Indentation::            Reflecting the logical structure
+* 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
 
-@node Code Indentation, Comment Indentation, Code Formatting, Code Formatting
-@subsection Code Indentation
-@cindex Code indentation
-@cindex Indentation
-
-Like all Emacs programming modes, IDLWAVE performs code indentation.
-The @key{TAB} key indents the current line relative to context.
-@key{LFD} insert a newline and indents the new line.  The indentation is 
-governed by a number of variables.
+The IDL language, with it's 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 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
@@ -720,13 +776,25 @@
 current subprogram). @xref{Actions}, for information how to impose
 additional formatting conventions on foreign code.
 
+@node Code Indentation, Continued Statement Indentation, Code Formatting, Code Formatting
+@subsection Code Indentation
+@cindex Code indentation
+@cindex Indentation
+
+Like all Emacs programming modes, IDLWAVE performs code indentation.
+The @key{TAB} key indents the current line relative to context.
+@key{LFD} insert a newline and indents the new line.  The indentation is
+governed by a number of variables.  IDLWAVE indents blocks (between
+@code{PRO}/@code{FUNCTION}/@code{BEGIN} and @code{END}), and
+continuation lines.
+
 @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.
 @end defopt
 
-@defopt idlwave-block-indent (@code{5})
+@defopt idlwave-block-indent (@code{4})
 Extra indentation applied to block lines.  If you change this, you
 probably also want to change @code{idlwave-end-offset}.
 @end defopt
@@ -737,12 +805,76 @@
 BEGIN lines.
 @end defopt
 
+@node Continued Statement Indentation, Comment Indentation, Code Indentation, Code Formatting
+@subsection Continued Statement Indentation
+@cindex Indentation, continued statement
+@cindex Continued statement indentation
+Continuation lines (following a line ending with @code{$}) can receive a
+fixed indentation offset from the main level, but in several situations
+IDLWAVE can use a special form of indentation which aligns continued
+statements more naturally.  Special indentation is calculated for
+continued routine definition statements and calls, enclosing parentheses
+(like function calls, structure/class definitions, explicit structures
+or lists, etc.), and continued assignments.  An attempt is made to line
+up with the first non-whitespace character after the relevant opening
+punctuation mark (@code{,},@code{(},@code{@{},@code{[},@code{=}).  For
+lines without any non-comment characters on the line with the opening
+punctuation, the continued line(s) are aligned just past the
+punctuation.  An example:
+
+@example
+function foo, a, b,  $
+              c, d
+  bar =  sin( a + b + $
+              c + d)
+end
+@end example
+@noindent
+
+The only drawback to this special continued statement indentation is
+that it consumes more space, e.g., for long function names or left hand
+sides of an assignment:
+
+@example
+function thisfunctionnameisverylongsoitwillleavelittleroom, a, b, $
+                                                            c, d
+@end example
+
+You can instruct IDLWAVE when to use this special continuation
+indentation by setting the variable
+@code{idlwave-max-extra-continuation-indent}, which specifies the
+maximum additional indentation beyond the basic indent to be tolerated,
+otherwise defaulting to fixed-offset from the enclosing indent (the size
+of which offset is set in @code{idlwave-continuation-indent}).  Also,
+since the indentation level is 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 the
+@code{idlwave-max-extra-continuation-indent} limit, for parentheses
+only, forcing them always to line up.
+
+
 @defopt idlwave-continuation-indent (@code{2})
-Extra indentation applied to continuation lines and inside unbalanced
-parenthesis.
+Extra indentation applied to normal continuation lines.
 @end defopt
 
-@node Comment Indentation, Continuation Lines, Code Indentation, Code Formatting
+@defopt idlwave-max-extra-continuation-indent (@code{20})
+The maximum additional indentation (over the basic continuation-indent)
+that will be permitted for special continues.  To effectively disable
+special continuation indentation, set to @code{0}.  To enable it
+constantly, set to a large number (like @code{100}).  Note that the
+indentation in a long continued statement never decreases from line to
+line, outside of nested parentheses statements.
+@end defopt
+
+@defopt idlwave-indent-to-open-paren (@code{t})
+Non-@code{nil} means indent continuation lines to innermost open
+parenthesis, regardless of whether the
+@code{idlwave-max-extra-continuation-indent} limit is satisfied.
+@end defopt
+
+@node Comment Indentation, Continuation Lines, Continued Statement Indentation, Code Formatting
 @subsection Comment Indentation
 @cindex Comment indentation
 @cindex Hanging paragraphs
@@ -766,7 +898,8 @@
 The indentation of comments starting in column 0 is never changed.
 
 @defopt idlwave-no-change-comment
-The indentation of a comment starting with this regexp will not be changed.
+The indentation of a comment starting with this regexp will not be
+changed.
 @end defopt
 
 @defopt idlwave-begin-line-comment
@@ -788,37 +921,41 @@
 @kindex M-@key{RET}
 In IDL, a newline character terminates a statement unless preceded by a
 @samp{$}.  If you would like to start a continuation line, use
-@kbd{M-@key{RET}} which calls the command @code{idlwave-split-line}.  It
-inserts a @samp{$} to indicate that the following line is a continuation
-of the current line, terminates the line with a newline and indents the
-new line.  The command @kbd{M-@key{RET}} can also be used in the middle
-of a line to split the line at that point.  When used inside a long
-string constant, the string is split with the @samp{+} concatenation
-operator.
+@kbd{M-@key{RET}}, which calls the command @code{idlwave-split-line}.
+It inserts the continuation character @samp{$}, terminates the line and
+indents the new line.  The command @kbd{M-@key{RET}} can also be invoked
+inside a string to split it at that point, in which case the @samp{+}
+concatenation operator is used.
 
 @cindex Filling
 @cindex @code{auto-fill-mode}
 @cindex Hanging paragraphs
 When filling comment paragraphs, IDLWAVE overloads the normal filling
-functions and uses a function which creates hanging paragraphs as they
-are customary in the IDL routine headers.  When @code{auto-fill-mode} is
-turned on (toggle with @kbd{C-c C-a}), comments will be auto-filled.  If
-the first line of a paragraph is matched by
-@code{idlwave-hang-indent-regexp}, subsequent lines are indented to
-after the position of this match, as in the following example.
+functions and uses a function which creates the hanging paragraphs
+customary in IDL routine headers.  When @code{auto-fill-mode} is turned
+on (toggle with @kbd{C-c C-a}), comments will be auto-filled.  If the
+first line of a paragraph contains a match for
+@code{idlwave-hang-indent-regexp} (a dash-space by default), subsequent
+lines are positioned to line up after it, as in the following example.
 
 @example
-; INPUTS:
+@group
+;=================================
 ; x - an array containing
 ;     lots of interesting numbers.
 ;
 ; y - another variable where
 ;     a hanging paragraph is used
 ;     to describe it.
+;=================================
+@end group
 @end example
 
 @kindex M-q
-You also refill a comment paragraph with @kbd{M-q}.
+You can also refill a comment at any time paragraph with @kbd{M-q}.
+Comment delimiting lines as in the above example, consisting of one or
+more @samp{;} followed by one or more of the characters @samp{+=-_*},
+are kept in place, as is.
 
 @defopt idlwave-fill-comment-line-only (@code{t})
 Non-@code{nil} means auto fill will only operate on comment lines.
@@ -840,7 +977,7 @@
 line of the paragraph.
 @end defopt
 
-@defopt idlwave-hang-indent-regexp
+@defopt idlwave-hang-indent-regexp (@code{"- "})
 Regular expression matching the position of the hanging indent
 in the first line of a comment paragraph.
 @end defopt
@@ -850,7 +987,7 @@
 @code{idlwave-indent-regexp}. 
 @end defopt
 
-@node Syntax Highlighting,  , Continuation Lines, Code Formatting
+@node Syntax Highlighting, Octals and Highlighting, Continuation Lines, Code Formatting
 @subsection Syntax Highlighting
 @cindex Syntax highlighting
 @cindex Highlighting of syntax
@@ -858,22 +995,56 @@
 
 Highlighting of keywords, comments, strings etc. can be accomplished
 with @code{font-lock}.  If you are using @code{global-font-lock-mode}
-(on Emacs), or have @code{font-lock} turned on in any other buffer in
-XEmacs, it should also automatically work in IDLWAVE buffers.  If not,
-you can enforce it with the following line in your @file{.emacs}
+(in Emacs), or have @code{font-lock} turned on in any other buffer in
+XEmacs, it should also automatically work in IDLWAVE buffers.  If you'd
+prefer invoking font-lock individually by mode, you can enforce it in
+@code{idlwave-mode} with the following line in your @file{.emacs}:
 
 @lisp
 (add-hook 'idlwave-mode-hook 'turn-on-font-lock)
 @end lisp
 
-IDLWAVE supports 3 levels of syntax highlighting.  The variable 
-@code{font-lock-maximum-decoration} determines which level is selected.
+@noindent IDLWAVE supports 3 increasing levels of syntax highlighting.
+The variable @code{font-lock-maximum-decoration} determines which level
+is selected.  Individual categories of special tokens can be selected
+for highlighting using the variable
+@code{idlwave-default-font-lock-items}.
 
 @defopt idlwave-default-font-lock-items
 Items which should be fontified on the default fontification level
 2. 
 @end defopt
 
+@node Octals and Highlighting,  , Syntax Highlighting, Code Formatting
+@subsection Octals and Highlighting
+@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.
+
+One solution to this involves terminating the mistakenly identified
+string yourself by providing a closing quotation mark in a comment:
+
+@example
+  string("305B) + $ ;" <--- for font-lock
+   ' is an Angstrom.'
+@end example
+
+@noindent A far better solution is to abandon this notation for octals
+altogether, and use the more sensible alternative IDL provides:
+
+@example
+   string('305'OB) + ' is an Angstrom.'
+@end example
+
+@noindent This simultaneously solves the font-lock problem and is more
+consistent with the notation for hexadecimal numbers, e.g. @code{'C5'XB}.
+
 @node Routine Info, Online Help, Code Formatting, The IDLWAVE Major Mode
 @section Routine Info
 @cindex Routine info
@@ -883,38 +1054,47 @@
 @cindex Shell, querying for routine info
 
 @kindex C-c C-i
-IDL defines more than one thousand procedures, functions and object
-methods.  This large command set makes it difficult to remember the
-calling sequence and keywords of a command.  IDLWAVE contains a list of
-all builtin routines with calling sequences and keywords@footnote{This
-list was created by scanning the IDL manual and might contain (very few)
-errors.  Please report any detected 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 the properties of
-modules currently compiled under the shell.  This information is updated
-automatically.  If you think the information is not up-to-date, use
-@kbd{C-c C-i} (@code{idlwave-update-routine-info}) to enforce a global
-update.
+IDL comes bundled with more than one thousand procedures, functions and
+object methods, and large libraries typically contain hundreds or even
+thousands more.  This large command set makes it difficult to remember
+the calling sequence and keywords for 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 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}).
 
 @kindex C-c ?
-To display the information about a routine, press @kbd{C-c ?} which
+To display the information about a routine, press @kbd{C-c ?}, which
 calls the command @code{idlwave-routine-info}.  When the current cursor
 position is on the name or in the argument list of a procedure or
 function, information will be displayed about the routine.  For example,
-consider the cursor positions in the following line
+consider the indicated cursor positions in the following line:
 
 @example
 plot,x,alog(x+5*sin(x) + 2),
+  |  |   |   |   |  |  |    |
   1  2   3   4   5  6  7    8
 @end example
 
 @cindex Default routine, for info and help
 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 select the @samp{sin} function.
+described, while positions 5 and 6 will investigate the @samp{sin}
+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.
+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 explicity included in the call
+(e.g. @code{a->myclass::Foo}).
 
 @cindex Calling sequences
 @cindex Keywords of a routine
@@ -941,54 +1121,58 @@
 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 the keywords is derived from
-the first source listed.  Library routines can only be supported if you
-have scanned the local IDL library (@pxref{Library Catalog}).  The source
+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:
+the path to the @emph{source file}.  The following categories exist:
 
 @multitable @columnfractions .15 .85
 @item @i{System}
-@tab A system routine, but we do not know if it is @i{Builtin} or
-@i{SystemLib}.  When the system library has bee scanned
-(@pxref{Library Catalog}), this category will automatically split into the
-next two. 
+@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.
 @item @i{Builtin}
-@tab A builtin routine with no source code available.
+@tab A builtin system routine with no source code available.
 @item @i{SystemLib}
-@tab A library routine in the official lib directory @file{!DIR/lib}.
+@tab A library system routine in the official lib directory @file{!DIR/lib}.
 @item @i{Obsolete}
 @tab A library routine in the official lib directory @file{!DIR/lib/obsolete}.
 @item @i{Library}
-@tab A file on IDL's search path @code{!PATH}.
+@tab A routine in a file on IDL's search path @code{!PATH}.
 @item @i{Other}
-@tab Any other file not known to be on the search path.
+@tab Any other routine with a file not known to be on the search path.
 @item @i{Unresolved}
-@tab The shell lists this routine as unresolved.
+@tab An otherwise unkown routine the shell lists as unresolved 
+(referenced, but not compiled).
 @end multitable
 
-You can define additional categories based on the file name and path
-with the variable @code{idlwave-special-lib-alist}.
+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.
 
 @cindex Flags, in routine info
 @cindex Duplicate routines
 @cindex Multiply defined routines
 @cindex Routine definitions, multiple
-The flags @code{[CSB]} indicate if the file is known to IDLWAVE from the
-library catalog (@w{@code{[C--]}}, @pxref{Library Catalog}), from the Shell
-(@w{@code{[-S-]}}) or from an Emacs buffer (@w{@code{[--B]}}).
-Combinations are possible.  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{[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.
 
 @cindex Online Help from the routine info buffer
 @cindex Active text, in routine info
 @cindex Inserting keywords, from routine info
 @cindex Source file, access from routine info
-Some of the text in the @file{*Help*} buffer will be active (it
-highlights when you move the mouse over it).  Clicking on these items
-will have the following effects:
+Some of the text in the @file{*Help*} routine info buffer will be active
+(it is highlighted when the mouse moves over it).  Typically, clicking
+with the right mouse button invokes online help lookup, and clicking
+with the middle mouse button inserts keywords or visits files:
 
 @multitable @columnfractions 0.15 0.85
 @item @i{Usage}
@@ -1012,11 +1196,12 @@
 @tab The @i{Classes} line is only included in the routine info window if
 the current class inherits from other classes.  You can click with the
 @emph{middle} mouse button to display routine info about the current
-method in other classes on the inheritance chain.
+method in other classes on the inheritance chain, if such a method
+exists there.
 @end multitable
 
 @defopt idlwave-resize-routine-help-window (@code{t})
-Non-@code{nil} means, resize the Routine-info @file{*Help*} window to
+Non-@code{nil} means resize the Routine-info @file{*Help*} window to
 fit the content.
 @end defopt
 
@@ -1028,7 +1213,6 @@
 Maximum number of source files displayed in the Routine Info window.
 @end defopt
 
-@page
 
 @node Online Help, Completion, Routine Info, The IDLWAVE Major Mode
 @section Online Help
@@ -1043,43 +1227,56 @@
 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, also because usually IDLWAVE gets you to the right place in
-the docs directly, without additional browsing and scrolling.  For this
-online help to work, you need an ASCII version of the IDL documentation
-which is not part of the standard IDLWAVE distribution.  The required
-files can be downloaded from @uref{@value{IDLWAVE-HOMEPAGE}, the
-maintainers webpage}.  As the text is extracted from PDF files, the
-formatting of the help text is good for normal text, but graphics and
-multiline equations will not be well represented.  See also
-@ref{Documentation Scan}.
+application, because usually IDLWAVE gets you to the right place in the
+docs 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
 your own routines), the source code 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.  Otherwise the routine definition 
-statement (@code{pro}/@code{function}) is shown.
+file header, IDLWAVE shows the header (scrolling down to appropriate
+keywords).  Otherwise the routine definition statement
+(@code{pro}/@code{function}) is shown.
 
 @kindex M-?
-In any IDL program, press @kbd{M-?} (@code{idlwave-context-help}) or
-click with @kbd{S-Mouse-3} to access context sensitive online help.  The
-following locations are recognized as context:
+In any IDL program (or, as with most IDLWAVE commands, in the IDL
+Shell), press @kbd{M-?} (@code{idlwave-context-help}), or click with
+@kbd{S-mouse-3} to access context sensitive online help.  The following
+locations are recognized context for help:
 
 @cindex Context, for online help
 @multitable @columnfractions .25 .75
 @item @i{Routine name}
 @tab The name of a routine (function, procedure, method).
 @item @i{Keyword Parameter}
-@tab Keyword parameter of a routine.
+@tab A keyword parameter of a routine.
 @item @i{System Variable}
-@tab System variable like @code{!DPI}.
+@tab System variables like @code{!DPI}.
 @item @i{IDL Statement}
-@tab Like @code{PRO}, @code{REPEAT}, or @code{COMPILE_OPT}.
+@tab Statements like @code{PRO}, @code{REPEAT}, @code{COMPILE_OPT}, etc.
 @item @i{Class name}
-@tab Class name in @code{OBJ_NEW} call.
+@tab A class name in an @code{OBJ_NEW} call.
+@item @i{Class Init}
+@tab Beyond the class name in an @code{OBJ_NEW} call.
 @item @i{Executive Command}
-@tab Executive command like @code{.RUN}.  Mostly useful in the shell.
+@tab An executive command like @code{.RUN}.  Mostly useful in the shell.
 @item @i{Default}
 @tab The routine that would be selected for routine info display.
 @end multitable
@@ -1099,23 +1296,22 @@
 @itemize @bullet
 @item
 Online help for routines and keywords can be accessed through the
-Routine Info display.  Click with @kbd{Mouse-3} on an item to see the
+Routine Info display.  Click with @kbd{mouse-3} on an item to see the
 corresponding help (@pxref{Routine Info}).
 @item
 When using completion and Emacs pops up a window with possible
-completions, clicking with @kbd{Mouse-3} on a completion item invokes
+completions, clicking with @kbd{mouse-3} on a completion item invokes
 help on that item (@pxref{Completion}).
 @end itemize
 @noindent
 In both cases, a blue face indicates that the item is documented in the
-IDL manual.
-
-@page
-
-@cindex Help application, key bindings
-@cindex Key bindings, in help application
+IDL manual, but an attempt will be made to visit non-blue items directly
+in the originating source file.
+
+@cindex Help application, keybindings
+@cindex Keybindings, 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.
+following commands can be used to navigate inside the help system:
 
 @multitable  @columnfractions .15 .85
 @item @kbd{@key{SPACE}}
@@ -1130,7 +1326,7 @@
 @tab Move back and forward through the help topic history.
 @item @kbd{c}
 @tab Clear the history.
-@item @kbd{Mouse-2}
+@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.
@@ -1144,7 +1340,8 @@
 
 @sp 1
 @noindent When the help text is a source file, the following commands
-are also available.
+are also available:
+
 @multitable  @columnfractions .15 .85
 @item @kbd{h}
 @tab Jump to DocLib Header of the routine whose source is displayed
@@ -1164,7 +1361,7 @@
 @end defopt
 
 @defopt idlwave-help-use-dedicated-frame (@code{t})
-Non-nil means, use a separate frame for Online Help if possible.
+Non-@code{nil} means use a separate frame for Online Help if possible.
 @end defopt
 
 @defopt idlwave-help-frame-parameters
@@ -1172,7 +1369,7 @@
 @end defopt
 
 @defopt idlwave-max-popup-menu-items (@code{20})
-Maximum number of items per pane in pop-up menus.
+Maximum number of items per pane in popup menus.
 @end defopt
 
 @defopt idlwave-extra-help-function
@@ -1180,20 +1377,20 @@
 @end defopt
 
 @defopt idlwave-help-fontify-source-code (@code{nil})
-Non-nil means, fontify source code displayed as help.
+Non-@code{nil} means fontify source code displayed as help.
 @end defopt
 
 @defopt idlwave-help-source-try-header (@code{t})
-Non-nil means, try to find help in routine header when displaying source
+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 to IDLWAVE online help.
+The face for links in IDLWAVE online help.
 @end defopt
 
-@defopt idlwave-help-activate-links-agressively (@code{t})
-Non-@code{nil} means, make all possible links in help window active.
+@defopt idlwave-help-activate-links-aggressively (@code{t})
+Non-@code{nil} means make all possible links in help window active.
 @end defopt
 
 @node Completion, Routine Source, Online Help, The IDLWAVE Major Mode
@@ -1208,34 +1405,46 @@
 
 @kindex M-@key{TAB}
 @kindex C-c C-i
-IDLWAVE offers completion for class names, routine names and keywords.
-As in many programming modes, completion is bound to @kbd{M-@key{TAB}}.
-Completion uses the same internal information as routine info, so when
-necessary it can be updated with @kbd{C-c C-i}
-(@code{idlwave-update-routine-info}).
+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}).
 
 The completion function is context sensitive and figures out what to
-complete at point.  Here are example lines and what @kbd{M-@key{TAB}}
-would try to complete when the cursor is on the position marked with a
-@samp{*}.
+complete based location of the point.  Here are example lines and what
+@kbd{M-@key{TAB}} would try to complete when the cursor is on the
+position marked with a @samp{_}:
 
 @example
-plo*                    @r{Procedure}
-x = a*                  @r{Function}
-plot,xra*               @r{Keyword of @code{plot} procedure}
-plot,x,y,/x*            @r{Keyword of @code{plot} procedure}
-plot,min(*              @r{Keyword of @code{min} function}
-obj -> a*               @r{Object method (procedure)}
-a(2,3) = obj -> a*      @r{Object method (function)}
-x = obj_new('IDL*       @r{Class name}
-x = obj_new('MyCl',a*   @r{Keyword to @code{Init} method in class @code{MyCl}}
-pro A*                  @r{Class name}
-pro *                   @r{Fill in @code{Class::} of first method in this file}
-!v*                     @r{System variable}
-!version.t*             @r{Structure tag of system variable}
-self.g*                 @r{Class structure tag in methods}
+plo_                    @r{Procedure}
+x = a_                  @r{Function}
+plot,xra_               @r{Keyword of @code{plot} procedure}
+plot,x,y,/x_            @r{Keyword of @code{plot} procedure}
+plot,min(_              @r{Keyword of @code{min} function}
+obj -> a_               @r{Object method (procedure)}
+a(2,3) = obj -> a_      @r{Object method (function)}
+x = obj_new('IDL_       @r{Class name}
+x = obj_new('MyCl',a_   @r{Keyword to @code{Init} method in class @code{MyCl}}
+pro A_                  @r{Class name}
+pro _                   @r{Fill in @code{Class::} of first method in this file}
+!v_                     @r{System variable}
+!version.t_             @r{Structure tag of system variable}
+self.g_                 @r{Class structure tag in methods}
+state.w_                @r{Structure tag, if tag completion enabled}
+name = 'a_              @r{File name (default inside quotes)}
 @end example
 
+@cindex Completion, ambiguity
+@cindex Completion, forcing function name
+The only place where completion is ambiguous is procedure/function
+@emph{keywords} versus @emph{functions}.  After @samp{plot,x_}, IDLWAVE
+will always assume a keyword to plot.  You can force completion of a
+function name at such a location with a prefix arg: @kbd{C-u
+M-@key{TAB}}.
+
 @cindex Scrolling the @file{*Completions*} window
 @cindex Completion, scrolling
 @cindex Completion, Online Help
@@ -1243,11 +1452,42 @@
 If the list of completions is too long to fit in the
 @file{*Completions*} window, the window can be scrolled by pressing
 @kbd{M-@key{TAB}} repeatedly.  Online help (if installed) for each
-possible completion is available by clicking with @kbd{Mouse-3} on the
+possible completion is available by clicking with @kbd{mouse-3} on the
 item.  Items for which system online help (from the IDL manual) is
-available will be displayed in a different font.  For other items, the
-corresponding source code or DocLib header is available as help text.
-
+available will be displayed in a different font (e.g. colored blue).
+For other items, the corresponding source code or DocLib header will be
+used as the help text.
+
+@defopt idlwave-keyword-completion-adds-equal (@code{t})
+Non-@code{nil} means completion automatically adds @samp{=} after
+completed keywords.
+@end defopt
+
+@defopt idlwave-function-completion-adds-paren (@code{t})
+Non-@code{nil} means completion automatically adds @samp{(} after
+completed function.  A value of `2' means also add the closing
+parenthesis and position the cursor between the two.
+@end defopt
+
+@defopt idlwave-completion-restore-window-configuration (@code{t})
+Non-@code{nil} means restore window configuration after successful
+completion.
+@end defopt
+
+@defopt idlwave-highlight-help-links-in-completion (@code{t})
+Non-@code{nil} means highlight completions for which system help is
+available.
+@end defopt
+
+@menu
+* Case of Completed Words::     CaseOFcomPletedWords
+* Object Method Completion and Class Ambiguity::  obj->Method, what?
+* Class and Keyword Inheritance::  obj->Method, _EXTRA=e
+* Structure Tag Completion::    Completing state.Tag
+@end menu
+
+@node  Case of Completed Words, Object Method Completion and Class Ambiguity, Completion, Completion
+@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
@@ -1257,57 +1497,44 @@
 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}.
+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}.
 
 @defopt idlwave-completion-case
-Association list setting the case (UPPER/lower/Capitalized/...) of completed
-words. 
+Association list setting the case (UPPER/lower/Capitalized/MixedCase...)
+of completed words.
 @end defopt
 
 @defopt idlwave-completion-force-default-case (@code{nil})
-Non-@code{nil} means, completion will always honor the settings in
-@code{idlwave-completion-case}.  When nil (the default), lower case
-strings will be completed to lower case.
+Non-@code{nil} means completion will always honor the settings in
+@code{idlwave-completion-case}.  When nil (the default), entirely lower
+case strings will always be completed to lower case, no matter what the
+settings in @code{idlwave-completion-case}.
 @end defopt
 
 @defopt idlwave-complete-empty-string-as-lower-case (@code{nil})
-Non-@code{nil} means, the empty string is considered lower case for
+Non-@code{nil} means the empty string is considered lower case for
 completion.
 @end defopt
 
-@defopt idlwave-keyword-completion-adds-equal (@code{t})
-Non-@code{nil} means, completion automatically adds @samp{=} after
-completed keywords.
-@end defopt
-
-@defopt idlwave-function-completion-adds-paren (@code{t})
-Non-@code{nil} means, completion automatically adds @samp{(} after
-completed function.  A value of `2' means, also add the closing
-parenthesis and position cursor between the two.
-@end defopt
-
-@defopt idlwave-completion-restore-window-configuration (@code{t})
-Non-@code{nil} means, restore window configuration after successful
-completion.
-@end defopt
-
-@defopt idlwave-highlight-help-links-in-completion (@code{t})
-Non-nil means, highlight completions for which system help is available.
-@end defopt
-
-@subsubheading Object Method Completion and Class Ambiguity
+@node  Object Method Completion and Class Ambiguity, Class and Keyword Inheritance, Case of Completed Words, Completion
+@subsection Object Method Completion and Class Ambiguity
 @cindex Object methods
 @cindex Class ambiguity
 @cindex @code{self} object, default class
 An object method is not uniquely determined without the object's class.
-Since the class part is usually omitted in the source code, IDLWAVE
-considers all available methods in all classes as possible completions
-of an object method name.  For keywords, the combined keywords of the
-current method in all available classes will be considered.  In the
-@file{*Completions*} buffer, the classes allowed for each completion
-will be shown next to the item (see option
+Since the class is almost always omitted in the calling source, IDLWAVE
+considers all available methods in all classes as possible method name
+completions.  The combined list of keywords of the current method in
+@emph{all} known classes which contain that method will be considered
+for keyword completion.  In the @file{*Completions*} buffer, the
+matching classes will be shown next to each item (see option
 @code{idlwave-completion-show-classes}).  As a special case, the class
-of an object called @samp{self} object is always the class of the
+of an object called @samp{self} is always taken to be the class of the
 current routine.  All classes it inherits from are considered as well
 where appropriate.
 
@@ -1316,27 +1543,25 @@
 You can also call @code{idlwave-complete} with a prefix arg: @kbd{C-u
 M-@key{TAB}}.  IDLWAVE will then prompt you for the class in order to
 narrow down the number of possible completions.  The variable
-@code{idlwave-query-class} can be configured to make this behavior the
-default (not recommended).  After you have specified the class
-for a particular statement (e.g. when completing the method), IDLWAVE
-can remember it for the rest of the editing session.  Subsequent
-completions in the same statement (e.g. keywords) can then reuse this
-class information.  Remembering the class works by placing a text
-property in the object operator @samp{->}.  This is not enabled by
-default - the variable @code{idlwave-store-inquired-class} can be used
-to turn it on.
-
-@defopt idlwave-support-inheritance (@code{t})
-Non-@code{nil} means, treat inheritance with completion, online help etc.
-@end defopt
+@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}).  After you have specified the class for a
+particular statement (e.g. when completing the method), IDLWAVE can
+remember it for the rest of the editing session.  Subsequent completions
+in the same statement (e.g. keywords) can then reuse this class
+information.  This works by placing a text property on the method
+invocation operator @samp{->}, after which the operator will be shown in
+a different face.  This is not enabled by default --- the variable
+@code{idlwave-store-inquired-class} 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
+Non-@code{nil} means show classes in @file{*Completions*} buffer when
 completing object methods and keywords.
 @end defopt
 
 @defopt idlwave-completion-fontify-classes (@code{t})
-Non-@code{nil} means, fontify the classes in completions buffer.
+Non-@code{nil} means fontify the classes in completions buffer.
 @end defopt
 
 @defopt idlwave-query-class (@code{nil})
@@ -1344,7 +1569,7 @@
 @end defopt
 
 @defopt idlwave-store-inquired-class (@code{nil})
-Non-@code{nil} means, store class of a method call as text property on
+Non-@code{nil} means store class of a method call as text property on
 @samp{->}.
 @end defopt
 
@@ -1353,20 +1578,92 @@
 text property.
 @end defopt
 
+@node   Class and Keyword Inheritance, Structure Tag Completion, Object Method Completion and Class Ambiguity, Completion
+@subsection Class and Keyword Inheritance
+@cindex Inheritance, class
+@cindex Keyword inheritance
+@cindex Inheritance, keyword
+
+Class inheritance affects which methods are called in IDL.  An object of
+a class which inherits methods from one or more superclasses can
+override that method by defining its own method of the same name, extend
+the method by calling the method(s) of its superclass(es) in its
+version, or inherit the method directly by making no modifications.
+IDLWAVE examines class definitions during completion and routine
+information display, and records all inheritance information it finds.
+This information is displayed if appropriate with the calling sequence
+for methods (@pxref{Routine Info}), as long as variable
+@code{idlwave-support-inheritance} is non-@code{nil}.
+
+In many class methods, @emph{keyword} inheritance (@code{_EXTRA} and
+@code{_REF_EXTRA}) is used hand-in-hand with class inheritance and
+method overriding.  E.g., in a @code{SetProperty} method, this technique
+allows a single call @code{obj->SetProperty} to set properties up the
+entire class inheritance chain.  This is often referred to as
+@emph{chaining}, and is characterized by chained method calls like
+@w{@code{self->MySuperClass::SetProperty,_EXTRA=e}}.
+
+IDLWAVE can accomodate this special synergy between class and keyword
+inheritance: if @code{_EXTRA} or @code{_REF_EXTRA} are detected among a
+method's keyword parameters, all keywords of superclass versions of the
+method being considered are included in completion.  The completion
+buffer will label keywords based on their originating class.  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.
+
+@defopt idlwave-support-inheritance (@code{t})
+Non-@code{nil} means consider inheritance during completion, online help etc.
+@end defopt
+
+@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
+
+@node    Structure Tag Completion,  , Class and Keyword Inheritance, Completion
+@subsection Structure Tag Completion
+@cindex Completion, structure tag
+@cindex Structure tag completion
+
+In many programs, especially those involving widgets, large structures
+(e.g. the @samp{state} structure) are used to communicate among
+routines.  It is very convenient to be able to complete structure tags,
+in the same way as for instance variables of the @samp{self} object
+(@pxref{Object Method Completion and Class Ambiguity}).  Add-in code for
+structure tag completion is available in the form of a loadable
+completion module: @file{idlw-complete-structtag.el}.  Tag completion in
+structures is highly ambiguous (much more so than @samp{self}
+completion), so @code{idlw-complete-structtag} makes an unusual and
+specific assumption: the exact same variable name is used to refer to
+the structure in all parts of the program.  So, if you consistently
+refer to the same structure with the same variable name
+(e.g. @samp{state}), structure tags which are read from its definition
+can be used for completion.
+
+Structure tag completion is not enabled by default.  To enable it,
+simply add the following to your @file{.emacs}:
+
+@lisp
+   (add-hook 'idlwave-load-hook 
+             (lambda () (require 'idlw-complete-structtag)))
+@end lisp
+
 @node Routine Source, Resolving Routines, Completion, The IDLWAVE Major Mode
-
 @section Routine Source
 @cindex Routine source file
 @cindex Module source file
 @cindex Source file, of a routine
 @kindex C-c C-v
-Apart from clicking on a @i{Source:} line in the routine info window,
-there is also another way to find the source file of a routine.  The
+In addition to clicking on a @i{Source:} line in the routine info
+window, there is another way to find the source file of a routine.  The
 command @kbd{C-c C-v} (@code{idlwave-find-module}) asks for a module
 name, offering the same default as @code{idlwave-routine-info} would
-have used.  In the minibuffer, specify a complete routine name
-(including the class part).  IDLWAVE will display the source file in
-another window.
+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.
 
 @cindex Buffers, killing
 @cindex Killing autoloaded buffers
@@ -1393,18 +1690,16 @@
 library 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 in-depth information where IDLWAVE
+@xref{Sources of Routine Info}, for more information on the ways IDLWAVE
 collects data about routines, and how to update this information.
 
-
-@node Code Templates, Actions, Resolving Routines, The IDLWAVE Major Mode
+@node Code Templates, Abbreviations, Resolving Routines, The IDLWAVE Major Mode
 @section Code Templates
 @cindex Code templates
-@cindex Abbreviations
 @cindex Templates
 
 IDLWAVE can insert IDL code templates into the buffer.  For a few
-templates, this is done with direct key bindings:
+templates, this is done with direct keybindings:
 
 @multitable @columnfractions .15 .85
 @item @kbd{C-c C-c}
@@ -1417,13 +1712,29 @@
 @tab @code{WHILE} loop template
 @end multitable
 
-Otherwise, special abbreviations are used.  Emacs abbreviations are
-expanded by typing text into the buffer and pressing @key{SPC} or
-@key{RET}.  The special abbreviations used to insert code templates all
-start with a @samp{\} (the backslash).  Here are a few examples of
-predefined abbreviations.   For a full list, use @kbd{M-x
+All code templates are also available as abbreviations
+(@pxref{Abbreviations}).
+
+@node Abbreviations, Actions, Code Templates, The IDLWAVE Major Mode
+@section Abbreviations
+@cindex Abbreviations
+
+Special abbreviations exist to enable rapid entry of commonly used
+commands.  Emacs abbreviations are expanded by typing text into the
+buffer and pressing @key{SPC} or @key{RET}.  The special abbreviations
+used to insert code templates all start with a @samp{\} (the backslash),
+or, optionally, any other character set in
+@code{idlwave-abbrev-start-char}. IDLWAVE ensures that abbreviations are
+only expanded where they should be (i.e., not in a string or comment),
+and permits the point to be moved after an abbreviation expansion ---
+very useful for positioning the mark inside of parentheses, etc.
+
+Special abbreviations are pre-defined for code templates and other
+useful items.  To visit the full list of abbreviations, use @kbd{M-x
 idlwave-list-abbrevs}.
 
+Template abbreviations:
+
 @multitable @columnfractions .15 .85
 @item @code{\pr}
 @tab @code{PROCEDURE} template
@@ -1441,13 +1752,141 @@
 @tab @code{IF} statement template
 @item @code{\elif}
 @tab @code{IF-ELSE} statement template
-@item @code{\b}
-@tab @code{BEGIN}
 @end multitable
 
-The templates are expanded in upper or lower case, depending upon the
-variables @code{idlwave-abbrev-change-case} and
-@code{idlwave-reserved-word-upcase}.
+String abbreviations:
+
+@multitable @columnfractions .15 .85
+@item @code{\ap}
+@tab @code{arg_present()}
+@item @code{\b}
+@tab @code{begin}
+@item @code{\cb}
+@tab @code{byte()}
+@item @code{\cc}
+@tab @code{complex()}
+@item @code{\cd}
+@tab @code{double()}
+@item @code{\cf}
+@tab @code{float()}
+@item @code{\cl}
+@tab @code{long()}
+@item @code{\co}
+@tab @code{common}
+@item @code{\cs}
+@tab @code{string()}
+@item @code{\cx}
+@tab @code{fix()}
+@item @code{\e}
+@tab @code{else}
+@item @code{\ec}
+@tab @code{endcase}
+@item @code{\ee}
+@tab @code{endelse}
+@item @code{\ef}
+@tab @code{endfor}
+@item @code{\ei}
+@tab @code{endif else if}
+@item @code{\el}
+@tab @code{endif else}
+@item @code{\en}
+@tab @code{endif}
+@item @code{\er}
+@tab @code{endrep}
+@item @code{\es}
+@tab @code{endswitch}
+@item @code{\ew}
+@tab @code{endwhile}
+@item @code{\g}
+@tab @code{goto,}
+@item @code{\h}
+@tab @code{help,}
+@item @code{\ik}
+@tab @code{if keyword_set() then}
+@item @code{\iap}
+@tab @code{if arg_present() then}
+@item @code{\ine}
+@tab @code{if n_elements() eq 0 then}
+@item @code{\inn}
+@tab @code{if n_elements() ne 0 then}
+@item @code{\k}
+@tab @code{keyword_set()}
+@item @code{\n}
+@tab @code{n_elements()}
+@item @code{\np}
+@tab @code{n_params()}
+@item @code{\oi}
+@tab @code{on_ioerror,}
+@item @code{\or}
+@tab @code{openr,}
+@item @code{\ou}
+@tab @code{openu,}
+@item @code{\ow}
+@tab @code{openw,}
+@item @code{\p}
+@tab @code{print,}
+@item @code{\pt}
+@tab @code{plot,}
+@item @code{\re}
+@tab @code{read,}
+@item @code{\rf}
+@tab @code{readf,}
+@item @code{\rt}
+@tab @code{return}
+@item @code{\ru}
+@tab @code{readu,}
+@item @code{\s}
+@tab @code{size()}
+@item @code{\sc}
+@tab @code{strcompress()}
+@item @code{\sl}
+@tab @code{strlowcase()}
+@item @code{\sm}
+@tab @code{strmid()}
+@item @code{\sn}
+@tab @code{strlen()}
+@item @code{\sp}
+@tab @code{strpos()}
+@item @code{\sr}
+@tab @code{strtrim()}
+@item @code{\st}
+@tab @code{strput()}
+@item @code{\su}
+@tab @code{strupcase()}
+@item @code{\t}
+@tab @code{then}
+@item @code{\u}
+@tab @code{until}
+@item @code{\wc}
+@tab @code{widget_control,}
+@item @code{\wi}
+@tab @code{widget_info()}
+@item @code{\wu}
+@tab @code{writeu,}
+@end multitable
+
+@noindent You can easily add your own abbreviations or override existing
+abbrevs with @code{define-abbrev} in your mode hook using the
+convenience function @code{idlwave-define-abbrev}:
+
+@lisp
+(add-hook 'idlwave-mode-hook
+          (lambda ()
+            (idlwave-define-abbrev "wb" "widget_base()"
+				   (idlwave-keyword-abbrev 1))
+	    (idlwave-define-abbrev "ine" "IF N_Elements() EQ 0 THEN"
+				   (idlwave-keyword-abbrev 11))))
+@end lisp
+
+Notice how the abbreviation (here @emph{wb}) and its expansion
+(@emph{widget_base()}) are given as argument, and the single argument to
+@code{idlwave-keyword-abbrev} (here @emph{1}) specifies how far back to
+move the point upon expansion (in this example, to put it between the
+parentheses).
+
+The abbreviations are expanded in upper or lower case, depending upon
+the variables @code{idlwave-abbrev-change-case} and (for reserved word
+templates) @code{idlwave-reserved-word-upcase} (@pxref{Case Changes}).
 
 @defopt idlwave-abbrev-start-char (@code{"\"})
 A single character string used to start abbreviations in abbrev
@@ -1459,7 +1898,7 @@
 between the parenthesis of a function call.
 @end defopt
 
-@node Actions, Doc Header, Code Templates, The IDLWAVE Major Mode
+@node Actions, Doc Header, Abbreviations, The IDLWAVE Major Mode
 @section Actions
 @cindex Actions
 @cindex Coding standards, enforcing
@@ -1469,10 +1908,10 @@
 to enforce coding standards.  Most actions which have been implemented
 in IDLWAVE are turned off by default, assuming that the average user
 wants her code the way she writes it.  But if you are a lazy typist and
-want your code to adhere to certain standards, they can be
+want your code to adhere to certain standards, actions can be
 helpful.
 
-Action can be applied in three ways:
+Actions can be applied in three ways:
 
 @itemize @bullet
 @item
@@ -1488,12 +1927,12 @@
 @item
 @cindex Foreign code, adapting
 @cindex Actions, applied to foreign code
-Action can also be applied to a larger piece of code, e.g. in order to
-convert foreign code to your own style.  To do this, mark the relevant
-part of the code and execute @kbd{M-x expand-region-abbrevs}.  Useful
-marking commands are @kbd{C-x h} (the entire file) or @kbd{C-M-h} (the
-current subprogram). @xref{Code Indentation}, for information how to
-adjust the indentation of the code.
+Actions can also be applied to a larger piece of code, e.g. to convert
+foreign code to your own style.  To do this, mark the relevant part of
+the code and execute @kbd{M-x expand-region-abbrevs}.  Useful marking
+commands are @kbd{C-x h} (the entire file) or @kbd{C-M-h} (the current
+subprogram). @xref{Code Indentation}, for information how to adjust the
+indentation of the code.
 @end itemize
 
 @defopt idlwave-do-actions (@code{nil})
@@ -1518,13 +1957,13 @@
 Whenever you type an @code{END} statement, IDLWAVE finds the
 corresponding start of the block and the cursor blinks back to that
 location for a second.  If you have typed a specific @code{END}, like
-@code{ENDIF} or @code{ENDCASE}, you get a warning if that kind of END
+@code{ENDIF} or @code{ENDCASE}, you get a warning if that terminator
 does not match the type of block it terminates.
 
 Set the variable @code{idlwave-expand-generic-end} in order to have all
-generic @code{END} statements automatically expanded to a specific type.
-You can also type @kbd{C-c ]} to close the current block by inserting
-the appropriate @code{END} statement.
+generic @code{END} statements automatically expanded to the appropriate
+type.  You can also type @kbd{C-c ]} to close the current block by
+inserting the appropriate @code{END} statement.
 
 @defopt idlwave-show-block (@code{t})
 Non-@code{nil} means point blinks to block beginning for
@@ -1536,7 +1975,7 @@
 @end defopt
 
 @defopt idlwave-reindent-end (@code{t})
-Non-nil means re-indent line after END was typed.
+Non-@code{nil} means re-indent line after END was typed.
 @end defopt
 
 @node Padding Operators, Case Changes, Block Boundary Check, Actions
@@ -1546,16 +1985,15 @@
 @cindex Space, around operators
 
 Some operators can be automatically surrounded by spaces.  This can
-happen when the operator is typed, or also later when the line is
-indented.  IDLWAVE contains this setting for the operators @samp{&},
-@samp{<}, @samp{>}, @samp{,}, @samp{=}, and @samp{->}@footnote{Operators
-longer than one character can only be padded during line indentation.},
-but the feature is turned off by default.  If you want to turn it on,
-customize the variables @code{idlwave-surround-by-blank} and
-@code{idlwave-do-actions}.  You can also define similar actions for
-other operators by using the function @code{idlwave-action-and-binding}
-in the mode hook.  For example, to enforce space padding of the @samp{+}
-and @samp{*} operators, try this in @file{.emacs}
+happen when the operator is typed, or later when the line is indented.
+IDLWAVE can pad the operators @samp{&}, @samp{<}, @samp{>}, @samp{,},
+@samp{=}, and @samp{->}, but this feature is turned off by default.  If
+you want to turn it on, customize the variables
+@code{idlwave-surround-by-blank} and @code{idlwave-do-actions}.  You can
+also define similar actions for other operators by using the function
+@code{idlwave-action-and-binding} in the mode hook.  For example, to
+enforce space padding of the @samp{+} and @samp{*} operators, try this
+in @file{.emacs}
 
 @lisp
 (add-hook 'idlwave-mode-hook
@@ -1566,7 +2004,7 @@
 @end lisp
 
 @defopt idlwave-surround-by-blank (@code{nil})
-Non-@code{nil} means, enable @code{idlwave-surround}.  If non-nil,
+Non-@code{nil} means enable @code{idlwave-surround}.  If non-@code{nil},
 @samp{=}, @samp{<}, @samp{>}, @samp{&}, @samp{,}, @samp{->} are
 surrounded with spaces by @code{idlwave-surround}.
 @end defopt
@@ -1602,7 +2040,9 @@
 @end lisp
 
 For more information, see the documentation string for the function
-@code{idlwave-action-and-binding}.
+@code{idlwave-action-and-binding}.  For information on controlling the
+case of routines, keywords, classes, and methods as they are completed, see
+@ref{Completion}.
 
 @defopt idlwave-abbrev-change-case (@code{nil})
 Non-@code{nil} means all abbrevs will be forced to either upper or lower
@@ -1610,7 +2050,7 @@
 @end defopt
 
 @defopt idlwave-reserved-word-upcase (@code{nil})
-Non-@code{nil} means, reserved words will be made upper case via abbrev
+Non-@code{nil} means reserved words will be made upper case via abbrev
 expansion.
 @end defopt
 
@@ -1627,16 +2067,22 @@
 @kindex C-c C-h
 @kindex C-c C-m
 The command @kbd{C-c C-h} inserts a standard routine header into the
-buffer, with the usual fields for documentation.  One of the keywords is 
+buffer, with the usual fields for documentation (a different header can
+be specified with @code{idlwave-file-header}).  One of the keywords is
 @samp{MODIFICATION HISTORY} under which the changes to a routine can be
 recorded.  The command @kbd{C-c C-m} jumps to the @samp{MODIFICATION
-HISTORY} of the current routine or file and inserts the user
-name with a timestamp.
+HISTORY} of the current routine or file and inserts the user name with a
+timestamp.
 
 @defopt idlwave-file-header
 The doc-header template or a path to a file containing it.
 @end defopt
 
+@defopt idlwave-header-to-beginning-of-file (@code{nil})
+Non-@code{nil} means the documentation header will always be at start
+of file.
+@end defopt
+
 @defopt idlwave-timestamp-hook
 The hook function used to update the timestamp of a function.
 @end defopt
@@ -1665,10 +2111,21 @@
 
 IDLWAVE supports both @file{Imenu} and @file{Func-menu}, two packages
 which make it easy to jump to the definitions of functions and
-procedures in the current file.
-
-Several commands allow to move quickly through the structure of an IDL
-program.  These are
+procedures in the current file with a pop-up selection.  To bind
+@file{Imenu} to a mouse-press, use in your @file{.emacs}:
+
+@lisp
+(define-key global-map [S-down-mouse-3] 'imenu)
+@end lisp
+
+@cindex @file{Speedbar}, Emacs package
+
+In addition, @file{Speedbar} support allows convenient navigation of a
+source tree of IDL routine files, quickly stepping to routine
+definitions.  See @code{Tools->Display Speedbar}.
+
+Several commands allow you to move quickly through the structure of an
+IDL program:
 
 @multitable @columnfractions .15 .85
 @item @kbd{C-M-a}
@@ -1715,19 +2172,6 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
 @node The IDLWAVE Shell, Installation, The IDLWAVE Major Mode, Top
 @chapter The IDLWAVE Shell
 @cindex IDLWAVE shell
@@ -1737,21 +2181,26 @@
 @cindex Comint, Emacs package
 @cindex Windows
 @cindex MacOS
-
-The IDLWAVE shell is an Emacs major mode which allows to run the IDL
-program as an inferior process of Emacs.  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 uses @file{comint}, an Emacs
-packages which handles the communication with the IDL program.
-Unfortunately IDL for Windows and MacOS does 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
-only works under GNU and Unix.
+@cindex Unix
+
+The IDLWAVE shell is an Emacs major mode which permits running the IDL
+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
+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.
 
 @menu
 * Starting the Shell::          How to launch IDL as a subprocess
 * Using the Shell::             Interactively working with the Shell
 * Debugging IDL Programs::      Compilation/Debugging
+* Examining Variables::         
+* Custom Expression Examination::  
 @end menu
 
 @node Starting the Shell, Using the Shell, The IDLWAVE Shell, The IDLWAVE Shell
@@ -1768,8 +2217,10 @@
 @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.
+(@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
@@ -1777,11 +2228,18 @@
 window, configure the variable
 @code{idlwave-shell-use-dedicated-frame}. 
 
-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}.
-
-@defopt idlwave-shell-explicit-file-name
+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:
+
+@example
+emacs -geometry 80x32 -eval "(idlwave-shell 'quick)"
+@end example
+
+Replace the @samp{-geometry 80x32} option with @samp{-nw} if you prefer
+the Emacs process to run directly inside the terminal window.
+
+@defopt idlwave-shell-explicit-file-name (@file{idl})
 This is the command to run IDL.
 @end defopt
 
@@ -1797,7 +2255,7 @@
 Name to be associated with the IDL process.
 @end defopt
 
-@defopt idlwave-shell-automatic-start
+@defopt idlwave-shell-automatic-start  (@code{nil})
 Non-@code{nil} means attempt to invoke idlwave-shell if not already
 running.
 @end defopt
@@ -1806,8 +2264,16 @@
 Initial commands, separated by newlines, to send to IDL.
 @end defopt
 
+@defopt idlwave-shell-save-command-history (@code{t})
+Non-@code{nil} means preserve command history between sessions.
+@end defopt
+
+@defopt idlwave-shell-command-history-file (@file{~/.idlwhist})
+The file in which the command history of the idlwave shell is saved.
+@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
 shell buffer. 
 @end defopt
 
@@ -1815,6 +2281,11 @@
 The frame parameters for a dedicated idlwave-shell frame.
 @end defopt
 
+@defopt idlwave-shell-raise-frame (@code{t})
+Non-@code{nil} means `idlwave-shell' raises the frame showing the shell
+window.
+@end defopt
+
 @defopt idlwave-shell-temp-pro-prefix
 The prefix for temporary IDL files used when compiling regions.
 @end defopt
@@ -1835,8 +2306,9 @@
 history just like in an X terminal@footnote{This is different from
 normal Emacs/Comint behavior, but more like an xterm.  If you prefer the
 default comint functionality, check the variable
-@code{idlwave-shell-arrows-do-history}.}.  Here is a list of
-commonly used commands.
+@code{idlwave-shell-arrows-do-history}.}.  The history is preserved
+between emacs and IDL sessions.  Here is a list of commonly used
+commands:
 
 @multitable @columnfractions .12 .88
 @item @key{UP}
@@ -1884,8 +2356,10 @@
 @cindex Online Help, in the shell
 @multitable @columnfractions .12 .88
 @item @kbd{@key{TAB}}
-@tab  Completion of file names, routine names and keywords
-(@code{idlwave-shell-complete})
+@tab  Completion of file names (between quotes and after executive
+commands @samp{.run} and @samp{.compile}), routine names, class names,
+keywords, system variables, system variable tags etc.
+(@code{idlwave-shell-complete}).
 @item @kbd{M-@key{TAB}}
 @tab Same as @key{TAB}
 @item @kbd{C-c ?}
@@ -1906,6 +2380,10 @@
 history like xterm.
 @end defopt
 
+@defopt idlwave-shell-comint-settings
+Alist of special settings for the comint variables in the IDLWAVE Shell.
+@end defopt
+
 @defopt idlwave-shell-file-name-chars
 The characters allowed in file names, as a string.  Used for file name
 completion.
@@ -1935,7 +2413,8 @@
 automatic switches of the input mode.
 
 @defopt idlwave-shell-use-input-mode-magic (@code{nil})
-Non-nil means, IDLWAVE should check for input mode spells in output.
+Non-@code{nil} means IDLWAVE should check for input mode spells in
+output.
 @end defopt
 
 @defopt idlwave-shell-input-mode-spells
@@ -1943,7 +2422,7 @@
 modes.
 @end defopt
 
-@node Debugging IDL Programs,  , Using the Shell, The IDLWAVE Shell
+@node Debugging IDL Programs, Examining Variables, Using the Shell, The IDLWAVE Shell
 @section Debugging IDL Programs
 @cindex Debugging
 @cindex Keybindings for debugging
@@ -1951,29 +2430,31 @@
 
 @kindex C-c C-d
 Programs can be compiled, run, and debugged directly from the source
-buffer in Emacs.  The IDLWAVE shell installs key bindings both in the
+buffer in Emacs.  The IDLWAVE shell installs keybindings both in the
 shell buffer and in all IDL code buffers of the current Emacs session.
 On Emacs versions which support this, it also installs a debugging
 toolbar.  The display of the toolbar can be toggled with @kbd{C-c C-d
 C-t} (@code{idlwave-shell-toggle-toolbar}).
 
-The debugging key bindings are by default on the prefix key @kbd{C-c
+The debugging keybindings 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}, compiling a source file with @kbd{C-c C-d C-c}.  If you find this
-too much work you can choose a combination of modifier keys which is not
-used by other commands.  For example, if you write in @file{.emacs}
+too much work, you can add bindings for one or more modifier keys which
+is not used by other commands.  For example, if you write in
+@file{.emacs}:
 
 @lisp
 (setq idlwave-shell-debug-modifiers '(control shift))
 @end lisp
 
-a breakpoint can be set by pressing @kbd{b} while holding down
+@noindent a breakpoint can 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}
+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 with the modifiers given in the
-@code{idlwave-shell-debug-modifiers} variable.
+equivalent single-keypress shortcut if modifiers are given in the
+@code{idlwave-shell-debug-modifiers} variable (see @pxref{Lesson II --
+Customization}).
 
 @defopt idlwave-shell-prefix-key (@kbd{C-c C-d})
 The prefix key for the debugging map
@@ -1981,17 +2462,17 @@
 @end defopt
 
 @defopt idlwave-shell-activate-prefix-keybindings (@code{t})
-Non-@code{nil} means, debug commands will be bound to the prefix
+Non-@code{nil} means debug commands will be bound to the prefix
 key, like @kbd{C-c C-d C-b}.
 @end defopt
 
 @defopt idlwave-shell-debug-modifiers (@code{nil})
-List of modifier keys to use for binding debugging commands in the shell 
-and in source buffers.
+List of modifier keys to use for additional binding of debugging
+commands in the shell and source buffers.
 @end defopt
 
 @defopt idlwave-shell-use-toolbar (@code{t})
-Non-@code{nil} means, use the debugging toolbar in all IDL related
+Non-@code{nil} means use the debugging toolbar in all IDL related
 buffers.
 @end defopt
 
@@ -1999,7 +2480,7 @@
 @menu
 * Compiling Programs::          Compiling buffers under the shell
 * Breakpoints and Stepping::    Deciding where to stop and look
-* Examining Variables::         What is the value now?
+* Walking the Calling Stack::   From where was this routine called?
 @end menu
 
 @node Compiling Programs, Breakpoints and Stepping, Debugging IDL Programs, Debugging IDL Programs
@@ -2012,7 +2493,7 @@
 @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 send the command @samp{.run path/to/file} to 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.
@@ -2027,22 +2508,22 @@
 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 decides about the preferred method.  Legal values
-are @code{nil}, @code{t}, @code{arrow}, and @code{face}.
+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.
+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.
+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, Examining Variables, Compiling Programs, Debugging IDL Programs
+@node Breakpoints and Stepping, Walking the Calling Stack, Compiling Programs, Debugging IDL Programs
 @subsection Breakpoints and Stepping
 @cindex Breakpoints
 @cindex Stepping
@@ -2053,16 +2534,23 @@
 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, the breakpoint gets a @code{/ONCE} keyword, meaning that it
-will be deleted after first use.  With a numeric prefix greater than
-one, the breakpoint will only be active the @code{nth} time it is hit.
-To clear the breakpoint in the current line, use @kbd{C-c C-d C-d}
-(@code{idlwave-clear-current-bp}).  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.
-
-Once the program has stopped somewhere, you can step through it.  Here
-is a summary of the breakpoint and stepping commands:
+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, the breakpoint will only be active the
+@code{nth} time it is hit.  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.
+
+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
+line of IDL code ("step into"); @kbd{C-c C-d C-n} to step a single line,
+treating procedure and function calls as a single step ("step over");
+@kbd{C-c C-d C-h} to continue execution to the line at the cursor and
+@kbd{C-c C-d C-r} to continue execution.  Here is a summary of the
+breakpoint and stepping commands:
 
 @multitable @columnfractions .23 .77
 @item @kbd{C-c C-d C-b}
@@ -2096,7 +2584,7 @@
 @end multitable
 
 @defopt idlwave-shell-mark-breakpoints (@code{t})
-Non-@code{nil} means, mark breakpoints in the source file buffers.  The
+Non-@code{nil} means mark breakpoints in the source file buffers.  The
 value indicates the preferred method.  Legal values are @code{nil},
 @code{t}, @code{face}, and @code{glyph}.
 @end defopt
@@ -2106,42 +2594,92 @@
 @code{idlwave-shell-mark-breakpoints} has the value @code{face}.
 @end defopt
 
-@node Examining Variables,  , Breakpoints and Stepping, Debugging IDL Programs
-@subsection Examining Variables
+@node Walking the Calling Stack,  , Breakpoints and Stepping, Debugging IDL Programs
+@subsection Walking the Calling Stack
+@cindex Calling stack, walking
+
+While debugging a program, it can be very useful to check the context in
+which the current routine was called, for instance to help understand
+the value of the arguments passed.  To do so conveniently you need to
+examine the calling stack.  If execution is stopped somewhere deep in a
+program, you can use the commands @kbd{C-c C-d C-@key{UP}}
+(@code{idlwave-shell-stack-up}) and @kbd{C-c C-d C-@key{DOWN}}
+(@code{idlwave-shell-stack-down}), or the corresponding toolbar buttons,
+to move up or down through the calling stack.  The mode line of the
+shell window will indicate the position within the stack with a label
+like @samp{[-3:MYPRO]}.  The line of IDL code at that stack position
+will be highlighted.  If you continue execution, IDLWAVE will
+automatically return to the current level. @xref{Examining Variables},
+for information how to examine the value of variables and expressions on
+higher calling stack levels.
+
+@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 Printing expressions
 @cindex Mouse binding to print expressions
 
 @kindex C-c C-d C-p
-When execution is stopped you can examine the values of variables.  The
-command @kbd{C-c C-d C-p} prints the expression at point, while @kbd{C-c
-C-d ?} shows help on this expression.  The expression at point is an
-array expression or a function call, or the contents of a pair of
-parenthesis.  The selected expression becomes highlighted in the source
-code for a short time.  Calling the above commands with a prefix
-argument will prompt for an expression instead of using the one at
-point.
-
-It is very convenient to click with the mouse on expressions to retrieve
-their value.  Expression printing is also bound to @kbd{S-Mouse-2} and
-expression help to @kbd{C-S-Mouse-2}.  I.e. you need to hold down
-@key{SHIFT} and @key{CONTROL} while clicking with the mouse.
-
-@cindex Calling stack, motion
+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.
+
+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
+execution is stopped in a buffer due to a triggered breakpoint or error,
+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 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.
+
+If the variable @code{idlwave-shell-separate-examine-output} is
+non-@code{nil} (the default), all examine output will be sent to a
+special @file{*Examine*} buffer, rather than the shell.  The output of
+prior examine commands is saved.  In this buffer @key{c} clears the
+contents, and @key{q} hides the buffer.
+
+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.
+
+For added speed and convenience, there are mouse bindings which allow
+you to click on expressions and examine their values.  Use
+@kbd{S-mouse-2} to print an expression and @kbd{C-M-mouse-2} to invoke
+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}.
+
 @cindex Printing expressions, on calling stack
 @cindex Restrictions for expression printing
-Printing of expressions also works on higher levels of the calling
-stack.  This means that you can examine the values of variables and
-expressions inside the routine which called the current routine etc.
-Use the commands @kbd{C-c C-d C-@key{UP}}
-(@code{idlwave-shell-stack-up}) and @kbd{C-c C-d C-@key{DOWN}}
-(@code{idlwave-shell-stack-down}) or the corresponding toolbar buttons
-to move through the calling stack.  The mode line of the shell window
-will indicate the routine and the calling stack level which define the
-context for printing expressions.  The following restrictions apply for
-all levels except the current:
+The same variable inspection commands work both in the IDL Shell and
+IDLWAVE buffers, and even for variables at higher levels of the calling
+stack.  For instance, if you're stopped at a breakpoint in a routine,
+you can examine the values of variables and expressions inside its
+calling routine, and so on, all the way up through the calling stack.
+Simply step up the stack, and print variables as you see them
+(@pxref{Walking the Calling Stack}, for information on stepping back
+through the calling stack).  The following restrictions apply for all
+levels except the current:
 
 @itemize @bullet
 @item
@@ -2149,9 +2687,9 @@
 with a @samp{( )} will be interpreted as function calls.
 @item
 @cindex ROUTINE_NAMES, IDL procedure
-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.
+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.
 @end itemize
 
 @defopt idlwave-shell-expression-face
@@ -2160,11 +2698,79 @@
 the expression printed by IDL.
 @end defopt
 
-@defopt idlwave-shell-print-expression-function (@code{nil})
-A function to handle special display of evaluated expressions.
+@defopt idlwave-shell-output-face
+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. 
 @end defopt
 
-@node Installation, Acknowledgement, The IDLWAVE Shell, Top
+@node Custom Expression Examination,  , Examining Variables, The IDLWAVE Shell
+@section Custom Expression Examination
+@cindex Expressions, custom examination
+@cindex Custom expression examination
+
+The variety of possible variable and expression examination commands is
+endless (just look, for instance, at the keyword list to
+@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}.
+
+In addition to the popup 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
+@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 
+                                  "print, size(___,/DIMENSIONS)"))
+            (idlwave-shell-define-key-both [f9] (idlwave-shell-examine
+                                       "print, size(___,/DIMENSIONS)"))
+            (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                                        
+            
+@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,
+and @key{f11} will show the contents of a nearby structure.  As you can
+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 popup, and the values are custom IDL examine
+command strings to send, after all instances of @code{___} are replaced
+by the indicated expression.
+@end defopt
+
+
+@node Installation, Acknowledgements, The IDLWAVE Shell, Top
 @chapter Installation
 @cindex Installation
 
@@ -2189,8 +2795,8 @@
 @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
-needed for online help are not distributed with XEmacs/Emacs and have to
-be installed separately@footnote{Due to copyright reasons, the ASCII
+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}).
 
@@ -2198,7 +2804,7 @@
 @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
+@node Installing Online Help, Upgrading from idl.el, Installing IDLWAVE, Installation
 @section Installing Online Help
 @cindex Installing online help
 @cindex Online Help, Installation
@@ -2242,15 +2848,15 @@
 @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
+Like in 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 Acknowledgement, Sources of Routine Info, Installation, Top
-@chapter Acknowledgement
-@cindex Acknowledgement
+@node Acknowledgements, Sources of Routine Info, Installation, Top
+@chapter Acknowledgements
+@cindex Acknowledgements
 @cindex Maintainer, of IDLWAVE
 @cindex Authors, of IDLWAVE
 @cindex Contributors, to IDLWAVE
@@ -2267,16 +2873,15 @@
 for several years.
 
 @item
-@uref{mailto:dominik@@astro.uva.nl, @b{Carsten Dominik}}, who have
-been in charge of the package since version 3.0, and also wrote this
+@uref{mailto:dominik@@astro.uva.nl, @b{Carsten Dominik}} was in charge
+of the package from version 3.0, during which time he overhauled almost
+everything, modernized IDLWAVE with many new features, and developed the
 manual.
 
-@item
-@uref{mailto: jdsmith@@astro.cornell.edu, @b{John-David Smith}},
-current maintainer, who is also responsible for this manual's
-maintenance.  John-David has also shaped Object method completion and
-most new features in version 4.0 with his ideas, bug reports, and
-patient explanations of IDL internals.
+@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.
 @end itemize
 
 @noindent
@@ -2295,6 +2900,8 @@
 @item
 Kevin Ivory <Kevin.Ivory@@linmpi.mpg.de>
 @item
+Dick Jackson <dick@@d-jackson.com>
+@item
 Xuyong Liu <liu@@stsci.edu>
 @item
 Simon Marshall <Simon.Marshall@@esrin.esa.it>
@@ -2317,14 +2924,14 @@
 @noindent
 Thanks to everyone!
 
-@node Sources of Routine Info, Configuration Examples, Acknowledgement, Top
+@node Sources of Routine Info, Configuration Examples, Acknowledgements, Top
 @appendix Sources of Routine Info
 
 @cindex Sources of routine information
-In @ref{Routine Info} and @ref{Completion} it was shown how IDLWAVE
-displays the calling sequence and keywords of routines, and how it
-completes routine names and keywords.  For these features to work,
-IDLWAVE must know about the accessible routines.
+In @ref{Routine Info} and @ref{Completion} we showed how IDLWAVE
+displays the calling sequence and keywords of routines, and completes
+routine names and keywords.  For these features to work, IDLWAVE must
+know about the accessible routines.
 
 @menu
 * Routine Definitions::         Where IDL Routines are defined.
@@ -2335,7 +2942,7 @@
 @end menu
 
 @node Routine Definitions, Routine Information Sources, Sources of Routine Info, Sources of Routine Info
-@section Routine Definitions
+@appendixsec Routine Definitions
 @cindex Routine definitions
 @cindex IDL variable @code{!PATH}
 @cindex @code{!PATH}, IDL variable
@@ -2343,32 +2950,33 @@
 @cindex @code{LINKIMAGE}, IDL routine
 @cindex External routines
 
-Routines which can be used in an IDL program can be defined in several
-places:
+@noindent Routines which can be used in an IDL program can be defined in
+several places:
 
 @enumerate
 @item 
 @emph{Builtin routines} are defined inside IDL itself.  The source
-code of such routines is not accessible to the user.
+code of such routines is not available.
 @item
-Routines @emph{part of the current program} are defined in a file which
-is explicitly compiled by the user.  This file may or may not be located
-on the IDL search path.
+Routines which are @emph{part of the current program}, defined in a
+file which is explicitly compiled by the user.  This file may or may not
+be located on the IDL search path.
 @item 
-@emph{Library routines} are defined in special files which are located
-somewhere on IDL's search path.  When a library routine is called for
-the first time, IDL will find the source file and compile it
-dynamically.
+@emph{Library routines} are defined in files located on IDL's search
+path, and will need not be manually compiled.  When a library routine is
+called for the first time, IDL will find the source file and compile it
+dynamically.  A special sub-category of library routines are the
+@emph{system routines} distributed with IDL, and usually available in
+the @file{lib} subdirectory of the IDL distribution.
 @item
 External routines written in other languages (like Fortran or C) can be
 called with @code{CALL_EXTERNAL}, linked into IDL via @code{LINKIMAGE},
 or included as dynamically loaded modules (DLMs).  Currently IDLWAVE
-cannot provide routine info and completion for external
-routines.
+cannot provide routine info and completion for such external routines.
 @end enumerate
 
 @node Routine Information Sources, Library Catalog, Routine Definitions, Sources of Routine Info
-@section Routine Information Sources
+@appendixsec Routine Information Sources
 @cindex Routine info sources
 @cindex Builtin list of routines
 @cindex Updating routine info
@@ -2376,8 +2984,8 @@
 @cindex Buffers, scanning for routine info
 @cindex Shell, querying for routine info
 
-In oder to know about as many routines as possible, IDLWAVE will do the
-following to collect information:
+@noindent To maintain the most comprehensive information about all IDL
+routines on a system, IDLWAVE collects data from many sources:
 
 @enumerate
 
@@ -2387,8 +2995,8 @@
 @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 how to regenerate this file for new versions of IDL.
+@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
@@ -2399,23 +3007,35 @@
 can be used at any time to rescan all buffers.
 
 @item
-If you have an IDLWAVE-Shell running as inferior process of the current
-Emacs session, IDLWAVE will @emph{query the shell} for compiled routines
-and their arguments.  This happens automatically when routine
-information or completion is first requested by the user, and each time
-an Emacs buffer is compiled with @kbd{C-c C-d C-c}.  The command
-@kbd{C-c C-i} (@code{idlwave-update-routine-info}) can be used to ask
-the shell again at any time.
+If you have an IDLWAVE-Shell running in the Emacs session, IDLWAVE will
+@emph{query the shell} for compiled routines and their arguments.  This
+happens automatically when routine information or completion is first
+requested by the user, and each time an Emacs buffer is compiled with
+@kbd{C-c C-d C-c}.  Though rarely necessary, the command @kbd{C-c C-i}
+(@code{idlwave-update-routine-info}) can be used to update the shell
+routine data.
 
 @item
-IDLWAVE can scan all or selected library files and store the result in a
-file which will be automatically loaded just like
+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.
 @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).
+
+@defopt idlwave-init-rinfo-when-idle-after (@code{10})
+Seconds of idle time before routine info is automatically initialized.
+@end defopt
+
 @defopt idlwave-scan-all-buffers-for-routine-info (@code{t})
-Non-@code{nil} means, scan all buffers for IDL programs when updating
+Non-@code{nil} means scan all buffers for IDL programs when updating
 info.
 @end defopt
 
@@ -2428,12 +3048,13 @@
 @end defopt
 
 @node Library Catalog, Load-Path Shadows, Routine Information Sources, Sources of Routine Info
-@section Library Catalog
+@appendixsec Library Catalog
 @cindex Library scan
 @cindex Library catalog
 @cindex IDL library routine info
 @cindex Windows
 @cindex MacOS
+@cindex Unix
 @cindex IDL variable @code{!DIR}
 @cindex @code{!DIR}, IDL variable
 
@@ -2446,9 +3067,18 @@
 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}.  Under Unix and GNU,
-these values will be automatically inferred from an IDLWAVE
-shell.
+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/")
+@end lisp
+
+@noindent Under 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
@@ -2466,7 +3096,10 @@
 @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 IDLWAVEs internal lists.
+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
@@ -2479,11 +3112,11 @@
 @end defopt
 
 @defopt idlwave-library-path
-IDL library path for Windows and MacOS.  Not needed under GNU and Unix.
+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 GNU and Unix.
+The IDL system directory for Windows and MacOS.  Not needed under UNIX.
 @end defopt
 
 @defopt idlwave-special-lib-alist
@@ -2491,7 +3124,7 @@
 @end defopt
 
 @node Load-Path Shadows, Documentation Scan, Library Catalog, Sources of Routine Info
-@section Load-Path Shadows
+@appendixsec Load-Path Shadows
 @cindex Load-path shadows
 @cindex Shadows, load-path
 @cindex Duplicate routines
@@ -2508,7 +3141,7 @@
 @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{likelyhood of use}.  So the first entry will be most likely the
+@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:
@@ -2529,12 +3162,12 @@
 @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
+load path, not just selected directories.  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 of course
-also advisable for many other reasons.
+files.  Therefore, such local files should not be installed inside the
+@file{lib} directory of the IDL directory.  This is also advisable for
+many other reasons.
 
 @cindex Windows
 @cindex MacOS
@@ -2550,7 +3183,7 @@
 on the load path is routine info display (@pxref{Routine Info}).
 
 @node Documentation Scan,  , Load-Path Shadows, Sources of Routine Info
-@section Documentation Scan 
+@appendixsec Documentation Scan 
 @cindex @file{get_rinfo}
 @cindex @file{idlw-rinfo.el}
 @cindex @file{idlw-help.txt}
@@ -2572,7 +3205,15 @@
 by scanning selected files from the IDL documentation.  Instructions on
 how to use @file{get_rinfo} are in the program itself.
 
-@node Configuration Examples, Index, Sources of Routine Info, Top
+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
 @appendix Configuration Examples
 @cindex Configuration examples
 @cindex Example configuration
@@ -2581,34 +3222,40 @@
 @cindex Interview, with the maintainer
 
 @noindent
-@b{Question:} So now you have all these complicated configuration
-options in your package, but which ones do @emph{you} as the maintainer
-actually set in your own configuration?
+@b{Question:} You have all these complicated configuration options in
+your package, but which ones do @emph{you} as the maintainer actually
+set in your own configuration?
 
 @noindent
-@b{Answer:} Hardly any.  As the maintainer, I set the default of most
-options to what I think is best.  However, the default settings do not
-turn on features which
+@b{Answer:} Not many, beyond custom key bindings.  I set most defaults
+the way that seems best.  However, the default settings do not turn on
+features which:
 
 @itemize @minus
 @item
-are not self-evident (i.e. too magic) when used by an unsuspecting user
+are not self-evident (i.e. too magic) when used by an unsuspecting user.
 @item
-are too intrusive
+are too intrusive.
 @item
-will not work properly on all Emacs installations out there
+will not work properly on all Emacs installations.
 @item
 break with widely used standards.
+@item
+use function or other non-standard keys.
+@item
+are purely personal customizations, like additional key bindings, and
+library names.
 @end itemize
 
-@noindent To see what I mean, here is the @emph{entire} configuration I
-have in my @file{.emacs}:
+@noindent To see what I mean, here is the @emph{entire} configuration
+the old maintainer had in his @file{.emacs}:
 
 @lisp
 (setq idlwave-shell-debug-modifiers '(control shift)
       idlwave-store-inquired-class t
       idlwave-shell-automatic-start t
       idlwave-main-block-indent 2
+      idlwave-init-rinfo-when-idle-after 2
       idlwave-help-dir "~/lib/emacs/idlwave"
       idlwave-special-lib-alist '(("/idl-astro/" . "AstroLib")
                                   ("/jhuapl/" . "JHUAPL-Lib")
@@ -2616,9 +3263,8 @@
 @end lisp
 
 However, if you are an Emacs power-user and want IDLWAVE to work
-completely differently, the options allow you to change almost every
-aspect of it.  Here is an example of a much more extensive configuration
-of IDLWAVE.  To say it again - this is not what I recommend, but the
+completely differently, you can change almost every aspect of it.  Here
+is an example of a much more extensive configuration of IDLWAVE.  The
 user is King!
 
 @example
@@ -2639,40 +3285,55 @@
 (setq idlwave-hang-indent-regexp ": ")  ; Change from "- " for auto-fill
 (setq idlwave-show-block nil)           ; Turn off blinking to begin
 (setq idlwave-abbrev-move t)            ; Allow abbrevs to move point
+(setq idlwave-query-class '((method-default . nil) ; No query for method
+                            (keyword-default . nil); or keyword completion
+                            ("INIT" . t)           ; except for these
+                            ("CLEANUP" . t)
+                            ("SETPROPERTY" .t)
+                            ("GETPROPERTY" .t)))
 
 ;; Some setting can only be done from a mode hook.  Here is an example:
-
 (add-hook 'idlwave-mode-hook
   (lambda ()
-    (setq abbrev-mode 1)                 ; Turn on abbrevs (-1 for off)
     (setq case-fold-search nil)          ; Make searches case sensitive
     ;; Run other functions here
     (font-lock-mode 1)                   ; Turn on font-lock mode
     (idlwave-auto-fill-mode 0)           ; Turn off auto filling
-    ;;
-    ;; Pad with 1 space (if -n is used then make the
+
+    ;; Pad with with 1 space (if -n is used then make the
     ;; padding a minimum of n spaces.)  The defaults use -1
     ;; instead of 1.
     (idlwave-action-and-binding "=" '(idlwave-expand-equal 1 1))
     (idlwave-action-and-binding "<" '(idlwave-surround 1 1))
     (idlwave-action-and-binding ">" '(idlwave-surround 1 1 '(?-)))
     (idlwave-action-and-binding "&" '(idlwave-surround 1 1))
-    ;;
+
     ;; Only pad after comma and with exactly 1 space
     (idlwave-action-and-binding "," '(idlwave-surround nil 1))
     (idlwave-action-and-binding "&" '(idlwave-surround 1 1))
-    ;;
+
     ;; Pad only after `->', remove any space before the arrow
     (idlwave-action-and-binding "->"  '(idlwave-surround 0 -1 nil 2))
-    ;;;
+
     ;; Set some personal bindings
     ;; (In this case, makes `,' have the normal self-insert behavior.)
     (local-set-key "," 'self-insert-command)
+    (local-set-key [f5] 'idlwave-shell-break-here)
+    (local-set-key [f6] 'idlwave-shell-clear-current-bp)
+
     ;; Create a newline, indenting the original and new line.
     ;; A similar function that does _not_ reindent the original
     ;; line is on "\C-j" (The default for emacs programming modes).
     (local-set-key "\n" 'idlwave-newline)
     ;; (local-set-key "\C-j" 'idlwave-newline) ; My preference.
+
+    ;; Some personal abbreviations
+    (define-abbrev idlwave-mode-abbrev-table  
+      (concat idlwave-abbrev-start-char "wb") "widget_base()"
+      (idlwave-keyword-abbrev 1))
+    (define-abbrev idlwave-mode-abbrev-table  
+      (concat idlwave-abbrev-start-char "on") "obj_new()"
+      (idlwave-keyword-abbrev 1))
     ))
 
 ;;; Settings for IDLWAVE SHELL mode
@@ -2683,11 +3344,89 @@
 (setq idlwave-shell-explicit-file-name "wave")
 (setq idlwave-shell-process-name "wave")
 (setq idlwave-shell-use-toolbar nil)           ; No toolbar
+
+;; Most shell interaction settings can be done from the shell-mode-hook.
+(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 
+                                  "print, size(___,/DIMENSIONS)"))
+            (idlwave-shell-define-key-both [f9] (idlwave-shell-examine
+                                       "print, size(___,/DIMENSIONS)"))
+            (idlwave-shell-define-key-both [f10] (idlwave-shell-examine 
+                                        "print,size(___,/TNAME)"))
+            (idlwave-shell-define-key-both [f11] (idlwave-shell-examine
+                                        "help,___,/STRUCTURE"))))
 @end example
 
-@node Index,  , Configuration Examples, Top
+@node Windows and MacOS, Index, 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 which IDLWAVE can interact
+with@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: You must specify path names which on a UNIX can be
+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
+@w{@samp{C:\Program Files\IDLWAVE}} and that IDL is installed in
+@w{@samp{C:\RSI\IDL55}}.
+
+@lisp
+;; 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.
+;; note that the initial "+" expands the path recursively
+(setq idlwave-library-path
+        '("+c:/RSI/IDL55/lib/" "+c:/user/me/idllibs" ))
+
+;; 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")
+
+;; file in which to store the user catalog info
+(setq idlwave-libinfo-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 M-TAB switches among running programs --- use Esc-TAB
+instead.
+@item Other issues as yet unnamed...
+@end itemize
+
+
+@node Index,  , Windows and MacOS, Top
 @unnumbered Index
 @printindex cp
 
 @bye
-