emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/idlwave.el


From: John-David T . Smith
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/idlwave.el
Date: Sun, 03 Jul 2005 21:51:43 -0400

Index: emacs/lisp/progmodes/idlwave.el
diff -c emacs/lisp/progmodes/idlwave.el:3.43 
emacs/lisp/progmodes/idlwave.el:3.44
*** emacs/lisp/progmodes/idlwave.el:3.43        Thu Jun 16 14:54:09 2005
--- emacs/lisp/progmodes/idlwave.el     Mon Jul  4 01:51:23 2005
***************
*** 1,12 ****
  ;; idlwave.el --- IDL editing mode for GNU Emacs
! ;; Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005
! ;;  Free Software Foundation
  
  ;; Authors: J.D. Smith <address@hidden>
  ;;          Carsten Dominik <address@hidden>
  ;;          Chris Chase <address@hidden>
  ;; Maintainer: J.D. Smith <address@hidden>
! ;; Version: 5.5
  ;; Keywords: languages
  
  ;; This file is part of GNU Emacs.
--- 1,12 ----
  ;; idlwave.el --- IDL editing mode for GNU Emacs
! ;; Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005 
! ;;    Free Software Foundation
  
  ;; Authors: J.D. Smith <address@hidden>
  ;;          Carsten Dominik <address@hidden>
  ;;          Chris Chase <address@hidden>
  ;; Maintainer: J.D. Smith <address@hidden>
! ;; Version: 5.7_22
  ;; Keywords: languages
  
  ;; This file is part of GNU Emacs.
***************
*** 28,33 ****
--- 28,35 ----
  
  ;;; Commentary:
  
+ ;; IDLWAVE enables feature-rich development and interaction with IDL.
+ 
  ;; In the remotely distant past, based on pascal.el, though bears
  ;; little resemblance to it now.
  ;;
***************
*** 70,76 ****
  ;; of the documentation is available from the maintainers webpage (see
  ;; SOURCE).
  ;;
! ;;
  ;; ACKNOWLEDGMENTS
  ;; ===============
  ;;
--- 72,78 ----
  ;; of the documentation is available from the maintainers webpage (see
  ;; SOURCE).
  ;;
! ;; 
  ;; ACKNOWLEDGMENTS
  ;; ===============
  ;;
***************
*** 111,117 ****
  ;;   IDLWAVE support for the IDL-derived PV-WAVE CL language of Visual
  ;;   Numerics, Inc. is growing less and less complete as the two
  ;;   languages grow increasingly apart.  The mode probably shouldn't
! ;;   even have "WAVE" in it's title, but it's catchy, and was required
  ;;   to avoid conflict with the CORBA idl.el mode.  Caveat WAVEor.
  ;;
  ;;   Moving the point backwards in conjunction with abbrev expansion
--- 113,119 ----
  ;;   IDLWAVE support for the IDL-derived PV-WAVE CL language of Visual
  ;;   Numerics, Inc. is growing less and less complete as the two
  ;;   languages grow increasingly apart.  The mode probably shouldn't
! ;;   even have "WAVE" in its title, but it's catchy, and was required
  ;;   to avoid conflict with the CORBA idl.el mode.  Caveat WAVEor.
  ;;
  ;;   Moving the point backwards in conjunction with abbrev expansion
***************
*** 120,126 ****
  ;;   up inserting the character that expanded the abbrev after moving
  ;;   point backward, e.g., "\cl" expanded with a space becomes
  ;;   "LONG( )" with point before the close paren.  This is solved by
! ;;   using a temporary function in `post-command-hook' - not pretty,
  ;;   but it works.
  ;;
  ;;   Tabs and spaces are treated equally as whitespace when filling a
--- 122,128 ----
  ;;   up inserting the character that expanded the abbrev after moving
  ;;   point backward, e.g., "\cl" expanded with a space becomes
  ;;   "LONG( )" with point before the close paren.  This is solved by
! ;;   using a temporary function in `post-command-hook' - not pretty, 
  ;;   but it works.
  ;;
  ;;   Tabs and spaces are treated equally as whitespace when filling a
***************
*** 159,164 ****
--- 161,171 ----
  (unless (fboundp 'char-valid-p)
    (defalias 'char-valid-p 'characterp))
  
+ (if (not (fboundp 'cancel-timer))
+     (condition-case nil
+       (require 'timer)
+       (error nil)))
+ 
  (eval-and-compile
    ;; Kludge to allow `defcustom' for Emacs 19.
    (condition-case () (require 'custom) (error nil))
***************
*** 166,178 ****
        nil ;; We've got what we needed
      ;; We have the old or no custom-library, hack around it!
      (defmacro defgroup (&rest args) nil)
!     (defmacro defcustom (var value doc &rest args)
        `(defvar ,var ,value ,doc))))
  
  (defgroup idlwave nil
    "Major mode for editing IDL .pro files"
    :tag "IDLWAVE"
!   :link '(url-link :tag "Home Page"
                   "http://idlwave.org";)
    :link '(emacs-commentary-link :tag "Commentary in idlw-shell.el"
                                "idlw-shell.el")
--- 173,185 ----
        nil ;; We've got what we needed
      ;; We have the old or no custom-library, hack around it!
      (defmacro defgroup (&rest args) nil)
!     (defmacro defcustom (var value doc &rest args) 
        `(defvar ,var ,value ,doc))))
  
  (defgroup idlwave nil
    "Major mode for editing IDL .pro files"
    :tag "IDLWAVE"
!   :link '(url-link :tag "Home Page" 
                   "http://idlwave.org";)
    :link '(emacs-commentary-link :tag "Commentary in idlw-shell.el"
                                "idlw-shell.el")
***************
*** 286,293 ****
  
  (defcustom idlwave-auto-fill-split-string t
    "*If non-nil then auto fill will split strings with the IDL `+' operator.
! When the line end falls within a string, string concatenation with the
! '+' operator will be used to distribute a long string over lines.
  If nil and a string is split then a terminal beep and warning are issued.
  
  This variable is ignored when `idlwave-fill-comment-line-only' is
--- 293,300 ----
  
  (defcustom idlwave-auto-fill-split-string t
    "*If non-nil then auto fill will split strings with the IDL `+' operator.
! When the line end falls within a string, string concatenation with the 
! '+' operator will be used to distribute a long string over lines.  
  If nil and a string is split then a terminal beep and warning are issued.
  
  This variable is ignored when `idlwave-fill-comment-line-only' is
***************
*** 351,357 ****
  Initializing the routine info can take long, in particular if a large
  library catalog is involved.  When Emacs is idle for more than the number
  of seconds specified by this variable, it starts the initialization.
! The process is split into five steps, in order to keep possible work
  interruption as short as possible.  If one of the steps finishes, and no
  user input has arrived in the mean time, initialization proceeds immediately
  to the next step.
--- 358,364 ----
  Initializing the routine info can take long, in particular if a large
  library catalog is involved.  When Emacs is idle for more than the number
  of seconds specified by this variable, it starts the initialization.
! The process is split into five steps, in order to keep possible work 
  interruption as short as possible.  If one of the steps finishes, and no
  user input has arrived in the mean time, initialization proceeds immediately
  to the next step.
***************
*** 403,409 ****
               (const :tag "When saving a buffer" save-buffer)
               (const :tag "After a buffer was killed" kill-buffer)
               (const :tag "After a buffer was compiled successfully, update 
shell info" compile-buffer))))
! 
  (defcustom idlwave-rinfo-max-source-lines 5
    "*Maximum number of source files displayed in the Routine Info window.
  When an integer, it is the maximum number of source files displayed.
--- 410,416 ----
               (const :tag "When saving a buffer" save-buffer)
               (const :tag "After a buffer was killed" kill-buffer)
               (const :tag "After a buffer was compiled successfully, update 
shell info" compile-buffer))))
!              
  (defcustom idlwave-rinfo-max-source-lines 5
    "*Maximum number of source files displayed in the Routine Info window.
  When an integer, it is the maximum number of source files displayed.
***************
*** 436,442 ****
    :group 'idlwave-routine-info
    :type 'directory)
  
! (defcustom idlwave-config-directory
    (convert-standard-filename "~/.idlwave")
    "*Directory for configuration files and user-library catalog."
    :group 'idlwave-routine-info
--- 443,449 ----
    :group 'idlwave-routine-info
    :type 'directory)
  
! (defcustom idlwave-config-directory 
    (convert-standard-filename "~/.idlwave")
    "*Directory for configuration files and user-library catalog."
    :group 'idlwave-routine-info
***************
*** 451,457 ****
  (defcustom idlwave-special-lib-alist nil
    "Alist of regular expressions matching special library directories.
  When listing routine source locations, IDLWAVE gives a short hint where
! the file defining the routine is located.  By default it lists `SystemLib'
  for routines in the system library `!DIR/lib' and `Library' for anything
  else.  This variable can define additional types.  The car of each entry
  is a regular expression matching the file name (they normally will match
--- 458,464 ----
  (defcustom idlwave-special-lib-alist nil
    "Alist of regular expressions matching special library directories.
  When listing routine source locations, IDLWAVE gives a short hint where
! the file defining the routine is located.  By default it lists `SystemLib' 
  for routines in the system library `!DIR/lib' and `Library' for anything
  else.  This variable can define additional types.  The car of each entry
  is a regular expression matching the file name (they normally will match
***************
*** 462,468 ****
          (cons regexp string)))
  
  (defcustom idlwave-auto-write-paths t
!   "Write out path (!PATH) and system directory (!DIR) info automatically.
  Path info is needed to locate library catalog files.  If non-nil,
  whenever the path-list changes as a result of shell-query, etc., it is
  written to file.  Otherwise, the menu option \"Write Paths\" can be
--- 469,475 ----
          (cons regexp string)))
  
  (defcustom idlwave-auto-write-paths t
!   "Write out path (!PATH) and system directory (!DIR) info automatically.  
  Path info is needed to locate library catalog files.  If non-nil,
  whenever the path-list changes as a result of shell-query, etc., it is
  written to file.  Otherwise, the menu option \"Write Paths\" can be
***************
*** 493,499 ****
  This variable determines the case (UPPER/lower/Capitalized...) of
  words inserted into the buffer by completion.  The preferred case can
  be specified separately for routine names, keywords, classes and
! methods.
  This alist should therefore have entries for `routine' (normal
  functions and procedures, i.e. non-methods), `keyword', `class', and
  `method'.  Plausible values are
--- 500,506 ----
  This variable determines the case (UPPER/lower/Capitalized...) of
  words inserted into the buffer by completion.  The preferred case can
  be specified separately for routine names, keywords, classes and
! methods. 
  This alist should therefore have entries for `routine' (normal
  functions and procedures, i.e. non-methods), `keyword', `class', and
  `method'.  Plausible values are
***************
*** 580,586 ****
  for which to assume this can be set here."
    :group 'idlwave-routine-info
    :type '(repeat (regexp :tag "Match method:")))
! 
  
  (defcustom idlwave-completion-show-classes 1
    "*Number of classes to show when completing object methods and keywords.
--- 587,593 ----
  for which to assume this can be set here."
    :group 'idlwave-routine-info
    :type '(repeat (regexp :tag "Match method:")))
!   
  
  (defcustom idlwave-completion-show-classes 1
    "*Number of classes to show when completing object methods and keywords.
***************
*** 645,651 ****
  specify if the class should be found during method and keyword
  completion, respectively.
  
! The alist may have additional entries specifying exceptions from the
  keyword completion rule for specific methods, like INIT or
  GETPROPERTY.  In order to turn on class specification for the INIT
  method, add an entry (\"INIT\" . t).  The method name must be ALL-CAPS."
--- 652,658 ----
  specify if the class should be found during method and keyword
  completion, respectively.
  
! The alist may have additional entries specifying exceptions from the 
  keyword completion rule for specific methods, like INIT or
  GETPROPERTY.  In order to turn on class specification for the INIT
  method, add an entry (\"INIT\" . t).  The method name must be ALL-CAPS."
***************
*** 669,675 ****
  value of the variable `idlwave-query-class'.
  
  When you specify a class, this information can be stored as a text
! property on the `->' arrow in the source code, so that during the same
  editing session, IDLWAVE will not have to ask again.  When this
  variable is non-nil, IDLWAVE will store and reuse the class information.
  The class stored can be checked and removed with `\\[idlwave-routine-info]'
--- 676,682 ----
  value of the variable `idlwave-query-class'.
  
  When you specify a class, this information can be stored as a text
! property on the `->' arrow in the source code, so that during the same 
  editing session, IDLWAVE will not have to ask again.  When this
  variable is non-nil, IDLWAVE will store and reuse the class information.
  The class stored can be checked and removed with `\\[idlwave-routine-info]'
***************
*** 1049,1055 ****
    :group 'idlwave-misc
    :type 'boolean)
  
! (defcustom idlwave-default-font-lock-items
    '(pros-and-functions batch-files idlwave-idl-keywords label goto
                       common-blocks class-arrows)
    "Items which should be fontified on the default fontification level 2.
--- 1056,1062 ----
    :group 'idlwave-misc
    :type 'boolean)
  
! (defcustom idlwave-default-font-lock-items 
    '(pros-and-functions batch-files idlwave-idl-keywords label goto
                       common-blocks class-arrows)
    "Items which should be fontified on the default fontification level 2.
***************
*** 1111,1135 ****
  ;;; and Carsten Dominik...
  
  ;; The following are the reserved words in IDL.  Maybe we should
! ;; highlight some more stuff as well?
  ;; Procedure declarations.  Fontify keyword plus procedure name.
  (defvar idlwave-idl-keywords
!   ;; To update this regexp, update the list of keywords and
    ;; evaluate the form.
!   ;;  (insert
    ;;   (prin1-to-string
!   ;;    (concat
    ;;     "\\<\\("
!   ;;     (regexp-opt
    ;;      '("||" "&&" "and" "or" "xor" "not"
!   ;;        "eq" "ge" "gt" "le" "lt" "ne"
    ;;        "for" "do" "endfor"
!   ;;        "if" "then" "endif" "else" "endelse"
    ;;        "case" "of" "endcase"
    ;;        "switch" "break" "continue" "endswitch"
    ;;        "begin" "end"
    ;;        "repeat" "until" "endrep"
!   ;;        "while" "endwhile"
    ;;        "goto" "return"
    ;;        "inherits" "mod"
    ;;        "compile_opt" "forward_function"
--- 1118,1142 ----
  ;;; and Carsten Dominik...
  
  ;; The following are the reserved words in IDL.  Maybe we should
! ;; highlight some more stuff as well?       
  ;; Procedure declarations.  Fontify keyword plus procedure name.
  (defvar idlwave-idl-keywords
!   ;; To update this regexp, update the list of keywords and 
    ;; evaluate the form.
!   ;;  (insert 
    ;;   (prin1-to-string
!   ;;    (concat 
    ;;     "\\<\\("
!   ;;     (regexp-opt 
    ;;      '("||" "&&" "and" "or" "xor" "not"
!   ;;        "eq" "ge" "gt" "le" "lt" "ne" 
    ;;        "for" "do" "endfor"
!   ;;        "if" "then" "endif" "else" "endelse" 
    ;;        "case" "of" "endcase"
    ;;        "switch" "break" "continue" "endswitch"
    ;;        "begin" "end"
    ;;        "repeat" "until" "endrep"
!   ;;        "while" "endwhile" 
    ;;        "goto" "return"
    ;;        "inherits" "mod"
    ;;        "compile_opt" "forward_function"
***************
*** 1152,1158 ****
          (2 font-lock-reference-face nil t)      ; block name
          (font-lock-match-c++-style-declaration-item-and-skip-to-next
           ;; Start with point after block name and comma
!          (goto-char (match-end 0))  ; needed for XEmacs, could be nil
           nil
           (1 font-lock-variable-name-face)       ; variable names
           )))
--- 1159,1165 ----
          (2 font-lock-reference-face nil t)      ; block name
          (font-lock-match-c++-style-declaration-item-and-skip-to-next
           ;; Start with point after block name and comma
!          (goto-char (match-end 0))  ; needed for XEmacs, could be nil 
           nil
           (1 font-lock-variable-name-face)       ; variable names
           )))
***************
*** 1207,1213 ****
         ;; All operators (not used because too noisy)
         (all-operators
        '("[-*^#+<>/]" (0 font-lock-keyword-face)))
! 
         ;; Arrows with text property `idlwave-class'
         (class-arrows
        '(idlwave-match-class-arrows (0 idlwave-class-arrow-face))))
--- 1214,1220 ----
         ;; All operators (not used because too noisy)
         (all-operators
        '("[-*^#+<>/]" (0 font-lock-keyword-face)))
!       
         ;; Arrows with text property `idlwave-class'
         (class-arrows
        '(idlwave-match-class-arrows (0 idlwave-class-arrow-face))))
***************
*** 1244,1257 ****
  
  (defvar idlwave-font-lock-defaults
    '((idlwave-font-lock-keywords
!      idlwave-font-lock-keywords-1
       idlwave-font-lock-keywords-2
       idlwave-font-lock-keywords-3)
!     nil t
!     ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w"))
      beginning-of-line))
  
! (put 'idlwave-mode 'font-lock-defaults
       idlwave-font-lock-defaults) ; XEmacs
  
  (defconst idlwave-comment-line-start-skip "^[ \t]*;"
--- 1251,1264 ----
  
  (defvar idlwave-font-lock-defaults
    '((idlwave-font-lock-keywords
!      idlwave-font-lock-keywords-1 
       idlwave-font-lock-keywords-2
       idlwave-font-lock-keywords-3)
!     nil t 
!     ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w")) 
      beginning-of-line))
  
! (put 'idlwave-mode 'font-lock-defaults 
       idlwave-font-lock-defaults) ; XEmacs
  
  (defconst idlwave-comment-line-start-skip "^[ \t]*;"
***************
*** 1259,1265 ****
  That is the _beginning_ of a line containing a comment delimiter `;' preceded
  only by whitespace.")
  
! (defconst idlwave-begin-block-reg
    "\\<\\(pro\\|function\\|begin\\|case\\|switch\\)\\>"
    "Regular expression to find the beginning of a block. The case does
  not matter. The search skips matches in comments.")
--- 1266,1272 ----
  That is the _beginning_ of a line containing a comment delimiter `;' preceded
  only by whitespace.")
  
! (defconst idlwave-begin-block-reg 
    "\\<\\(pro\\|function\\|begin\\|case\\|switch\\)\\>"
    "Regular expression to find the beginning of a block. The case does
  not matter. The search skips matches in comments.")
***************
*** 1336,1352 ****
     '(goto . ("goto\\>" nil))
     '(case . ("case\\>" nil))
     '(switch . ("switch\\>" nil))
!    (cons 'call (list (concat "\\(" idlwave-variable "\\) *= *"
                             "\\(" idlwave-method-call "\\s *\\)?"
                             idlwave-identifier
                             "\\s *(") nil))
!    (cons 'call (list (concat
                      "\\(" idlwave-method-call "\\s *\\)?"
!                     idlwave-identifier
                      "\\( *\\($\\|\\$\\)\\|\\s *,\\)") nil))
!    (cons 'assign (list (concat
                        "\\(" idlwave-variable "\\) *=") nil)))
! 
    "Associated list of statement matching regular expressions.
  Each regular expression matches the start of an IDL statement.  The
  first element of each association is a symbol giving the statement
--- 1343,1359 ----
     '(goto . ("goto\\>" nil))
     '(case . ("case\\>" nil))
     '(switch . ("switch\\>" nil))
!    (cons 'call (list (concat "\\(" idlwave-variable "\\) *= *" 
                             "\\(" idlwave-method-call "\\s *\\)?"
                             idlwave-identifier
                             "\\s *(") nil))
!    (cons 'call (list (concat 
                      "\\(" idlwave-method-call "\\s *\\)?"
!                     idlwave-identifier 
                      "\\( *\\($\\|\\$\\)\\|\\s *,\\)") nil))
!    (cons 'assign (list (concat 
                        "\\(" idlwave-variable "\\) *=") nil)))
!   
    "Associated list of statement matching regular expressions.
  Each regular expression matches the start of an IDL statement.  The
  first element of each association is a symbol giving the statement
***************
*** 1369,1375 ****
  ;; Note that this is documented in the v18 manuals as being a string
  ;; of length one rather than a single character.
  ;; The code in this file accepts either format for compatibility.
! (defvar idlwave-comment-indent-char ?\
    "Character to be inserted for IDL comment indentation.
  Normally a space.")
  
--- 1376,1382 ----
  ;; Note that this is documented in the v18 manuals as being a string
  ;; of length one rather than a single character.
  ;; The code in this file accepts either format for compatibility.
! (defvar idlwave-comment-indent-char ?\ 
    "Character to be inserted for IDL comment indentation.
  Normally a space.")
  
***************
*** 1377,1383 ****
    "Character which is inserted as a last character on previous line by
     \\[idlwave-split-line] to begin a continuation line.  Normally $.")
  
! (defconst idlwave-mode-version "5.5")
  
  (defmacro idlwave-keyword-abbrev (&rest args)
    "Creates a function for abbrev hooks to call `idlwave-check-abbrev' with 
args."
--- 1384,1390 ----
    "Character which is inserted as a last character on previous line by
     \\[idlwave-split-line] to begin a continuation line.  Normally $.")
  
! (defconst idlwave-mode-version "5.7_22")
  
  (defmacro idlwave-keyword-abbrev (&rest args)
    "Creates a function for abbrev hooks to call `idlwave-check-abbrev' with 
args."
***************
*** 1484,1495 ****
        ;; Add action
        (let* ((table (if select 'idlwave-indent-action-table
                        'idlwave-indent-expand-table))
!              (cell (assoc key (eval table))))
          (if cell
              ;; Replace action command
              (setcdr cell cmd)
            ;; New action
!           (set table (append (eval table) (list (cons key cmd)))))))
    ;; Make key binding for action
    (if (or (and (null select) (= (length key) 1))
            (equal select 'noaction)
--- 1491,1503 ----
        ;; Add action
        (let* ((table (if select 'idlwave-indent-action-table
                        'idlwave-indent-expand-table))
!            (table-key (regexp-quote key))
!              (cell (assoc table-key (eval table))))
          (if cell
              ;; Replace action command
              (setcdr cell cmd)
            ;; New action
!           (set table (append (eval table) (list (cons table-key cmd)))))))
    ;; Make key binding for action
    (if (or (and (null select) (= (length key) 1))
            (equal select 'noaction)
***************
*** 1516,1522 ****
  (define-key idlwave-mode-map "\C-c{"    'idlwave-beginning-of-block)
  (define-key idlwave-mode-map "\C-c}"    'idlwave-end-of-block)
  (define-key idlwave-mode-map "\C-c]"    'idlwave-close-block)
! (define-key idlwave-mode-map "\M-\C-h"  'idlwave-mark-subprogram)
  (define-key idlwave-mode-map "\M-\C-n"  'idlwave-forward-block)
  (define-key idlwave-mode-map "\M-\C-p"  'idlwave-backward-block)
  (define-key idlwave-mode-map "\M-\C-d"  'idlwave-down-block)
--- 1524,1530 ----
  (define-key idlwave-mode-map "\C-c{"    'idlwave-beginning-of-block)
  (define-key idlwave-mode-map "\C-c}"    'idlwave-end-of-block)
  (define-key idlwave-mode-map "\C-c]"    'idlwave-close-block)
! (define-key idlwave-mode-map [(meta control h)] 'idlwave-mark-subprogram)
  (define-key idlwave-mode-map "\M-\C-n"  'idlwave-forward-block)
  (define-key idlwave-mode-map "\M-\C-p"  'idlwave-backward-block)
  (define-key idlwave-mode-map "\M-\C-d"  'idlwave-down-block)
***************
*** 1540,1554 ****
         (not (equal idlwave-shell-debug-modifiers '())))
    ;; Bind the debug commands also with the special modifiers.
    (let ((shift (memq 'shift idlwave-shell-debug-modifiers))
!       (mods-noshift (delq 'shift
                            (copy-sequence idlwave-shell-debug-modifiers))))
!     (define-key idlwave-mode-map
        (vector (append mods-noshift (list (if shift ?C ?c))))
        'idlwave-shell-save-and-run)
!     (define-key idlwave-mode-map
        (vector (append mods-noshift (list (if shift ?B ?b))))
        'idlwave-shell-break-here)
!     (define-key idlwave-mode-map
        (vector (append mods-noshift (list (if shift ?E ?e))))
        'idlwave-shell-run-region)))
  (define-key idlwave-mode-map "\C-c\C-d\C-c" 'idlwave-shell-save-and-run)
--- 1548,1562 ----
         (not (equal idlwave-shell-debug-modifiers '())))
    ;; Bind the debug commands also with the special modifiers.
    (let ((shift (memq 'shift idlwave-shell-debug-modifiers))
!       (mods-noshift (delq 'shift 
                            (copy-sequence idlwave-shell-debug-modifiers))))
!     (define-key idlwave-mode-map 
        (vector (append mods-noshift (list (if shift ?C ?c))))
        'idlwave-shell-save-and-run)
!     (define-key idlwave-mode-map 
        (vector (append mods-noshift (list (if shift ?B ?b))))
        'idlwave-shell-break-here)
!     (define-key idlwave-mode-map 
        (vector (append mods-noshift (list (if shift ?E ?e))))
        'idlwave-shell-run-region)))
  (define-key idlwave-mode-map "\C-c\C-d\C-c" 'idlwave-shell-save-and-run)
***************
*** 1575,1580 ****
--- 1583,1589 ----
  (autoload 'idlwave-shell-run-region "idlw-shell"
    "Compile and run the region." t)
  (define-key idlwave-mode-map "\C-c\C-v"   'idlwave-find-module)
+ (define-key idlwave-mode-map "\C-c\C-t"   'idlwave-find-module-this-file)
  (define-key idlwave-mode-map "\C-c?"      'idlwave-routine-info)
  (define-key idlwave-mode-map "\M-?"       'idlwave-context-help)
  (define-key idlwave-mode-map [(control meta ?\?)] 'idlwave-online-help)
***************
*** 1584,1590 ****
  (define-key idlwave-mode-map "\M-\C-i" 'idlwave-complete)
  (define-key idlwave-mode-map "\C-c\C-i" 'idlwave-update-routine-info)
  (define-key idlwave-mode-map "\C-c="    'idlwave-resolve)
! (define-key idlwave-mode-map
    (if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)])
    'idlwave-mouse-context-help)
  
--- 1593,1599 ----
  (define-key idlwave-mode-map "\M-\C-i" 'idlwave-complete)
  (define-key idlwave-mode-map "\C-c\C-i" 'idlwave-update-routine-info)
  (define-key idlwave-mode-map "\C-c="    'idlwave-resolve)
! (define-key idlwave-mode-map 
    (if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)])
    'idlwave-mouse-context-help)
  
***************
*** 1595,1601 ****
  ;                                                 (lambda (char) 0)))
  (idlwave-action-and-binding "<"  '(idlwave-surround -1 -1))
  ;; Binding works for both > and ->, by changing the length of the token.
! (idlwave-action-and-binding ">"  '(idlwave-surround -1 -1 '(?-) 1
                                                    'idlwave-gtr-pad-hook))
  (idlwave-action-and-binding "->" '(idlwave-surround -1 -1 nil 2) t)
  (idlwave-action-and-binding ","  '(idlwave-surround 0 -1))
--- 1604,1610 ----
  ;                                                 (lambda (char) 0)))
  (idlwave-action-and-binding "<"  '(idlwave-surround -1 -1))
  ;; Binding works for both > and ->, by changing the length of the token.
! (idlwave-action-and-binding ">"  '(idlwave-surround -1 -1 '(?-) 1 
                                                    'idlwave-gtr-pad-hook))
  (idlwave-action-and-binding "->" '(idlwave-surround -1 -1 nil 2) t)
  (idlwave-action-and-binding ","  '(idlwave-surround 0 -1))
***************
*** 1629,1635 ****
        (error (apply 'define-abbrev args)))))
  
  (condition-case nil
!     (modify-syntax-entry (string-to-char idlwave-abbrev-start-char)
                         "w" idlwave-mode-syntax-table)
    (error nil))
  
--- 1638,1644 ----
        (error (apply 'define-abbrev args)))))
  
  (condition-case nil
!     (modify-syntax-entry (string-to-char idlwave-abbrev-start-char) 
                         "w" idlwave-mode-syntax-table)
    (error nil))
  
***************
*** 1702,1707 ****
--- 1711,1718 ----
  (idlwave-define-abbrev "s"  "size()"       (idlwave-keyword-abbrev 1))
  (idlwave-define-abbrev "wi" "widget_info()" (idlwave-keyword-abbrev 1))
  (idlwave-define-abbrev "wc" "widget_control," (idlwave-keyword-abbrev 0))
+ (idlwave-define-abbrev "pv" "ptr_valid()" (idlwave-keyword-abbrev 1))
+ (idlwave-define-abbrev "ipv" "if ptr_valid() then" (idlwave-keyword-abbrev 6))
  
  ;; This section is reserved words only. (From IDL user manual)
  ;;
***************
*** 1751,1762 ****
  (defvar imenu-extract-index-name-function)
  (defvar imenu-prev-index-position-function)
  ;; defined later - so just make the compiler hush
! (defvar idlwave-mode-menu)
  (defvar idlwave-mode-debug-menu)
  
  ;;;###autoload
  (defun idlwave-mode ()
!   "Major mode for editing IDL source files (version 5.5).
  
  The main features of this mode are
  
--- 1762,1773 ----
  (defvar imenu-extract-index-name-function)
  (defvar imenu-prev-index-position-function)
  ;; defined later - so just make the compiler hush
! (defvar idlwave-mode-menu)  
  (defvar idlwave-mode-debug-menu)
  
  ;;;###autoload
  (defun idlwave-mode ()
!   "Major mode for editing IDL source files (version 5.7_22).
  
  The main features of this mode are
  
***************
*** 1836,1842 ****
     \\i         IF statement template
     \\elif      IF-ELSE statement template
     \\b         BEGIN
! 
     For a full list, use \\[idlwave-list-abbrevs].  Some templates also
     have direct keybindings - see the list of keybindings below.
  
--- 1847,1853 ----
     \\i         IF statement template
     \\elif      IF-ELSE statement template
     \\b         BEGIN
!    
     For a full list, use \\[idlwave-list-abbrevs].  Some templates also
     have direct keybindings - see the list of keybindings below.
  
***************
*** 1878,1903 ****
  
    (interactive)
    (kill-all-local-variables)
! 
    (if idlwave-startup-message
        (message "Emacs IDLWAVE mode version %s." idlwave-mode-version))
    (setq idlwave-startup-message nil)
! 
    (setq local-abbrev-table idlwave-mode-abbrev-table)
    (set-syntax-table idlwave-mode-syntax-table)
! 
    (set (make-local-variable 'indent-line-function) 'idlwave-indent-and-action)
! 
    (make-local-variable idlwave-comment-indent-function)
    (set idlwave-comment-indent-function 'idlwave-comment-hook)
! 
    (set (make-local-variable 'comment-start-skip) ";+[ \t]*")
    (set (make-local-variable 'comment-start) ";")
    (set (make-local-variable 'require-final-newline) 
mode-require-final-newline)
    (set (make-local-variable 'abbrev-all-caps) t)
    (set (make-local-variable 'indent-tabs-mode) nil)
    (set (make-local-variable 'completion-ignore-case) t)
! 
    (use-local-map idlwave-mode-map)
  
    (when (featurep 'easymenu)
--- 1889,1914 ----
  
    (interactive)
    (kill-all-local-variables)
!   
    (if idlwave-startup-message
        (message "Emacs IDLWAVE mode version %s." idlwave-mode-version))
    (setq idlwave-startup-message nil)
!   
    (setq local-abbrev-table idlwave-mode-abbrev-table)
    (set-syntax-table idlwave-mode-syntax-table)
!   
    (set (make-local-variable 'indent-line-function) 'idlwave-indent-and-action)
!   
    (make-local-variable idlwave-comment-indent-function)
    (set idlwave-comment-indent-function 'idlwave-comment-hook)
!   
    (set (make-local-variable 'comment-start-skip) ";+[ \t]*")
    (set (make-local-variable 'comment-start) ";")
    (set (make-local-variable 'require-final-newline) 
mode-require-final-newline)
    (set (make-local-variable 'abbrev-all-caps) t)
    (set (make-local-variable 'indent-tabs-mode) nil)
    (set (make-local-variable 'completion-ignore-case) t)
!   
    (use-local-map idlwave-mode-map)
  
    (when (featurep 'easymenu)
***************
*** 1907,1917 ****
    (setq mode-name "IDLWAVE")
    (setq major-mode 'idlwave-mode)
    (setq abbrev-mode t)
! 
    (set (make-local-variable idlwave-fill-function) 'idlwave-auto-fill)
    (setq comment-end "")
    (set (make-local-variable 'comment-multi-line) nil)
!   (set (make-local-variable 'paragraph-separate)
         "[ \t\f]*$\\|[ \t]*;+[ \t]*$\\|;+[+=-_*]+$")
    (set (make-local-variable 'paragraph-start) "[ \t\f]\\|[ \t]*;+[ \t]")
    (set (make-local-variable 'paragraph-ignore-fill-prefix) nil)
--- 1918,1928 ----
    (setq mode-name "IDLWAVE")
    (setq major-mode 'idlwave-mode)
    (setq abbrev-mode t)
!   
    (set (make-local-variable idlwave-fill-function) 'idlwave-auto-fill)
    (setq comment-end "")
    (set (make-local-variable 'comment-multi-line) nil)
!   (set (make-local-variable 'paragraph-separate) 
         "[ \t\f]*$\\|[ \t]*;+[ \t]*$\\|;+[+=-_*]+$")
    (set (make-local-variable 'paragraph-start) "[ \t\f]\\|[ \t]*;+[ \t]")
    (set (make-local-variable 'paragraph-ignore-fill-prefix) nil)
***************
*** 1920,1926 ****
    ;; Set tag table list to use IDLTAGS as file name.
    (if (boundp 'tag-table-alist)
        (add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS")))
! 
    ;; Font-lock additions - originally Phil Williams, then Ulrik Dickow
    ;; Following line is for Emacs - XEmacs uses the corresponding property
    ;; on the `idlwave-mode' symbol.
--- 1931,1937 ----
    ;; Set tag table list to use IDLTAGS as file name.
    (if (boundp 'tag-table-alist)
        (add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS")))
!   
    ;; Font-lock additions - originally Phil Williams, then Ulrik Dickow
    ;; Following line is for Emacs - XEmacs uses the corresponding property
    ;; on the `idlwave-mode' symbol.
***************
*** 1935,1949 ****
         'idlwave-prev-index-position)
  
    ;; Make a local post-command-hook and add our hook to it
-   ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
-   (make-local-hook 'post-command-hook)
    (add-hook 'post-command-hook 'idlwave-command-hook nil 'local)
  
    ;; Make local hooks for buffer updates
-   ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
-   (make-local-hook 'kill-buffer-hook)
    (add-hook 'kill-buffer-hook 'idlwave-kill-buffer-update nil 'local)
-   (make-local-hook 'after-save-hook)
    (add-hook 'after-save-hook 'idlwave-save-buffer-update nil 'local)
    (add-hook 'after-save-hook 'idlwave-revoke-license-to-kill nil 'local)
  
--- 1946,1955 ----
***************
*** 1961,1978 ****
    (unless idlwave-setup-done
      (if (not (file-directory-p idlwave-config-directory))
        (make-directory idlwave-config-directory))
!     (setq idlwave-user-catalog-file (expand-file-name
!                                    idlwave-user-catalog-file
                                     idlwave-config-directory)
!       idlwave-path-file (expand-file-name
!                          idlwave-path-file
                           idlwave-config-directory))
      (idlwave-read-paths)  ; we may need these early
      (setq idlwave-setup-done t)))
  
  ;;
  ;; Code Formatting ----------------------------------------------------
! ;;
  
  (defun idlwave-push-mark (&rest rest)
    "Push mark for compatibility with Emacs 18/19."
--- 1967,1984 ----
    (unless idlwave-setup-done
      (if (not (file-directory-p idlwave-config-directory))
        (make-directory idlwave-config-directory))
!     (setq idlwave-user-catalog-file (expand-file-name 
!                                    idlwave-user-catalog-file 
                                     idlwave-config-directory)
!       idlwave-path-file (expand-file-name 
!                          idlwave-path-file 
                           idlwave-config-directory))
      (idlwave-read-paths)  ; we may need these early
      (setq idlwave-setup-done t)))
  
  ;;
  ;; Code Formatting ----------------------------------------------------
! ;; 
  
  (defun idlwave-push-mark (&rest rest)
    "Push mark for compatibility with Emacs 18/19."
***************
*** 2121,2127 ****
        (if (> end-pos eol-pos)
            (setq end-pos pos))
        (goto-char end-pos)
!       (setq end (buffer-substring
                   (progn
                     (skip-chars-backward "a-zA-Z")
                     (point))
--- 2127,2133 ----
        (if (> end-pos eol-pos)
            (setq end-pos pos))
        (goto-char end-pos)
!       (setq end (buffer-substring 
                   (progn
                     (skip-chars-backward "a-zA-Z")
                     (point))
***************
*** 2143,2149 ****
            (sit-for 1))
           (t
            (beep)
!           (message "Warning: Shouldn't this be \"%s\" instead of \"%s\"?"
                     end1 end)
            (sit-for 1))))))))
    ;;(delete-char 1))
--- 2149,2155 ----
            (sit-for 1))
           (t
            (beep)
!           (message "Warning: Shouldn't this be \"%s\" instead of \"%s\"?" 
                     end1 end)
            (sit-for 1))))))))
    ;;(delete-char 1))
***************
*** 2155,2162 ****
         ((looking-at "pro\\|case\\|switch\\|function\\>")
        (assoc (downcase (match-string 0)) idlwave-block-matches))
         ((looking-at "begin\\>")
!       (let ((limit (save-excursion
!                      (idlwave-beginning-of-statement)
                       (point))))
          (cond
           ((re-search-backward ":[ \t]*\\=" limit t)
--- 2161,2168 ----
         ((looking-at "pro\\|case\\|switch\\|function\\>")
        (assoc (downcase (match-string 0)) idlwave-block-matches))
         ((looking-at "begin\\>")
!       (let ((limit (save-excursion 
!                      (idlwave-beginning-of-statement) 
                       (point))))
          (cond
           ((re-search-backward ":[ \t]*\\=" limit t)
***************
*** 2184,2192 ****
      (insert "end")
      (idlwave-show-begin)))
  
! (defun idlwave-gtr-pad-hook (char)
    "Let the > symbol expand around -> if present.  The new token length
! is returned."
    2)
  
  (defun idlwave-surround (&optional before after escape-chars length ec-hook)
--- 2190,2198 ----
      (insert "end")
      (idlwave-show-begin)))
  
! (defun idlwave-gtr-pad-hook (char) 
    "Let the > symbol expand around -> if present.  The new token length
! is returned."  
    2)
  
  (defun idlwave-surround (&optional before after escape-chars length ec-hook)
***************
*** 2216,2223 ****
      (let* ((length (or length 1)) ; establish a default for LENGTH
           (prev-char (char-after (- (point) (1+ length)))))
        (when (or (not (memq prev-char escape-chars))
!               (and (fboundp ec-hook)
!                    (setq length
                           (save-excursion (funcall ec-hook prev-char)))))
        (backward-char length)
        (save-restriction
--- 2222,2229 ----
      (let* ((length (or length 1)) ; establish a default for LENGTH
           (prev-char (char-after (- (point) (1+ length)))))
        (when (or (not (memq prev-char escape-chars))
!               (and (fboundp ec-hook) 
!                    (setq length 
                           (save-excursion (funcall ec-hook prev-char)))))
        (backward-char length)
        (save-restriction
***************
*** 2439,2445 ****
          (let ((eos (save-excursion
                       (idlwave-block-jump-out -1 'nomark)
                       (point))))
!           (if (setq status (idlwave-find-key
                            idlwave-end-block-reg -1 'nomark eos))
                (idlwave-beginning-of-statement)
              (message "No nested block before beginning of containing 
block.")))
--- 2445,2451 ----
          (let ((eos (save-excursion
                       (idlwave-block-jump-out -1 'nomark)
                       (point))))
!           (if (setq status (idlwave-find-key 
                            idlwave-end-block-reg -1 'nomark eos))
                (idlwave-beginning-of-statement)
              (message "No nested block before beginning of containing 
block.")))
***************
*** 2447,2453 ****
        (let ((eos (save-excursion
                     (idlwave-block-jump-out 1 'nomark)
                     (point))))
!         (if (setq status (idlwave-find-key
                          idlwave-begin-block-reg 1 'nomark eos))
              (idlwave-end-of-statement)
            (message "No nested block before end of containing block."))))
--- 2453,2459 ----
        (let ((eos (save-excursion
                     (idlwave-block-jump-out 1 'nomark)
                     (point))))
!         (if (setq status (idlwave-find-key 
                          idlwave-begin-block-reg 1 'nomark eos))
              (idlwave-end-of-statement)
            (message "No nested block before end of containing block."))))
***************
*** 2461,2467 ****
          (here (point)))
      (goto-char (point-max))
      (if (re-search-backward idlwave-doclib-start nil t)
!         (progn
          (setq beg (progn (beginning-of-line) (point)))
          (if (re-search-forward idlwave-doclib-end nil t)
              (progn
--- 2467,2473 ----
          (here (point)))
      (goto-char (point-max))
      (if (re-search-backward idlwave-doclib-start nil t)
!         (progn 
          (setq beg (progn (beginning-of-line) (point)))
          (if (re-search-forward idlwave-doclib-end nil t)
              (progn
***************
*** 2495,2501 ****
     ((eq major-mode 'idlwave-shell-mode)
      (if (re-search-backward idlwave-shell-prompt-pattern nil t)
        (goto-char (match-end 0))))
!    (t
      (if (save-excursion (forward-line -1) (idlwave-is-continuation-line))
        (idlwave-previous-statement)
        (beginning-of-line)))))
--- 2501,2507 ----
     ((eq major-mode 'idlwave-shell-mode)
      (if (re-search-backward idlwave-shell-prompt-pattern nil t)
        (goto-char (match-end 0))))
!    (t 
      (if (save-excursion (forward-line -1) (idlwave-is-continuation-line))
        (idlwave-previous-statement)
        (beginning-of-line)))))
***************
*** 2572,2578 ****
    (let ((save-point (point)))
      (when (re-search-forward ".*&" lim t)
        (goto-char (match-end 0))
!       (if (idlwave-quoted)
          (goto-char save-point)
        (if (eq (char-after (- (point) 2)) ?&) (goto-char save-point))))
      (point)))
--- 2578,2584 ----
    (let ((save-point (point)))
      (when (re-search-forward ".*&" lim t)
        (goto-char (match-end 0))
!       (if (idlwave-quoted) 
          (goto-char save-point)
        (if (eq (char-after (- (point) 2)) ?&) (goto-char save-point))))
      (point)))
***************
*** 2589,2595 ****
    ;; - not in parenthesis (like a[0:3])
    ;; - not followed by another ":" in explicit class, ala a->b::c
    ;; As many in this mode, this function is heuristic and not an exact
!   ;; parser.
    (let* ((start (point))
         (eos (save-excursion (idlwave-end-of-statement) (point)))
         (end (idlwave-find-key ":" 1 'nomark eos)))
--- 2595,2601 ----
    ;; - not in parenthesis (like a[0:3])
    ;; - not followed by another ":" in explicit class, ala a->b::c
    ;; As many in this mode, this function is heuristic and not an exact
!   ;; parser. 
    (let* ((start (point))
         (eos (save-excursion (idlwave-end-of-statement) (point)))
         (end (idlwave-find-key ":" 1 'nomark eos)))
***************
*** 2666,2672 ****
  `idlwave-pad-keyword' is t then keyword assignment is treated just
  like assignment statements.  When nil, spaces are removed for keyword
  assignment.  Any other value keeps the current space around the `='.
! Limits in for loops are treated as keyword assignment.
  
  Starting with IDL 6.0, a number of op= assignments are available.
  Since ambiguities of the form:
--- 2672,2678 ----
  `idlwave-pad-keyword' is t then keyword assignment is treated just
  like assignment statements.  When nil, spaces are removed for keyword
  assignment.  Any other value keeps the current space around the `='.
! Limits in for loops are treated as keyword assignment.  
  
  Starting with IDL 6.0, a number of op= assignments are available.
  Since ambiguities of the form:
***************
*** 2681,2705 ****
  
  See `idlwave-surround'."
    (if idlwave-surround-by-blank
!       (let
          ((non-an-ops "\\(##\\|\\*\\|\\+\\|-\\|/\\|<\\|>\\|\\^\\)\\=")
!          (an-ops
            "\\s-\\(AND\\|EQ\\|GE\\|GT\\|LE\\|LT\\|MOD\\|NE\\|OR\\|XOR\\)\\=")
           (len 1))
! 
!       (save-excursion
          (let ((case-fold-search t))
            (backward-char)
!           (if (or
                 (re-search-backward non-an-ops nil t)
                 ;; Why doesn't ##? work for both?
!                (re-search-backward "\\(#\\)\\=" nil t))
                (setq len (1+ (length (match-string 1))))
              (when (re-search-backward an-ops nil t)
!               (setq begin nil) ; won't modify begin
                (setq len (1+ (length (match-string 1))))))))
! 
!       (if (eq t idlwave-pad-keyword)
            ;; Everything gets padded equally
            (idlwave-surround before after nil len)
          ;; Treating keywords/for variables specially...
--- 2687,2711 ----
  
  See `idlwave-surround'."
    (if idlwave-surround-by-blank
!       (let 
          ((non-an-ops "\\(##\\|\\*\\|\\+\\|-\\|/\\|<\\|>\\|\\^\\)\\=")
!          (an-ops 
            "\\s-\\(AND\\|EQ\\|GE\\|GT\\|LE\\|LT\\|MOD\\|NE\\|OR\\|XOR\\)\\=")
           (len 1))
!       
!       (save-excursion 
          (let ((case-fold-search t))
            (backward-char)
!           (if (or 
                 (re-search-backward non-an-ops nil t)
                 ;; Why doesn't ##? work for both?
!                (re-search-backward "\\(#\\)\\=" nil t)) 
                (setq len (1+ (length (match-string 1))))
              (when (re-search-backward an-ops nil t)
!               ;(setq begin nil) ; won't modify begin
                (setq len (1+ (length (match-string 1))))))))
!       
!       (if (eq t idlwave-pad-keyword)  
            ;; Everything gets padded equally
            (idlwave-surround before after nil len)
          ;; Treating keywords/for variables specially...
***************
*** 2710,2731 ****
                        (skip-chars-backward "= \t")
                        (nth 2 (idlwave-where)))))
            (cond ((or (memq what '(function-keyword procedure-keyword))
!                      (memq (caar st) '(for pdef)))
!                  (cond
                    ((null idlwave-pad-keyword)
                     (idlwave-surround 0 0)
                     ) ; remove space
                    (t))) ; leave any spaces alone
                  (t (idlwave-surround before after nil len))))))))
! 
  
  (defun idlwave-indent-and-action (&optional arg)
    "Call `idlwave-indent-line' and do expand actions.
  With prefix ARG non-nil, indent the entire sub-statement."
    (interactive "p")
    (save-excursion
!     (if       (and idlwave-expand-generic-end
!            (re-search-backward "\\<\\(end\\)\\s-*\\="
                                 (max 0 (- (point) 10)) t)
             (looking-at "\\(end\\)\\([ \n\t]\\|\\'\\)"))
        (progn (goto-char (match-end 1))
--- 2716,2737 ----
                        (skip-chars-backward "= \t")
                        (nth 2 (idlwave-where)))))
            (cond ((or (memq what '(function-keyword procedure-keyword))
!                      (memq (caar st) '(for pdef))) 
!                  (cond 
                    ((null idlwave-pad-keyword)
                     (idlwave-surround 0 0)
                     ) ; remove space
                    (t))) ; leave any spaces alone
                  (t (idlwave-surround before after nil len))))))))
!             
  
  (defun idlwave-indent-and-action (&optional arg)
    "Call `idlwave-indent-line' and do expand actions.
  With prefix ARG non-nil, indent the entire sub-statement."
    (interactive "p")
    (save-excursion
!     (if       (and idlwave-expand-generic-end 
!            (re-search-backward "\\<\\(end\\)\\s-*\\=" 
                                 (max 0 (- (point) 10)) t)
             (looking-at "\\(end\\)\\([ \n\t]\\|\\'\\)"))
        (progn (goto-char (match-end 1))
***************
*** 2735,2741 ****
    (when (and (not arg) current-prefix-arg)
      (setq arg current-prefix-arg)
      (setq current-prefix-arg nil))
!   (if arg
        (idlwave-indent-statement)
      (idlwave-indent-line t)))
  
--- 2741,2747 ----
    (when (and (not arg) current-prefix-arg)
      (setq arg current-prefix-arg)
      (setq current-prefix-arg nil))
!   (if arg 
        (idlwave-indent-statement)
      (idlwave-indent-line t)))
  
***************
*** 2868,2874 ****
                (save-excursion
                  (cond
                   ;; Beginning of file
!                  ((prog1
                        (idlwave-previous-statement)
                      (setq beg-prev-pos (point)))
                    0)
--- 2874,2880 ----
                (save-excursion
                  (cond
                   ;; Beginning of file
!                  ((prog1 
                        (idlwave-previous-statement)
                      (setq beg-prev-pos (point)))
                    0)
***************
*** 2878,2884 ****
                       idlwave-main-block-indent))
                   ;; Begin block
                   ((idlwave-look-at idlwave-begin-block-reg t)
!                   (+ (idlwave-min-current-statement-indent)
                       idlwave-block-indent))
                   ;; End Block
                   ((idlwave-look-at idlwave-end-block-reg t)
--- 2884,2890 ----
                       idlwave-main-block-indent))
                   ;; Begin block
                   ((idlwave-look-at idlwave-begin-block-reg t)
!                   (+ (idlwave-min-current-statement-indent) 
                       idlwave-block-indent))
                   ;; End Block
                   ((idlwave-look-at idlwave-end-block-reg t)
***************
*** 2889,2895 ****
                      (idlwave-min-current-statement-indent)))
                      ;;                      idlwave-end-offset
                      ;;                      idlwave-block-indent))
! 
                   ;; Default to current indent
                   ((idlwave-current-statement-indent))))))
            ;; adjust the indentation based on the current statement
--- 2895,2901 ----
                      (idlwave-min-current-statement-indent)))
                      ;;                      idlwave-end-offset
                      ;;                      idlwave-block-indent))
!                  
                   ;; Default to current indent
                   ((idlwave-current-statement-indent))))))
            ;; adjust the indentation based on the current statement
***************
*** 2905,2911 ****
  
  (defun idlwave-calculate-paren-indent (beg-reg end-reg close-exp)
    "Calculate the continuation indent inside a paren group.
! Returns a cons-cell with (open . indent), where open is the
  location of the open paren"
    (let ((open (nth 1 (parse-partial-sexp beg-reg end-reg))))
      ;; Found an innermost open paren.
--- 2911,2917 ----
  
  (defun idlwave-calculate-paren-indent (beg-reg end-reg close-exp)
    "Calculate the continuation indent inside a paren group.
! Returns a cons-cell with (open . indent), where open is the 
  location of the open paren"
    (let ((open (nth 1 (parse-partial-sexp beg-reg end-reg))))
      ;; Found an innermost open paren.
***************
*** 2946,2969 ****
             (end-reg (progn (beginning-of-line) (point)))
           (beg-last-statement (save-excursion (idlwave-previous-statement)
                                               (point)))
!            (beg-reg (progn (idlwave-start-of-substatement 'pre)
                           (if (eq (line-beginning-position) end-reg)
                               (goto-char beg-last-statement)
                             (point))))
           (basic-indent (+ (idlwave-min-current-statement-indent end-reg)
                            idlwave-continuation-indent))
           fancy-nonparen-indent fancy-paren-indent)
!       (cond
         ;; Align then with its matching if, etc.
         ((let ((matchers '(("\\<if\\>" . "[ \t]*then")
                          ("\\<\\(if\\|end\\(if\\)?\\)\\>" . "[ \t]*else")
                          ("\\<\\(for\\|while\\)\\>" . "[ \t]*do")
!                         ("\\<\\(repeat\\|end\\(rep\\)?\\)\\>" .
                           "[ \t]*until")
                          ("\\<case\\>" . "[ \t]*of")))
              match cont-re)
          (goto-char end-reg)
!         (and
           (setq cont-re
                 (catch 'exit
                   (while (setq match (car matchers))
--- 2952,2975 ----
             (end-reg (progn (beginning-of-line) (point)))
           (beg-last-statement (save-excursion (idlwave-previous-statement)
                                               (point)))
!            (beg-reg (progn (idlwave-start-of-substatement 'pre) 
                           (if (eq (line-beginning-position) end-reg)
                               (goto-char beg-last-statement)
                             (point))))
           (basic-indent (+ (idlwave-min-current-statement-indent end-reg)
                            idlwave-continuation-indent))
           fancy-nonparen-indent fancy-paren-indent)
!       (cond 
         ;; Align then with its matching if, etc.
         ((let ((matchers '(("\\<if\\>" . "[ \t]*then")
                          ("\\<\\(if\\|end\\(if\\)?\\)\\>" . "[ \t]*else")
                          ("\\<\\(for\\|while\\)\\>" . "[ \t]*do")
!                         ("\\<\\(repeat\\|end\\(rep\\)?\\)\\>" . 
                           "[ \t]*until")
                          ("\\<case\\>" . "[ \t]*of")))
              match cont-re)
          (goto-char end-reg)
!         (and 
           (setq cont-re
                 (catch 'exit
                   (while (setq match (car matchers))
***************
*** 2972,2978 ****
                     (setq matchers (cdr matchers)))))
           (idlwave-find-key cont-re -1 'nomark beg-last-statement)))
        (if (looking-at "end") ;; that one's special
!           (- (idlwave-current-indent)
               (+ idlwave-block-indent idlwave-end-offset))
          (idlwave-current-indent)))
  
--- 2978,2984 ----
                     (setq matchers (cdr matchers)))))
           (idlwave-find-key cont-re -1 'nomark beg-last-statement)))
        (if (looking-at "end") ;; that one's special
!           (- (idlwave-current-indent) 
               (+ idlwave-block-indent idlwave-end-offset))
          (idlwave-current-indent)))
  
***************
*** 2998,3004 ****
              (let* ((end-reg end-reg)
                    (close-exp (progn
                                 (goto-char end-reg)
!                                (skip-chars-forward " \t")
                                 (looking-at "\\s)")))
                    indent-cons)
                (catch 'loop
--- 3004,3010 ----
              (let* ((end-reg end-reg)
                    (close-exp (progn
                                 (goto-char end-reg)
!                                (skip-chars-forward " \t") 
                                 (looking-at "\\s)")))
                    indent-cons)
                (catch 'loop
***************
*** 3032,3043 ****
                   (if (save-match-data (looking-at "[ \t$]*\\(;.*\\)?$"))
                       nil
                     (current-column)))
! 
                  ;; Continued assignment (with =):
                  ((catch 'assign ;
                     (while (looking-at "[^=\n\r]*\\(=\\)[ \t]*")
                       (goto-char (match-end 0))
!                      (if (null (idlwave-what-function beg-reg))
                           (throw 'assign t))))
                   (unless (or
                            (idlwave-in-quote)
--- 3038,3049 ----
                   (if (save-match-data (looking-at "[ \t$]*\\(;.*\\)?$"))
                       nil
                     (current-column)))
!                 
                  ;; Continued assignment (with =):
                  ((catch 'assign ;
                     (while (looking-at "[^=\n\r]*\\(=\\)[ \t]*")
                       (goto-char (match-end 0))
!                      (if (null (idlwave-what-function beg-reg)) 
                           (throw 'assign t))))
                   (unless (or
                            (idlwave-in-quote)
***************
*** 3099,3105 ****
    (let* ((here (point))
           (case-fold-search t)
           (limit (if (>= dir 0) (point-max) (point-min)))
!          (block-limit (if (>= dir 0)
                          idlwave-begin-block-reg
                        idlwave-end-block-reg))
           found
--- 3105,3111 ----
    (let* ((here (point))
           (case-fold-search t)
           (limit (if (>= dir 0) (point-max) (point-min)))
!          (block-limit (if (>= dir 0) 
                          idlwave-begin-block-reg
                        idlwave-end-block-reg))
           found
***************
*** 3110,3116 ****
                               (idlwave-find-key
                                idlwave-begin-unit-reg dir t limit)
                             (end-of-line)
!                            (idlwave-find-key
                              idlwave-end-unit-reg dir t limit)))
                         limit)))
      (if (>= dir 0) (end-of-line)) ;Make sure we are in current block
--- 3116,3122 ----
                               (idlwave-find-key
                                idlwave-begin-unit-reg dir t limit)
                             (end-of-line)
!                            (idlwave-find-key 
                              idlwave-end-unit-reg dir t limit)))
                         limit)))
      (if (>= dir 0) (end-of-line)) ;Make sure we are in current block
***************
*** 3135,3141 ****
                  (or (null end-reg) (< (point) end-reg)))
        (unless comm-or-empty (setq min (min min (idlwave-current-indent)))))
        (if (or comm-or-empty (and end-reg (>= (point) end-reg)))
!         min
        (min min (idlwave-current-indent))))))
  
  (defun idlwave-current-statement-indent (&optional last-line)
--- 3141,3147 ----
                  (or (null end-reg) (< (point) end-reg)))
        (unless comm-or-empty (setq min (min min (idlwave-current-indent)))))
        (if (or comm-or-empty (and end-reg (>= (point) end-reg)))
!         min 
        (min min (idlwave-current-indent))))))
  
  (defun idlwave-current-statement-indent (&optional last-line)
***************
*** 3161,3170 ****
  Blank or comment-only lines following regular continuation lines (with
  `$') count as continuations too."
    (save-excursion
!     (or
       (idlwave-look-at "\\<\\$")
       (catch 'loop
!        (while (and (looking-at "^[ \t]*\\(;.*\\)?$")
                   (eq (forward-line -1) 0))
         (if (idlwave-look-at "\\<\\$") (throw 'loop t)))))))
  
--- 3167,3176 ----
  Blank or comment-only lines following regular continuation lines (with
  `$') count as continuations too."
    (save-excursion
!     (or 
       (idlwave-look-at "\\<\\$")
       (catch 'loop
!        (while (and (looking-at "^[ \t]*\\(;.*\\)?$") 
                   (eq (forward-line -1) 0))
         (if (idlwave-look-at "\\<\\$") (throw 'loop t)))))))
  
***************
*** 3262,3268 ****
                                            (beginning-of-line) (point))
                                          (point))))
                 "[^;]"))
! 
          ;; Mark the beginning and end of the paragraph
          (goto-char bcl)
          (while (and (looking-at fill-prefix-reg)
--- 3268,3274 ----
                                            (beginning-of-line) (point))
                                          (point))))
                 "[^;]"))
!       
          ;; Mark the beginning and end of the paragraph
          (goto-char bcl)
          (while (and (looking-at fill-prefix-reg)
***************
*** 3326,3332 ****
                        (insert (make-string diff ?\ ))))
                  (forward-line -1))
                )
! 
            ;; No hang. Instead find minimum indentation of paragraph
            ;; after first line.
            ;; For the following while statement, since START is at the
--- 3332,3338 ----
                        (insert (make-string diff ?\ ))))
                  (forward-line -1))
                )
!         
            ;; No hang. Instead find minimum indentation of paragraph
            ;; after first line.
            ;; For the following while statement, since START is at the
***************
*** 3358,3364 ****
                    t)
                   (current-column))
                 indent))
! 
          ;; try to keep point at its original place
          (goto-char here)
  
--- 3364,3370 ----
                    t)
                   (current-column))
                 indent))
!       
          ;; try to keep point at its original place
          (goto-char here)
  
***************
*** 3407,3413 ****
            (current-column)))))
  
  (defun idlwave-auto-fill ()
!   "Called to break lines in auto fill mode.
  Only fills non-comment lines if `idlwave-fill-comment-line-only' is
  non-nil.  Places a continuation character at the end of the line if
  not in a comment.  Splits strings with IDL concatenation operator `+'
--- 3413,3419 ----
            (current-column)))))
  
  (defun idlwave-auto-fill ()
!   "Called to break lines in auto fill mode.  
  Only fills non-comment lines if `idlwave-fill-comment-line-only' is
  non-nil.  Places a continuation character at the end of the line if
  not in a comment.  Splits strings with IDL concatenation operator `+'
***************
*** 3558,3564 ****
    (insert (current-time-string))
    (insert ", " (user-full-name))
    (if (boundp 'user-mail-address)
!       (insert " <" user-mail-address ">")
      (insert " <" (user-login-name) "@" (system-name) ">"))
    ;; Remove extra spaces from line
    (idlwave-fill-paragraph)
--- 3564,3570 ----
    (insert (current-time-string))
    (insert ", " (user-full-name))
    (if (boundp 'user-mail-address)
!       (insert " <" user-mail-address ">") 
      (insert " <" (user-login-name) "@" (system-name) ">"))
    ;; Remove extra spaces from line
    (idlwave-fill-paragraph)
***************
*** 3584,3590 ****
             (setq end (match-end 0)))
        (progn
          (goto-char beg)
!         (if (re-search-forward
               (concat idlwave-doc-modifications-keyword ":")
               end t)
              (end-of-line)
--- 3590,3596 ----
             (setq end (match-end 0)))
        (progn
          (goto-char beg)
!         (if (re-search-forward 
               (concat idlwave-doc-modifications-keyword ":")
               end t)
              (end-of-line)
***************
*** 3682,3688 ****
       (not (idlwave-in-quote))
       (save-excursion
         (forward-char)
!        (re-search-backward (concat "\\(" idlwave-idl-keywords
                                   "\\|[[(*+-/=,^><]\\)\\s-*\\*") limit t)))))
  
  
--- 3688,3694 ----
       (not (idlwave-in-quote))
       (save-excursion
         (forward-char)
!        (re-search-backward (concat "\\(" idlwave-idl-keywords 
                                   "\\|[[(*+-/=,^><]\\)\\s-*\\*") limit t)))))
  
  
***************
*** 3728,3734 ****
          (indent-region beg end nil))
        (if (stringp prompt)
          (message prompt)))))
! 
  (defun idlwave-rw-case (string)
    "Make STRING have the case required by `idlwave-reserved-word-upcase'."
    (if idlwave-reserved-word-upcase
--- 3734,3740 ----
          (indent-region beg end nil))
        (if (stringp prompt)
          (message prompt)))))
!   
  (defun idlwave-rw-case (string)
    "Make STRING have the case required by `idlwave-reserved-word-upcase'."
    (if idlwave-reserved-word-upcase
***************
*** 3746,3752 ****
  (defun idlwave-case ()
    "Build skeleton IDL case statement."
    (interactive)
!   (idlwave-template
     (idlwave-rw-case "case")
     (idlwave-rw-case " of\n\nendcase")
     "Selector expression"))
--- 3752,3758 ----
  (defun idlwave-case ()
    "Build skeleton IDL case statement."
    (interactive)
!   (idlwave-template 
     (idlwave-rw-case "case")
     (idlwave-rw-case " of\n\nendcase")
     "Selector expression"))
***************
*** 3754,3760 ****
  (defun idlwave-switch ()
    "Build skeleton IDL switch statement."
    (interactive)
!   (idlwave-template
     (idlwave-rw-case "switch")
     (idlwave-rw-case " of\n\nendswitch")
     "Selector expression"))
--- 3760,3766 ----
  (defun idlwave-switch ()
    "Build skeleton IDL switch statement."
    (interactive)
!   (idlwave-template 
     (idlwave-rw-case "switch")
     (idlwave-rw-case " of\n\nendswitch")
     "Selector expression"))
***************
*** 3762,3768 ****
  (defun idlwave-for ()
    "Build skeleton for loop statment."
    (interactive)
!   (idlwave-template
     (idlwave-rw-case "for")
     (idlwave-rw-case " do begin\n\nendfor")
     "Loop expression"))
--- 3768,3774 ----
  (defun idlwave-for ()
    "Build skeleton for loop statment."
    (interactive)
!   (idlwave-template 
     (idlwave-rw-case "for")
     (idlwave-rw-case " do begin\n\nendfor")
     "Loop expression"))
***************
*** 3777,3790 ****
  
  (defun idlwave-procedure ()
    (interactive)
!   (idlwave-template
     (idlwave-rw-case "pro")
     (idlwave-rw-case "\n\nreturn\nend")
     "Procedure name"))
  
  (defun idlwave-function ()
    (interactive)
!   (idlwave-template
     (idlwave-rw-case "function")
     (idlwave-rw-case "\n\nreturn\nend")
     "Function name"))
--- 3783,3796 ----
  
  (defun idlwave-procedure ()
    (interactive)
!   (idlwave-template 
     (idlwave-rw-case "pro")
     (idlwave-rw-case "\n\nreturn\nend")
     "Procedure name"))
  
  (defun idlwave-function ()
    (interactive)
!   (idlwave-template 
     (idlwave-rw-case "function")
     (idlwave-rw-case "\n\nreturn\nend")
     "Function name"))
***************
*** 3798,3804 ****
  
  (defun idlwave-while ()
    (interactive)
!   (idlwave-template
     (idlwave-rw-case "while")
     (idlwave-rw-case " do begin\n\nendwhile")
     "Entry condition"))
--- 3804,3810 ----
  
  (defun idlwave-while ()
    (interactive)
!   (idlwave-template 
     (idlwave-rw-case "while")
     (idlwave-rw-case " do begin\n\nendwhile")
     "Entry condition"))
***************
*** 3877,3884 ****
  (defun idlwave-count-outlawed-buffers (tag)
    "How many outlawed buffers have tag TAG?"
    (length (delq nil
!               (mapcar
!                (lambda (x) (eq (cdr x) tag))
                 idlwave-outlawed-buffers))))
  
  (defun idlwave-do-kill-autoloaded-buffers (&rest reasons)
--- 3883,3890 ----
  (defun idlwave-count-outlawed-buffers (tag)
    "How many outlawed buffers have tag TAG?"
    (length (delq nil
!               (mapcar 
!                (lambda (x) (eq (cdr x) tag)) 
                 idlwave-outlawed-buffers))))
  
  (defun idlwave-do-kill-autoloaded-buffers (&rest reasons)
***************
*** 3892,3900 ****
                   (memq (cdr entry) reasons))
               (kill-buffer (car entry))
               (incf cnt)
!              (setq idlwave-outlawed-buffers
                     (delq entry idlwave-outlawed-buffers)))
!       (setq idlwave-outlawed-buffers
              (delq entry idlwave-outlawed-buffers))))
      (message "%d buffer%s killed" cnt (if (= cnt 1) "" "s"))))
  
--- 3898,3906 ----
                   (memq (cdr entry) reasons))
               (kill-buffer (car entry))
               (incf cnt)
!              (setq idlwave-outlawed-buffers 
                     (delq entry idlwave-outlawed-buffers)))
!       (setq idlwave-outlawed-buffers 
              (delq entry idlwave-outlawed-buffers))))
      (message "%d buffer%s killed" cnt (if (= cnt 1) "" "s"))))
  
***************
*** 3906,3912 ****
         (entry (assq buf idlwave-outlawed-buffers)))
      ;; Revoke license
      (if entry
!       (setq idlwave-outlawed-buffers
              (delq entry idlwave-outlawed-buffers)))
      ;; Remove this function from the hook.
      (remove-hook 'after-save-hook 'idlwave-revoke-license-to-kill 'local)))
--- 3912,3918 ----
         (entry (assq buf idlwave-outlawed-buffers)))
      ;; Revoke license
      (if entry
!       (setq idlwave-outlawed-buffers 
              (delq entry idlwave-outlawed-buffers)))
      ;; Remove this function from the hook.
      (remove-hook 'after-save-hook 'idlwave-revoke-license-to-kill 'local)))
***************
*** 3925,3931 ****
  (defun idlwave-expand-lib-file-name (file)
    ;; Find FILE on the scanned lib path and return a buffer visiting it
    ;; This is for, e.g., finding source with no user catalog
!   (cond
     ((null file) nil)
     ((file-name-absolute-p file) file)
     (t (idlwave-locate-lib-file file))))
--- 3931,3937 ----
  (defun idlwave-expand-lib-file-name (file)
    ;; Find FILE on the scanned lib path and return a buffer visiting it
    ;; This is for, e.g., finding source with no user catalog
!   (cond 
     ((null file) nil)
     ((file-name-absolute-p file) file)
     (t (idlwave-locate-lib-file file))))
***************
*** 3940,3946 ****
    (interactive)
    (let (directory directories cmd append status numdirs dir getsubdirs
                  buffer save_buffer files numfiles item errbuf)
! 
      ;;
      ;; Read list of directories
      (setq directory (read-string "Tag Directories: " "."))
--- 3946,3952 ----
    (interactive)
    (let (directory directories cmd append status numdirs dir getsubdirs
                  buffer save_buffer files numfiles item errbuf)
!     
      ;;
      ;; Read list of directories
      (setq directory (read-string "Tag Directories: " "."))
***************
*** 3992,3998 ****
                    (message (concat "Tagging " item "..."))
                    (setq errbuf (get-buffer-create "*idltags-error*"))
                    (setq status (+ status
!                                   (if (eq 0 (call-process
                                               "sh" nil errbuf nil "-c"
                                               (concat cmd append item)))
                                        0
--- 3998,4004 ----
                    (message (concat "Tagging " item "..."))
                    (setq errbuf (get-buffer-create "*idltags-error*"))
                    (setq status (+ status
!                                   (if (eq 0 (call-process 
                                               "sh" nil errbuf nil "-c"
                                               (concat cmd append item)))
                                        0
***************
*** 4006,4018 ****
                  (setq numfiles (1+ numfiles))
                  (setq item (nth numfiles files))
                  )))
! 
            (setq numdirs (1+ numdirs))
            (setq dir (nth numdirs directories)))
        (progn
          (setq numdirs (1+ numdirs))
          (setq dir (nth numdirs directories)))))
! 
      (setq errbuf (get-buffer-create "*idltags-error*"))
      (if (= status 0)
        (kill-buffer errbuf))
--- 4012,4024 ----
                  (setq numfiles (1+ numfiles))
                  (setq item (nth numfiles files))
                  )))
!           
            (setq numdirs (1+ numdirs))
            (setq dir (nth numdirs directories)))
        (progn
          (setq numdirs (1+ numdirs))
          (setq dir (nth numdirs directories)))))
!     
      (setq errbuf (get-buffer-create "*idltags-error*"))
      (if (= status 0)
        (kill-buffer errbuf))
***************
*** 4088,4094 ****
    ;; Make sure the hash functions are accessible.
    (if (or (not (fboundp 'gethash))
          (not (fboundp 'puthash)))
!       (progn
        (require 'cl)
        (or (fboundp 'puthash)
            (defalias 'puthash 'cl-puthash))))
--- 4094,4100 ----
    ;; Make sure the hash functions are accessible.
    (if (or (not (fboundp 'gethash))
          (not (fboundp 'puthash)))
!       (progn 
        (require 'cl)
        (or (fboundp 'puthash)
            (defalias 'puthash 'cl-puthash))))
***************
*** 4107,4113 ****
        ;; Reset the system & library hash
        (loop for entry in entries
        for var = (car entry) for size = (nth 1 entry)
!       do (setcdr (symbol-value var)
                   (make-hash-table ':size size ':test 'equal)))
        (setq idlwave-sint-dirs nil
            idlwave-sint-libnames nil))
--- 4113,4119 ----
        ;; Reset the system & library hash
        (loop for entry in entries
        for var = (car entry) for size = (nth 1 entry)
!       do (setcdr (symbol-value var) 
                   (make-hash-table ':size size ':test 'equal)))
        (setq idlwave-sint-dirs nil
            idlwave-sint-libnames nil))
***************
*** 4117,4123 ****
        ;; Reset the buffer & shell hash
        (loop for entry in entries
        for var = (car entry) for size = (nth 1 entry)
!       do (setcar (symbol-value var)
                   (make-hash-table ':size size ':test 'equal))))))
  
  (defun idlwave-sintern-routine-or-method (name &optional class set)
--- 4123,4129 ----
        ;; Reset the buffer & shell hash
        (loop for entry in entries
        for var = (car entry) for size = (nth 1 entry)
!       do (setcar (symbol-value var) 
                   (make-hash-table ':size size ':test 'equal))))))
  
  (defun idlwave-sintern-routine-or-method (name &optional class set)
***************
*** 4204,4214 ****
            (setq class (idlwave-sintern-class class set))
            (setq name (idlwave-sintern-method name set)))
        (setq name (idlwave-sintern-routine name set)))
! 
        ;; The source
        (let ((source-type (car source))
            (source-file  (nth 1 source))
!           (source-dir  (if default-dir
                             (file-name-as-directory default-dir)
                           (nth 2 source)))
            (source-lib (nth 3 source)))
--- 4210,4220 ----
            (setq class (idlwave-sintern-class class set))
            (setq name (idlwave-sintern-method name set)))
        (setq name (idlwave-sintern-routine name set)))
!       
        ;; The source
        (let ((source-type (car source))
            (source-file  (nth 1 source))
!           (source-dir  (if default-dir  
                             (file-name-as-directory default-dir)
                           (nth 2 source)))
            (source-lib (nth 3 source)))
***************
*** 4217,4223 ****
        (if (stringp source-lib)
            (setq source-lib (idlwave-sintern-libname source-lib set)))
        (setq source (list source-type source-file source-dir source-lib)))
! 
        ;; The keywords
        (setq kwds (mapcar (lambda (x)
                           (idlwave-sintern-keyword-list x set))
--- 4223,4229 ----
        (if (stringp source-lib)
            (setq source-lib (idlwave-sintern-libname source-lib set)))
        (setq source (list source-type source-file source-dir source-lib)))
!       
        ;; The keywords
        (setq kwds (mapcar (lambda (x)
                           (idlwave-sintern-keyword-list x set))
***************
*** 4267,4273 ****
  (defvar idlwave-user-catalog-routines nil
    "Holds the procedure routine-info from the user scan.")
  (defvar idlwave-library-catalog-routines nil
!   "Holds the procedure routine-info from the library catalog files.")
  (defvar idlwave-path-alist nil
    "Alist with !PATH directories and zero or more flags if the dir has
  been scanned in a user catalog ('user) or discovered in a library
--- 4273,4281 ----
  (defvar idlwave-user-catalog-routines nil
    "Holds the procedure routine-info from the user scan.")
  (defvar idlwave-library-catalog-routines nil
!   "Holds the procedure routine-info from the .idlwave_catalog library files.")
! (defvar idlwave-library-catalog-libname nil
!   "Name of library catalog loaded from .idlwave_catalog files.")
  (defvar idlwave-path-alist nil
    "Alist with !PATH directories and zero or more flags if the dir has
  been scanned in a user catalog ('user) or discovered in a library
***************
*** 4355,4364 ****
                     "-l" (expand-file-name "~/.emacs")
                     "-l" "idlwave"
                     "-f" "idlwave-rescan-catalog-directories"))
!        (process (apply 'start-process "idlcat"
                         nil emacs args)))
      (setq idlwave-catalog-process process)
!     (set-process-sentinel
       process
       (lambda (pro why)
         (when (string-match "finished" why)
--- 4363,4372 ----
                     "-l" (expand-file-name "~/.emacs")
                     "-l" "idlwave"
                     "-f" "idlwave-rescan-catalog-directories"))
!        (process (apply 'start-process "idlcat" 
                         nil emacs args)))
      (setq idlwave-catalog-process process)
!     (set-process-sentinel 
       process
       (lambda (pro why)
         (when (string-match "finished" why)
***************
*** 4384,4389 ****
--- 4392,4399 ----
  
  
  (defvar idlwave-load-rinfo-idle-timer)
+ (defvar idlwave-shell-path-query)
+ 
  (defun idlwave-update-routine-info (&optional arg no-concatenate)
    "Update the internal routine-info lists.
  These lists are used by `idlwave-routine-info' (\\[idlwave-routine-info])
***************
*** 4431,4437 ****
           ;; The override-idle means, even if the idle timer has done some
           ;; preparing work, load and renormalize everything anyway.
           (override-idle (or arg idlwave-buffer-case-takes-precedence)))
! 
        (setq idlwave-buffer-routines nil
            idlwave-compiled-routines nil
            idlwave-unresolved-routines nil)
--- 4441,4447 ----
           ;; The override-idle means, even if the idle timer has done some
           ;; preparing work, load and renormalize everything anyway.
           (override-idle (or arg idlwave-buffer-case-takes-precedence)))
!       
        (setq idlwave-buffer-routines nil
            idlwave-compiled-routines nil
            idlwave-unresolved-routines nil)
***************
*** 4442,4448 ****
        (idlwave-reset-sintern (cond (load t)
                                     ((null idlwave-system-routines) t)
                                     (t 'bufsh))))
! 
        (if idlwave-buffer-case-takes-precedence
          ;; We can safely scan the buffer stuff first
          (progn
--- 4452,4458 ----
        (idlwave-reset-sintern (cond (load t)
                                     ((null idlwave-system-routines) t)
                                     (t 'bufsh))))
!       
        (if idlwave-buffer-case-takes-precedence
          ;; We can safely scan the buffer stuff first
          (progn
***************
*** 4457,4465 ****
                                    (idlwave-shell-is-running)))
             (ask-shell (and shell-is-running
                             idlwave-query-shell-for-routine-info)))
! 
        ;; Load the library catalogs again, first re-scanning the path
!       (when arg
          (if shell-is-running
              (idlwave-shell-send-command idlwave-shell-path-query
                                          '(progn
--- 4467,4475 ----
                                    (idlwave-shell-is-running)))
             (ask-shell (and shell-is-running
                             idlwave-query-shell-for-routine-info)))
!       
        ;; Load the library catalogs again, first re-scanning the path
!       (when arg 
          (if shell-is-running
              (idlwave-shell-send-command idlwave-shell-path-query
                                          '(progn
***************
*** 4479,4485 ****
            ;;    Therefore, we do a concatenation now, even though
            ;;    the shell might do it again.
            (idlwave-concatenate-rinfo-lists nil 'run-hooks))
! 
        (when ask-shell
          ;; Ask the shell about the routines it knows of.
          (message "Querying the shell")
--- 4489,4495 ----
            ;;    Therefore, we do a concatenation now, even though
            ;;    the shell might do it again.
            (idlwave-concatenate-rinfo-lists nil 'run-hooks))
!       
        (when ask-shell
          ;; Ask the shell about the routines it knows of.
          (message "Querying the shell")
***************
*** 4508,4513 ****
--- 4518,4525 ----
                   nil 'idlwave-load-rinfo-next-step)))
        (error nil))))
  
+ (defvar idlwave-library-routines nil "Obsolete variable.")
+ 
  (defun idlwave-load-rinfo-next-step ()
    (let ((inhibit-quit t)
        (arr idlwave-load-rinfo-steps-done))
***************
*** 4541,4547 ****
                  (progn
                    (setq idlwave-library-routines nil)
                    (ding)
!                   (message "Outdated user catalog: %s... recreate"
                             idlwave-user-catalog-file))
                (message "Loading user catalog in idle time...done"))
              (aset arr 2 t)
--- 4553,4559 ----
                  (progn
                    (setq idlwave-library-routines nil)
                    (ding)
!                   (message "Outdated user catalog: %s... recreate" 
                             idlwave-user-catalog-file))
                (message "Loading user catalog in idle time...done"))
              (aset arr 2 t)
***************
*** 4549,4563 ****
          (when (not (aref arr 3))
            (when idlwave-user-catalog-routines
              (message "Normalizing user catalog routines in idle time...")
!             (setq idlwave-user-catalog-routines
                    (idlwave-sintern-rinfo-list
                     idlwave-user-catalog-routines 'sys))
!             (message
               "Normalizing user catalog routines in idle time...done"))
            (aset arr 3 t)
            (throw 'exit t))
          (when (not (aref arr 4))
!           (idlwave-scan-library-catalogs
             "Loading and normalizing library catalogs in idle time...")
            (aset arr 4 t)
            (throw 'exit t))
--- 4561,4575 ----
          (when (not (aref arr 3))
            (when idlwave-user-catalog-routines
              (message "Normalizing user catalog routines in idle time...")
!             (setq idlwave-user-catalog-routines 
                    (idlwave-sintern-rinfo-list
                     idlwave-user-catalog-routines 'sys))
!             (message 
               "Normalizing user catalog routines in idle time...done"))
            (aset arr 3 t)
            (throw 'exit t))
          (when (not (aref arr 4))
!           (idlwave-scan-library-catalogs 
             "Loading and normalizing library catalogs in idle time...")
            (aset arr 4 t)
            (throw 'exit t))
***************
*** 4598,4605 ****
      (setq idlwave-true-path-alist nil)
      (when (or force (not (aref idlwave-load-rinfo-steps-done 3)))
        (message "Normalizing user catalog routines...")
!       (setq idlwave-user-catalog-routines
!           (idlwave-sintern-rinfo-list
             idlwave-user-catalog-routines 'sys))
        (message "Normalizing user catalog routines...done")))
    (when (or force (not (aref idlwave-load-rinfo-steps-done 4)))
--- 4610,4617 ----
      (setq idlwave-true-path-alist nil)
      (when (or force (not (aref idlwave-load-rinfo-steps-done 3)))
        (message "Normalizing user catalog routines...")
!       (setq idlwave-user-catalog-routines 
!           (idlwave-sintern-rinfo-list 
             idlwave-user-catalog-routines 'sys))
        (message "Normalizing user catalog routines...done")))
    (when (or force (not (aref idlwave-load-rinfo-steps-done 4)))
***************
*** 4610,4620 ****
  
  (defun idlwave-update-buffer-routine-info ()
    (let (res)
!     (cond
       ((eq idlwave-scan-all-buffers-for-routine-info t)
        ;; Scan all buffers, current buffer last
        (message "Scanning all buffers...")
!       (setq res (idlwave-get-routine-info-from-buffers
                 (reverse (buffer-list)))))
       ((null idlwave-scan-all-buffers-for-routine-info)
        ;; Don't scan any buffers
--- 4622,4632 ----
  
  (defun idlwave-update-buffer-routine-info ()
    (let (res)
!     (cond 
       ((eq idlwave-scan-all-buffers-for-routine-info t)
        ;; Scan all buffers, current buffer last
        (message "Scanning all buffers...")
!       (setq res (idlwave-get-routine-info-from-buffers 
                 (reverse (buffer-list)))))
       ((null idlwave-scan-all-buffers-for-routine-info)
        ;; Don't scan any buffers
***************
*** 4627,4638 ****
            (setq res (idlwave-get-routine-info-from-buffers
                       (list (current-buffer))))))))
      ;; Put the result into the correct variable
!     (setq idlwave-buffer-routines
          (idlwave-sintern-rinfo-list res 'set))))
  
  (defun idlwave-concatenate-rinfo-lists (&optional quiet run-hook)
    "Put the different sources for routine information together."
!   ;; The sequence here is important because earlier definitions shadow
    ;; later ones.  We assume that if things in the buffers are newer
    ;; then in the shell of the system, they are meant to be different.
    (setcdr idlwave-last-system-routine-info-cons-cell
--- 4639,4650 ----
            (setq res (idlwave-get-routine-info-from-buffers
                       (list (current-buffer))))))))
      ;; Put the result into the correct variable
!     (setq idlwave-buffer-routines 
          (idlwave-sintern-rinfo-list res 'set))))
  
  (defun idlwave-concatenate-rinfo-lists (&optional quiet run-hook)
    "Put the different sources for routine information together."
!   ;; The sequence here is important because earlier definitions shadow 
    ;; later ones.  We assume that if things in the buffers are newer
    ;; then in the shell of the system, they are meant to be different.
    (setcdr idlwave-last-system-routine-info-cons-cell
***************
*** 4644,4650 ****
  
    ;; Give a message with information about the number of routines we have.
    (unless quiet
!     (message
       "Routines Found: buffer(%d) compiled(%d) library(%d) user(%d) system(%d)"
       (length idlwave-buffer-routines)
       (length idlwave-compiled-routines)
--- 4656,4662 ----
  
    ;; Give a message with information about the number of routines we have.
    (unless quiet
!     (message 
       "Routines Found: buffer(%d) compiled(%d) library(%d) user(%d) system(%d)"
       (length idlwave-buffer-routines)
       (length idlwave-compiled-routines)
***************
*** 4662,4668 ****
          (when (and (setq class (nth 2 x))
                     (not (assq class idlwave-class-alist)))
            (push (list class) idlwave-class-alist)))
!       idlwave-class-alist)))
  
  ;; Three functions for the hooks
  (defun idlwave-save-buffer-update ()
--- 4674,4680 ----
          (when (and (setq class (nth 2 x))
                     (not (assq class idlwave-class-alist)))
            (push (list class) idlwave-class-alist)))
!       idlwave-class-alist)))      
  
  ;; Three functions for the hooks
  (defun idlwave-save-buffer-update ()
***************
*** 4695,4701 ****
  
  (defun idlwave-replace-buffer-routine-info (file new)
    "Cut the part from FILE out of `idlwave-buffer-routines' and add NEW."
!   (let ((list idlwave-buffer-routines)
        found)
      (while list
        ;; The following test uses eq to make sure it works correctly
--- 4707,4713 ----
  
  (defun idlwave-replace-buffer-routine-info (file new)
    "Cut the part from FILE out of `idlwave-buffer-routines' and add NEW."
!   (let ((list idlwave-buffer-routines) 
        found)
      (while list
        ;; The following test uses eq to make sure it works correctly
***************
*** 4706,4712 ****
            (setcar list nil)
            (setq found t))
        (if found
!           ;; End of that section reached. Jump.
            (setq list nil)))
        (setq list (cdr list)))
      (setq idlwave-buffer-routines
--- 4718,4724 ----
            (setcar list nil)
            (setq found t))
        (if found
!           ;; End of that section reached. Jump. 
            (setq list nil)))
        (setq list (cdr list)))
      (setq idlwave-buffer-routines
***************
*** 4738,4748 ****
        (save-restriction
        (widen)
        (goto-char (point-min))
!       (while (re-search-forward
                "^[ \t]*\\(pro\\|function\\)[ \t]" nil t)
          (setq string (buffer-substring-no-properties
                        (match-beginning 0)
!                       (progn
                          (idlwave-end-of-statement)
                          (point))))
          (setq entry (idlwave-parse-definition string))
--- 4750,4760 ----
        (save-restriction
        (widen)
        (goto-char (point-min))
!       (while (re-search-forward 
                "^[ \t]*\\(pro\\|function\\)[ \t]" nil t)
          (setq string (buffer-substring-no-properties
                        (match-beginning 0)
!                       (progn 
                          (idlwave-end-of-statement)
                          (point))))
          (setq entry (idlwave-parse-definition string))
***************
*** 4780,4786 ****
        (push (match-string 1 string) args)))
      ;; Normalize and sort.
      (setq args (nreverse args))
!     (setq keywords (sort keywords (lambda (a b)
                                    (string< (downcase a) (downcase b)))))
      ;; Make and return the entry
      ;; We don't know which argument are optional, so this information
--- 4792,4798 ----
        (push (match-string 1 string) args)))
      ;; Normalize and sort.
      (setq args (nreverse args))
!     (setq keywords (sort keywords (lambda (a b) 
                                    (string< (downcase a) (downcase b)))))
      ;; Make and return the entry
      ;; We don't know which argument are optional, so this information
***************
*** 4790,4796 ****
          class
          (cond ((not (boundp 'idlwave-scanning-lib))
                 (list  'buffer (buffer-file-name)))
! ;             ((string= (downcase
  ;                        (file-name-sans-extension
  ;                         (file-name-nondirectory (buffer-file-name))))
  ;                       (downcase name))
--- 4802,4808 ----
          class
          (cond ((not (boundp 'idlwave-scanning-lib))
                 (list  'buffer (buffer-file-name)))
! ;             ((string= (downcase 
  ;                        (file-name-sans-extension
  ;                         (file-name-nondirectory (buffer-file-name))))
  ;                       (downcase name))
***************
*** 4798,4804 ****
  ;             (t (cons 'lib (file-name-nondirectory (buffer-file-name))))
                (t (list 'user (file-name-nondirectory (buffer-file-name))
                         idlwave-scanning-lib-dir "UserLib")))
!         (concat
           (if (string= type "function") "Result = " "")
           (if class "Obj ->[%s::]" "")
           "%s"
--- 4810,4816 ----
  ;             (t (cons 'lib (file-name-nondirectory (buffer-file-name))))
                (t (list 'user (file-name-nondirectory (buffer-file-name))
                         idlwave-scanning-lib-dir "UserLib")))
!         (concat 
           (if (string= type "function") "Result = " "")
           (if class "Obj ->[%s::]" "")
           "%s"
***************
*** 4816,4827 ****
  
  (defun idlwave-sys-dir ()
    "Return the syslib directory, or a dummy that never matches."
!   (if (string= idlwave-system-directory "")
!       "@@@@@@@@"
!     idlwave-system-directory))
  
  
- (defvar idlwave-shell-path-query)
  (defun idlwave-create-user-catalog-file (&optional arg)
    "Scan all files on selected dirs of IDL search path for routine information.
  
--- 4828,4842 ----
  
  (defun idlwave-sys-dir ()
    "Return the syslib directory, or a dummy that never matches."
!   (cond
!    ((and idlwave-system-directory
!        (not (string= idlwave-system-directory "")))
!     idlwave-system-directory)
!    ((getenv "IDL_DIR"))
!    (t "@@@@@@@@")))
! 
  
  
  (defun idlwave-create-user-catalog-file (&optional arg)
    "Scan all files on selected dirs of IDL search path for routine information.
  
***************
*** 4842,4851 ****
               (> (length idlwave-user-catalog-file) 0)
               (file-accessible-directory-p
                (file-name-directory idlwave-user-catalog-file))
!              (not (string= "" (file-name-nondirectory
                                 idlwave-user-catalog-file))))
      (error "`idlwave-user-catalog-file' does not point to a file in an 
accessible directory"))
! 
    (cond
      ;; Rescan the known directories
     ((and arg idlwave-path-alist
--- 4857,4866 ----
               (> (length idlwave-user-catalog-file) 0)
               (file-accessible-directory-p
                (file-name-directory idlwave-user-catalog-file))
!              (not (string= "" (file-name-nondirectory 
                                 idlwave-user-catalog-file))))
      (error "`idlwave-user-catalog-file' does not point to a file in an 
accessible directory"))
!   
    (cond
      ;; Rescan the known directories
     ((and arg idlwave-path-alist
***************
*** 4855,4867 ****
     ;; Expand the directories from library-path and run the widget
     (idlwave-library-path
      (idlwave-display-user-catalog-widget
!      (if idlwave-true-path-alist
         ;; Propagate any flags on the existing path-alist
         (mapcar (lambda (x)
                   (let ((path-entry (assoc (file-truename x)
                                            idlwave-true-path-alist)))
                     (if path-entry
!                        (cons x (cdr path-entry))
                       (list x))))
                 (idlwave-expand-path idlwave-library-path))
         (mapcar 'list (idlwave-expand-path idlwave-library-path)))))
--- 4870,4882 ----
     ;; Expand the directories from library-path and run the widget
     (idlwave-library-path
      (idlwave-display-user-catalog-widget
!      (if idlwave-true-path-alist 
         ;; Propagate any flags on the existing path-alist
         (mapcar (lambda (x)
                   (let ((path-entry (assoc (file-truename x)
                                            idlwave-true-path-alist)))
                     (if path-entry
!                        (cons x (cdr path-entry)) 
                       (list x))))
                 (idlwave-expand-path idlwave-library-path))
         (mapcar 'list (idlwave-expand-path idlwave-library-path)))))
***************
*** 4886,4892 ****
      (idlwave-scan-library-catalogs "Locating library catalogs..." 'no-load)
      (idlwave-display-user-catalog-widget idlwave-path-alist)))
  
! (defconst idlwave-user-catalog-widget-help-string
    "This is the front-end to the creation of the IDLWAVE user catalog.
  Please select the directories on IDL's search path from which you
  would like to extract routine information, to be stored in the file:
--- 4901,4907 ----
      (idlwave-scan-library-catalogs "Locating library catalogs..." 'no-load)
      (idlwave-display-user-catalog-widget idlwave-path-alist)))
  
! (defconst idlwave-user-catalog-widget-help-string 
    "This is the front-end to the creation of the IDLWAVE user catalog.
  Please select the directories on IDL's search path from which you
  would like to extract routine information, to be stored in the file:
***************
*** 4921,4927 ****
    (make-local-variable 'idlwave-widget)
    (widget-insert (format idlwave-user-catalog-widget-help-string
                         idlwave-user-catalog-file))
! 
    (widget-create 'push-button
                 :notify 'idlwave-widget-scan-user-lib-files
                 "Scan & Save")
--- 4936,4942 ----
    (make-local-variable 'idlwave-widget)
    (widget-insert (format idlwave-user-catalog-widget-help-string
                         idlwave-user-catalog-file))
!   
    (widget-create 'push-button
                 :notify 'idlwave-widget-scan-user-lib-files
                 "Scan & Save")
***************
*** 4931,4937 ****
                 "Delete File")
    (widget-insert "  ")
    (widget-create 'push-button
!                :notify
                 '(lambda (&rest ignore)
                    (let ((path-list (widget-get idlwave-widget :path-dirs)))
                      (mapcar (lambda (x)
--- 4946,4952 ----
                 "Delete File")
    (widget-insert "  ")
    (widget-create 'push-button
!                :notify 
                 '(lambda (&rest ignore)
                    (let ((path-list (widget-get idlwave-widget :path-dirs)))
                      (mapcar (lambda (x)
***************
*** 4942,4948 ****
                 "Select All Non-Lib")
    (widget-insert "  ")
    (widget-create 'push-button
!                :notify
                 '(lambda (&rest ignore)
                    (let ((path-list (widget-get idlwave-widget :path-dirs)))
                      (mapcar (lambda (x)
--- 4957,4963 ----
                 "Select All Non-Lib")
    (widget-insert "  ")
    (widget-create 'push-button
!                :notify 
                 '(lambda (&rest ignore)
                    (let ((path-list (widget-get idlwave-widget :path-dirs)))
                      (mapcar (lambda (x)
***************
*** 4958,4975 ****
    (widget-insert "\n\n")
  
    (widget-insert "Select Directories: \n")
! 
    (setq idlwave-widget
        (apply 'widget-create
               'checklist
!              :value  (delq nil (mapcar (lambda (x)
!                                          (if (memq 'user (cdr x))
                                               (car x)))
                                         dirs-list))
               :greedy t
               :tag "List of directories"
!              (mapcar (lambda (x)
!                        (list 'item
                               (if (memq 'lib (cdr x))
                                   (concat "[LIB] " (car x) )
                                 (car x)))) dirs-list)))
--- 4973,4990 ----
    (widget-insert "\n\n")
  
    (widget-insert "Select Directories: \n")
!   
    (setq idlwave-widget
        (apply 'widget-create
               'checklist
!              :value  (delq nil (mapcar (lambda (x) 
!                                          (if (memq 'user (cdr x)) 
                                               (car x)))
                                         dirs-list))
               :greedy t
               :tag "List of directories"
!              (mapcar (lambda (x) 
!                        (list 'item 
                               (if (memq 'lib (cdr x))
                                   (concat "[LIB] " (car x) )
                                 (car x)))) dirs-list)))
***************
*** 4979,4985 ****
    (widget-setup)
    (goto-char (point-min))
    (delete-other-windows))
! 
  (defun idlwave-delete-user-catalog-file (&rest ignore)
    (if (yes-or-no-p
         (format "Delete file %s " idlwave-user-catalog-file))
--- 4994,5000 ----
    (widget-setup)
    (goto-char (point-min))
    (delete-other-windows))
!   
  (defun idlwave-delete-user-catalog-file (&rest ignore)
    (if (yes-or-no-p
         (format "Delete file %s " idlwave-user-catalog-file))
***************
*** 4995,5001 ****
         (this-path-alist path-alist)
         dir-entry)
      (while (setq dir-entry (pop this-path-alist))
!       (if (member
           (if (memq 'lib (cdr dir-entry))
               (concat "[LIB] " (car dir-entry))
             (car dir-entry))
--- 5010,5016 ----
         (this-path-alist path-alist)
         dir-entry)
      (while (setq dir-entry (pop this-path-alist))
!       (if (member 
           (if (memq 'lib (cdr dir-entry))
               (concat "[LIB] " (car dir-entry))
             (car dir-entry))
***************
*** 5092,5098 ****
      ;; Define the variable which knows the value of "!DIR"
      (insert (format "\n(setq idlwave-system-directory \"%s\")\n"
                    idlwave-system-directory))
! 
      ;; Define the variable which contains a list of all scanned directories
      (insert "\n(setq idlwave-path-alist\n    '(")
      (let ((standard-output (current-buffer)))
--- 5107,5113 ----
      ;; Define the variable which knows the value of "!DIR"
      (insert (format "\n(setq idlwave-system-directory \"%s\")\n"
                    idlwave-system-directory))
!   
      ;; Define the variable which contains a list of all scanned directories
      (insert "\n(setq idlwave-path-alist\n    '(")
      (let ((standard-output (current-buffer)))
***************
*** 5132,5138 ****
        (when (file-directory-p dir)
        (setq files (nreverse (directory-files dir t "[^.]")))
        (while (setq file (pop files))
!         (if (file-directory-p file)
              (push (file-name-as-directory file) path)))
        (push dir path1)))
      path1))
--- 5147,5153 ----
        (when (file-directory-p dir)
        (setq files (nreverse (directory-files dir t "[^.]")))
        (while (setq file (pop files))
!         (if (file-directory-p file) 
              (push (file-name-as-directory file) path)))
        (push dir path1)))
      path1))
***************
*** 5140,5147 ****
  
  ;;----- Scanning the library catalogs ------------------
  
  (defun idlwave-scan-library-catalogs (&optional message-base no-load)
!   "Scan for library catalog files (.idlwave_catalog) and ingest.
  
  All directories on `idlwave-path-alist' (or `idlwave-library-path'
  instead, if present) are searched.  Print MESSAGE-BASE along with the
--- 5155,5165 ----
  
  ;;----- Scanning the library catalogs ------------------
  
+ 
+ 
+ 
  (defun idlwave-scan-library-catalogs (&optional message-base no-load)
!   "Scan for library catalog files (.idlwave_catalog) and ingest.  
  
  All directories on `idlwave-path-alist' (or `idlwave-library-path'
  instead, if present) are searched.  Print MESSAGE-BASE along with the
***************
*** 5149,5155 ****
  NO-LOAD is non-nil.  The variable `idlwave-use-library-catalogs' can
  be set to nil to disable library catalog scanning."
    (when idlwave-use-library-catalogs
!     (let ((dirs
           (if idlwave-library-path
               (idlwave-expand-path idlwave-library-path)
             (mapcar 'car idlwave-path-alist)))
--- 5167,5173 ----
  NO-LOAD is non-nil.  The variable `idlwave-use-library-catalogs' can
  be set to nil to disable library catalog scanning."
    (when idlwave-use-library-catalogs
!     (let ((dirs 
           (if idlwave-library-path
               (idlwave-expand-path idlwave-library-path)
             (mapcar 'car idlwave-path-alist)))
***************
*** 5158,5164 ****
        (if message-base (message message-base))
        (while (setq dir (pop dirs))
        (catch 'continue
!         (when (file-readable-p
                 (setq catalog (expand-file-name ".idlwave_catalog" dir)))
            (unless no-load
              (setq idlwave-library-catalog-routines nil)
--- 5176,5182 ----
        (if message-base (message message-base))
        (while (setq dir (pop dirs))
        (catch 'continue
!         (when (file-readable-p 
                 (setq catalog (expand-file-name ".idlwave_catalog" dir)))
            (unless no-load
              (setq idlwave-library-catalog-routines nil)
***************
*** 5166,5185 ****
              (condition-case nil
                  (load catalog t t t)
                (error (throw 'continue t)))
!             (when (and
!                    message-base
!                    (not (string= idlwave-library-catalog-libname
                                   old-libname)))
!               (message (concat message-base
                                 idlwave-library-catalog-libname))
                (setq old-libname idlwave-library-catalog-libname))
              (when idlwave-library-catalog-routines
                (setq all-routines
!                     (append
                       (idlwave-sintern-rinfo-list
                        idlwave-library-catalog-routines 'sys dir)
                       all-routines))))
! 
            ;;  Add a 'lib flag if on path-alist
            (when (and idlwave-path-alist
                       (setq dir-entry (assoc dir idlwave-path-alist)))
--- 5184,5203 ----
              (condition-case nil
                  (load catalog t t t)
                (error (throw 'continue t)))
!             (when (and 
!                    message-base 
!                    (not (string= idlwave-library-catalog-libname 
                                   old-libname)))
!               (message (concat message-base 
                                 idlwave-library-catalog-libname))
                (setq old-libname idlwave-library-catalog-libname))
              (when idlwave-library-catalog-routines
                (setq all-routines
!                     (append 
                       (idlwave-sintern-rinfo-list
                        idlwave-library-catalog-routines 'sys dir)
                       all-routines))))
!           
            ;;  Add a 'lib flag if on path-alist
            (when (and idlwave-path-alist
                       (setq dir-entry (assoc dir idlwave-path-alist)))
***************
*** 5190,5206 ****
  ;;----- Communicating with the Shell -------------------
  
  ;; First, here is the idl program which can be used to query IDL for
! ;; defined routines.
  (defconst idlwave-routine-info.pro
    "
  ;; START OF IDLWAVE SUPPORT ROUTINES
  pro idlwave_print_info_entry,name,func=func,separator=sep
    ;; See if it's an object method
    if name eq '' then return
!   func    = keyword_set(func)
    methsep = strpos(name,'::')
    meth    = methsep ne -1
! 
    ;; Get routine info
    pars   = routine_info(name,/parameters,functions=func)
    source = routine_info(name,/source,functions=func)
--- 5208,5224 ----
  ;;----- Communicating with the Shell -------------------
  
  ;; First, here is the idl program which can be used to query IDL for
! ;; defined routines. 
  (defconst idlwave-routine-info.pro
    "
  ;; START OF IDLWAVE SUPPORT ROUTINES
  pro idlwave_print_info_entry,name,func=func,separator=sep
    ;; See if it's an object method
    if name eq '' then return
!   func    = keyword_set(func) 
    methsep = strpos(name,'::')
    meth    = methsep ne -1
!   
    ;; Get routine info
    pars   = routine_info(name,/parameters,functions=func)
    source = routine_info(name,/source,functions=func)
***************
*** 5208,5219 ****
    nkw    = pars.num_kw_args
    if nargs gt 0 then args = pars.args
    if nkw   gt 0 then kwargs = pars.kw_args
! 
    ;; Trim the class, and make the name
!   if meth then begin
        class = strmid(name,0,methsep)
        name  = strmid(name,methsep+2,strlen(name)-1)
!       if nargs gt 0 then begin
            ;; remove the self argument
            wh = where(args ne 'SELF',nargs)
            if nargs gt 0 then args = args[wh]
--- 5226,5237 ----
    nkw    = pars.num_kw_args
    if nargs gt 0 then args = pars.args
    if nkw   gt 0 then kwargs = pars.kw_args
!   
    ;; Trim the class, and make the name
!   if meth then begin 
        class = strmid(name,0,methsep)
        name  = strmid(name,methsep+2,strlen(name)-1)
!       if nargs gt 0 then begin 
            ;; remove the self argument
            wh = where(args ne 'SELF',nargs)
            if nargs gt 0 then args = args[wh]
***************
*** 5222,5228 ****
        ;; No class, just a normal routine.
        class = \"\"
    endelse
! 
    ;; Calling sequence
    cs = \"\"
    if func then cs = 'Result = '
--- 5240,5246 ----
        ;; No class, just a normal routine.
        class = \"\"
    endelse
!    
    ;; Calling sequence
    cs = \"\"
    if func then cs = 'Result = '
***************
*** 5243,5251 ****
            kwstring = kwstring + ' ' + kwargs[j]
        endfor
    endif
! 
    ret=(['IDLWAVE-PRO','IDLWAVE-FUN'])[func]
! 
    print,ret + ': ' + name + sep + class + sep + source[0].path  $
      + sep + cs + sep + kwstring
  end
--- 5261,5269 ----
            kwstring = kwstring + ' ' + kwargs[j]
        endfor
    endif
!   
    ret=(['IDLWAVE-PRO','IDLWAVE-FUN'])[func]
!   
    print,ret + ': ' + name + sep + class + sep + source[0].path  $
      + sep + cs + sep + kwstring
  end
***************
*** 5285,5291 ****
    if res then print,'IDLWAVE-CLASS-TAGS: '+class+' '+strjoin(tags,' ',/single)
  end
  ;; END OF IDLWAVE SUPPORT ROUTINES
! "
    "The idl programs to get info from the shell.")
  
  (defvar idlwave-idlwave_routine_info-compiled nil
--- 5303,5309 ----
    if res then print,'IDLWAVE-CLASS-TAGS: '+class+' '+strjoin(tags,' ',/single)
  end
  ;; END OF IDLWAVE SUPPORT ROUTINES
! " 
    "The idl programs to get info from the shell.")
  
  (defvar idlwave-idlwave_routine_info-compiled nil
***************
*** 5308,5319 ****
        (erase-buffer)
        (insert idlwave-routine-info.pro)
        (save-buffer 0))
!     (idlwave-shell-send-command
       (concat ".run " idlwave-shell-temp-pro-file)
       nil 'hide wait)
  ;    (message "SENDING SAVE") ; ????????????????????????
      (idlwave-shell-send-command
!      (format 
"save,'idlwave_routine_info','idlwave_print_info_entry','idlwave_get_class_tags','idlwave_get_sysvars',FILE='%s',/ROUTINES"
             (idlwave-shell-temp-file 'rinfo))
       nil 'hide wait))
  
--- 5326,5337 ----
        (erase-buffer)
        (insert idlwave-routine-info.pro)
        (save-buffer 0))
!     (idlwave-shell-send-command 
       (concat ".run " idlwave-shell-temp-pro-file)
       nil 'hide wait)
  ;    (message "SENDING SAVE") ; ????????????????????????
      (idlwave-shell-send-command
!      (format 
"save,'idlwave_routine_info','idlwave_print_info_entry','idlwave_get_class_tags','idlwave_get_sysvars',FILE='%s',/ROUTINES"
 
             (idlwave-shell-temp-file 'rinfo))
       nil 'hide wait))
  
***************
*** 5396,5402 ****
         (completion-regexp-list
          (if (equal arg '(16))
              (list (read-string (concat "Completion Regexp: "))))))
! 
      (if (and module (string-match "::" module))
        (setq class (substring module 0 (match-beginning 0))
              module (substring module (match-end 0))))
--- 5414,5420 ----
         (completion-regexp-list
          (if (equal arg '(16))
              (list (read-string (concat "Completion Regexp: "))))))
!     
      (if (and module (string-match "::" module))
        (setq class (substring module 0 (match-beginning 0))
              module (substring module (match-end 0))))
***************
*** 5417,5423 ****
       ;; Check for any special completion functions
       ((and idlwave-complete-special
           (idlwave-call-special idlwave-complete-special)))
! 
       ((null what)
        (error "Nothing to complete here"))
  
--- 5435,5441 ----
       ;; Check for any special completion functions
       ((and idlwave-complete-special
           (idlwave-call-special idlwave-complete-special)))
!      
       ((null what)
        (error "Nothing to complete here"))
  
***************
*** 5434,5440 ****
                              (idlwave-all-class-inherits class-selector)))
             (isa (concat "procedure" (if class-selector "-method" "")))
             (type-selector 'pro))
!       (setq idlwave-completion-help-info
              (list 'routine nil type-selector class-selector nil 
super-classes))
        (idlwave-complete-in-buffer
         'procedure (if class-selector 'method 'routine)
--- 5452,5458 ----
                              (idlwave-all-class-inherits class-selector)))
             (isa (concat "procedure" (if class-selector "-method" "")))
             (type-selector 'pro))
!       (setq idlwave-completion-help-info 
              (list 'routine nil type-selector class-selector nil 
super-classes))
        (idlwave-complete-in-buffer
         'procedure (if class-selector 'method 'routine)
***************
*** 5442,5449 ****
         (format "Select a %s name%s"
                 isa
                 (if class-selector
!                    (format " (class is %s)"
!                            (if (eq class-selector t)
                                 "unknown" class-selector))
                   ""))
         isa
--- 5460,5467 ----
         (format "Select a %s name%s"
                 isa
                 (if class-selector
!                    (format " (class is %s)" 
!                            (if (eq class-selector t) 
                                 "unknown" class-selector))
                   ""))
         isa
***************
*** 5457,5463 ****
                              (idlwave-all-class-inherits class-selector)))
             (isa (concat "function" (if class-selector "-method" "")))
             (type-selector 'fun))
!       (setq idlwave-completion-help-info
              (list 'routine nil type-selector class-selector nil 
super-classes))
        (idlwave-complete-in-buffer
         'function (if class-selector 'method 'routine)
--- 5475,5481 ----
                              (idlwave-all-class-inherits class-selector)))
             (isa (concat "function" (if class-selector "-method" "")))
             (type-selector 'fun))
!       (setq idlwave-completion-help-info 
              (list 'routine nil type-selector class-selector nil 
super-classes))
        (idlwave-complete-in-buffer
         'function (if class-selector 'method 'routine)
***************
*** 5465,5471 ****
         (format "Select a %s name%s"
                 isa
                 (if class-selector
!                    (format " (class is %s)"
                             (if (eq class-selector t)
                                 "unknown" class-selector))
                   ""))
--- 5483,5489 ----
         (format "Select a %s name%s"
                 isa
                 (if class-selector
!                    (format " (class is %s)" 
                             (if (eq class-selector t)
                                 "unknown" class-selector))
                   ""))
***************
*** 5488,5508 ****
             (isa (format "procedure%s-keyword" (if class "-method" "")))
             (entry (idlwave-best-rinfo-assq
                     name 'pro class (idlwave-routines)))
             (list (idlwave-entry-keywords entry 'do-link)))
        (unless (or entry (eq class t))
          (error "Nothing known about procedure %s"
                 (idlwave-make-full-name class name)))
!       (setq list (idlwave-fix-keywords name 'pro class list super-classes))
        (unless list (error "No keywords available for procedure %s"
!                             (idlwave-make-full-name class name)))
!       (setq idlwave-completion-help-info
              (list 'keyword name type-selector class-selector entry 
super-classes))
        (idlwave-complete-in-buffer
         'keyword 'keyword list nil
         (format "Select keyword for procedure %s%s"
                 (idlwave-make-full-name class name)
                 (if (or (member '("_EXTRA") list)
!                        (member '("_REF_EXTRA") list))
                     " (note _EXTRA)" ""))
         isa
         'idlwave-attach-keyword-classes)))
--- 5506,5528 ----
             (isa (format "procedure%s-keyword" (if class "-method" "")))
             (entry (idlwave-best-rinfo-assq
                     name 'pro class (idlwave-routines)))
+            (system (if entry (eq (car (nth 3 entry)) 'system)))
             (list (idlwave-entry-keywords entry 'do-link)))
        (unless (or entry (eq class t))
          (error "Nothing known about procedure %s"
                 (idlwave-make-full-name class name)))
!       (setq list (idlwave-fix-keywords name 'pro class list 
!                                        super-classes system))
        (unless list (error "No keywords available for procedure %s"
!                           (idlwave-make-full-name class name)))
!       (setq idlwave-completion-help-info 
              (list 'keyword name type-selector class-selector entry 
super-classes))
        (idlwave-complete-in-buffer
         'keyword 'keyword list nil
         (format "Select keyword for procedure %s%s"
                 (idlwave-make-full-name class name)
                 (if (or (member '("_EXTRA") list)
!                        (member '("_REF_EXTRA") list))                  
                     " (note _EXTRA)" ""))
         isa
         'idlwave-attach-keyword-classes)))
***************
*** 5519,5530 ****
             (isa (format "function%s-keyword" (if class "-method" "")))
             (entry (idlwave-best-rinfo-assq
                     name 'fun class (idlwave-routines)))
             (list (idlwave-entry-keywords entry 'do-link))
             msg-name)
        (unless (or entry (eq class t))
          (error "Nothing known about function %s"
                 (idlwave-make-full-name class name)))
!       (setq list (idlwave-fix-keywords name 'fun class list super-classes))
        ;; OBJ_NEW: Messages mention the proper Init method
        (setq msg-name (if (and (null class)
                                (string= (upcase name) "OBJ_NEW"))
--- 5539,5552 ----
             (isa (format "function%s-keyword" (if class "-method" "")))
             (entry (idlwave-best-rinfo-assq
                     name 'fun class (idlwave-routines)))
+            (system (if entry (eq (car (nth 3 entry)) 'system)))
             (list (idlwave-entry-keywords entry 'do-link))
             msg-name)
        (unless (or entry (eq class t))
          (error "Nothing known about function %s"
                 (idlwave-make-full-name class name)))
!       (setq list (idlwave-fix-keywords name 'fun class list 
!                                        super-classes system))
        ;; OBJ_NEW: Messages mention the proper Init method
        (setq msg-name (if (and (null class)
                                (string= (upcase name) "OBJ_NEW"))
***************
*** 5532,5545 ****
                                   "::Init (via OBJ_NEW)")
                         (idlwave-make-full-name class name)))
        (unless list (error "No keywords available for function %s"
!                             msg-name))
!       (setq idlwave-completion-help-info
              (list 'keyword name type-selector class-selector nil 
super-classes))
        (idlwave-complete-in-buffer
         'keyword 'keyword list nil
         (format "Select keyword for function %s%s" msg-name
                 (if (or (member '("_EXTRA") list)
!                        (member '("_REF_EXTRA") list))
                     " (note _EXTRA)" ""))
         isa
         'idlwave-attach-keyword-classes)))
--- 5554,5567 ----
                                   "::Init (via OBJ_NEW)")
                         (idlwave-make-full-name class name)))
        (unless list (error "No keywords available for function %s"
!                           msg-name))
!       (setq idlwave-completion-help-info 
              (list 'keyword name type-selector class-selector nil 
super-classes))
        (idlwave-complete-in-buffer
         'keyword 'keyword list nil
         (format "Select keyword for function %s%s" msg-name
                 (if (or (member '("_EXTRA") list)
!                        (member '("_REF_EXTRA") list))                  
                     " (note _EXTRA)" ""))
         isa
         'idlwave-attach-keyword-classes)))
***************
*** 5577,5586 ****
                      ("class")))
         (module (idlwave-sintern-routine-or-method module class))
         (class (idlwave-sintern-class class))
!        (what (cond
                ((equal what 0)
                 (setq what
!                      (intern (completing-read
                                "Complete what? " what-list nil t))))
                ((integerp what)
                 (setq what (intern (car (nth (1- what) what-list)))))
--- 5599,5608 ----
                      ("class")))
         (module (idlwave-sintern-routine-or-method module class))
         (class (idlwave-sintern-class class))
!        (what (cond 
                ((equal what 0)
                 (setq what
!                      (intern (completing-read 
                                "Complete what? " what-list nil t))))
                ((integerp what)
                 (setq what (intern (car (nth (1- what) what-list)))))
***************
*** 5602,5608 ****
             (super-classes nil)
             (type-selector 'pro)
             (pro (or module
!                     (idlwave-completing-read
                       "Procedure: " (idlwave-routines) 'idlwave-selector))))
        (setq pro (idlwave-sintern-routine pro))
        (list nil-list nil-list 'procedure-keyword
--- 5624,5630 ----
             (super-classes nil)
             (type-selector 'pro)
             (pro (or module
!                     (idlwave-completing-read 
                       "Procedure: " (idlwave-routines) 'idlwave-selector))))
        (setq pro (idlwave-sintern-routine pro))
        (list nil-list nil-list 'procedure-keyword
***************
*** 5616,5622 ****
             (super-classes nil)
             (type-selector 'fun)
             (func (or module
!                      (idlwave-completing-read
                        "Function: " (idlwave-routines) 'idlwave-selector))))
        (setq func (idlwave-sintern-routine func))
        (list nil-list nil-list 'function-keyword
--- 5638,5644 ----
             (super-classes nil)
             (type-selector 'fun)
             (func (or module
!                      (idlwave-completing-read 
                        "Function: " (idlwave-routines) 'idlwave-selector))))
        (setq func (idlwave-sintern-routine func))
        (list nil-list nil-list 'function-keyword
***************
*** 5656,5662 ****
  
       ((eq what 'class)
        (list nil-list nil-list 'class nil-list nil))
! 
       (t (error "Invalid value for WHAT")))))
  
  (defun idlwave-completing-read (&rest args)
--- 5678,5684 ----
  
       ((eq what 'class)
        (list nil-list nil-list 'class nil-list nil))
!      
       (t (error "Invalid value for WHAT")))))
  
  (defun idlwave-completing-read (&rest args)
***************
*** 5679,5685 ****
                    (stringp idlwave-shell-default-directory)
                    (file-directory-p idlwave-shell-default-directory))
               idlwave-shell-default-directory
!            default-directory)))
      (comint-dynamic-complete-filename)))
  
  (defun idlwave-make-full-name (class name)
--- 5701,5707 ----
                    (stringp idlwave-shell-default-directory)
                    (file-directory-p idlwave-shell-default-directory))
               idlwave-shell-default-directory
!            default-directory)))          
      (comint-dynamic-complete-filename)))
  
  (defun idlwave-make-full-name (class name)
***************
*** 5688,5694 ****
  
  (defun idlwave-rinfo-assoc (name type class list)
    "Like `idlwave-rinfo-assq', but sintern strings first."
!   (idlwave-rinfo-assq
     (idlwave-sintern-routine-or-method name class)
     type (idlwave-sintern-class class) list))
  
--- 5710,5716 ----
  
  (defun idlwave-rinfo-assoc (name type class list)
    "Like `idlwave-rinfo-assq', but sintern strings first."
!   (idlwave-rinfo-assq 
     (idlwave-sintern-routine-or-method name class)
     type (idlwave-sintern-class class) list))
  
***************
*** 5712,5718 ****
          (setq classes nil)))
      rtn))
  
! (defun idlwave-best-rinfo-assq (name type class list &optional with-file
                                     keep-system)
    "Like `idlwave-rinfo-assq', but get all twins and sort, then return first.
  If WITH-FILE is passed, find the best rinfo entry with a file
--- 5734,5740 ----
          (setq classes nil)))
      rtn))
  
! (defun idlwave-best-rinfo-assq (name type class list &optional with-file 
                                     keep-system)
    "Like `idlwave-rinfo-assq', but get all twins and sort, then return first.
  If WITH-FILE is passed, find the best rinfo entry with a file
***************
*** 5737,5743 ****
                                    twins)))))
      (car twins)))
  
! (defun idlwave-best-rinfo-assoc (name type class list &optional with-file
                                     keep-system)
    "Like `idlwave-best-rinfo-assq', but sintern strings first."
    (idlwave-best-rinfo-assq
--- 5759,5765 ----
                                    twins)))))
      (car twins)))
  
! (defun idlwave-best-rinfo-assoc (name type class list &optional with-file 
                                     keep-system)
    "Like `idlwave-best-rinfo-assq', but sintern strings first."
    (idlwave-best-rinfo-assq
***************
*** 5828,5834 ****
  Must accept two arguments: `apos' and `info'")
  
  (defun idlwave-determine-class (info type)
!   ;; Determine the class of a routine call.
    ;; INFO is the `cw-list' structure as returned by idlwave-where.
    ;; The second element in this structure is the class.  When nil, we
    ;; return nil.  When t, try to get the class from text properties at
--- 5850,5856 ----
  Must accept two arguments: `apos' and `info'")
  
  (defun idlwave-determine-class (info type)
!   ;; Determine the class of a routine call.  
    ;; INFO is the `cw-list' structure as returned by idlwave-where.
    ;; The second element in this structure is the class.  When nil, we
    ;; return nil.  When t, try to get the class from text properties at
***************
*** 5848,5854 ****
                      (dassoc (cdr dassoc))
                      (t t)))
         (arrow (and apos (string= (buffer-substring apos (+ 2 apos)) "->")))
!        (is-self
          (and arrow
               (save-excursion (goto-char apos)
                               (forward-word -1)
--- 5870,5876 ----
                      (dassoc (cdr dassoc))
                      (t t)))
         (arrow (and apos (string= (buffer-substring apos (+ 2 apos)) "->")))
!        (is-self 
          (and arrow
               (save-excursion (goto-char apos)
                               (forward-word -1)
***************
*** 5869,5887 ****
          (setq class (or (nth 2 (idlwave-current-routine)) class)))
  
        ;; Before prompting, try any special class determination routines
!       (when (and (eq t class)
                 idlwave-determine-class-special
                 (not force-query))
!       (setq special-class
              (idlwave-call-special idlwave-determine-class-special apos))
!       (if special-class
            (setq class (idlwave-sintern-class special-class)
                  store idlwave-store-inquired-class)))
! 
        ;; Prompt for a class, if we need to
        (when (and (eq class t)
                 (or force-query query))
!       (setq class-alist
              (mapcar 'list (idlwave-all-method-classes (car info) type)))
        (setq class
              (idlwave-sintern-class
--- 5891,5909 ----
          (setq class (or (nth 2 (idlwave-current-routine)) class)))
  
        ;; Before prompting, try any special class determination routines
!       (when (and (eq t class) 
                 idlwave-determine-class-special
                 (not force-query))
!       (setq special-class 
              (idlwave-call-special idlwave-determine-class-special apos))
!       (if special-class 
            (setq class (idlwave-sintern-class special-class)
                  store idlwave-store-inquired-class)))
!       
        ;; Prompt for a class, if we need to
        (when (and (eq class t)
                 (or force-query query))
!       (setq class-alist 
              (mapcar 'list (idlwave-all-method-classes (car info) type)))
        (setq class
              (idlwave-sintern-class
***************
*** 5890,5898 ****
                 (error "No classes available with method %s" (car info)))
                ((and (= (length class-alist) 1) (not force-query))
                 (car (car class-alist)))
!               (t
                 (setq store idlwave-store-inquired-class)
!                (idlwave-completing-read
                  (format "Class%s: " (if (stringp (car info))
                                          (format " for %s method %s"
                                                  type (car info))
--- 5912,5920 ----
                 (error "No classes available with method %s" (car info)))
                ((and (= (length class-alist) 1) (not force-query))
                 (car (car class-alist)))
!               (t 
                 (setq store idlwave-store-inquired-class)
!                (idlwave-completing-read 
                  (format "Class%s: " (if (stringp (car info))
                                          (format " for %s method %s"
                                                  type (car info))
***************
*** 5904,5912 ****
        ;; We have a real class here
        (when (and store arrow)
          (condition-case ()
!             (add-text-properties
!              apos (+ apos 2)
!              `(idlwave-class ,class face ,idlwave-class-arrow-face
                               rear-nonsticky t))
            (error nil)))
        (setf (nth 2 info) class))
--- 5926,5934 ----
        ;; We have a real class here
        (when (and store arrow)
          (condition-case ()
!             (add-text-properties 
!              apos (+ apos 2) 
!              `(idlwave-class ,class face ,idlwave-class-arrow-face 
                               rear-nonsticky t))
            (error nil)))
        (setf (nth 2 info) class))
***************
*** 5934,5947 ****
  
  
  (defun idlwave-where ()
!   "Find out where we are.
  The return value is a list with the following stuff:
  \(PRO-LIST FUNC-LIST COMPLETE-WHAT CW-LIST LAST-CHAR)
  
  PRO-LIST       (PRO POINT CLASS ARROW)
  FUNC-LIST      (FUNC POINT CLASS ARROW)
  COMPLETE-WHAT  a symbol indicating what kind of completion makes sense here
! CW-LIST        (PRO-OR-FUNC POINT CLASS ARROW)  Like PRO-LIST, for what can
                 be completed here.
  LAST-CHAR      last relevant character before point (non-white non-comment,
                 not part of current identifier or leading slash).
--- 5956,5969 ----
  
  
  (defun idlwave-where ()
!   "Find out where we are. 
  The return value is a list with the following stuff:
  \(PRO-LIST FUNC-LIST COMPLETE-WHAT CW-LIST LAST-CHAR)
  
  PRO-LIST       (PRO POINT CLASS ARROW)
  FUNC-LIST      (FUNC POINT CLASS ARROW)
  COMPLETE-WHAT  a symbol indicating what kind of completion makes sense here
! CW-LIST        (PRO-OR-FUNC POINT CLASS ARROW)  Like PRO-LIST, for what can 
                 be completed here.
  LAST-CHAR      last relevant character before point (non-white non-comment,
                 not part of current identifier or leading slash).
***************
*** 5953,5959 ****
  CLASS:  What class has the routine (nil=no, t=is method, but class unknown)
  ARROW:  Location of the arrow"
    (idlwave-routines)
!   (let* (;(bos (save-excursion (idlwave-beginning-of-statement) (point)))
           (bos (save-excursion (idlwave-start-of-substatement 'pre) (point)))
         (func-entry (idlwave-what-function bos))
           (func (car func-entry))
--- 5975,5981 ----
  CLASS:  What class has the routine (nil=no, t=is method, but class unknown)
  ARROW:  Location of the arrow"
    (idlwave-routines)
!   (let* (;(bos (save-excursion (idlwave-beginning-of-statement) (point))) 
           (bos (save-excursion (idlwave-start-of-substatement 'pre) (point)))
         (func-entry (idlwave-what-function bos))
           (func (car func-entry))
***************
*** 5975,5982 ****
       ((string-match "\\`[ \t]*\\(pro\\|function\\)[ \t]+[a-zA-Z0-9_]*\\'"
                      match-string)
        (setq cw 'class))
!      ((string-match
!        "\\`[ \t]*\\([a-zA-Z][a-zA-Z0-9$_]*\\)?\\'"
         (if (> pro-point 0)
           (buffer-substring pro-point (point))
         match-string))
--- 5997,6004 ----
       ((string-match "\\`[ \t]*\\(pro\\|function\\)[ \t]+[a-zA-Z0-9_]*\\'"
                      match-string)
        (setq cw 'class))
!      ((string-match 
!        "\\`[ \t]*\\([a-zA-Z][a-zA-Z0-9$_]*\\)?\\'" 
         (if (> pro-point 0)
           (buffer-substring pro-point (point))
         match-string))
***************
*** 5987,5997 ****
        nil)
       ((string-match "OBJ_NEW([ \t]*['\"]\\([a-zA-Z0-9$_]*\\)?\\'"
                    match-string)
!       (setq cw 'class))
       ((string-match "\\<inherits\\s-+\\([a-zA-Z0-9$_]*\\)?\\'"
                    match-string)
!       (setq cw 'class))
!      ((and func
           (> func-point pro-point)
           (= func-level 1)
           (memq last-char '(?\( ?,)))
--- 6009,6019 ----
        nil)
       ((string-match "OBJ_NEW([ \t]*['\"]\\([a-zA-Z0-9$_]*\\)?\\'"
                    match-string)
!       (setq cw 'class))                    
       ((string-match "\\<inherits\\s-+\\([a-zA-Z0-9$_]*\\)?\\'"
                    match-string)
!       (setq cw 'class))                    
!      ((and func 
           (> func-point pro-point)
           (= func-level 1)
           (memq last-char '(?\( ?,)))
***************
*** 6037,6043 ****
    ;;    searches to this point.
  
    (catch 'exit
!     (let (pos
          func-point
          (cnt 0)
          func arrow-start class)
--- 6059,6065 ----
    ;;    searches to this point.
  
    (catch 'exit
!     (let (pos 
          func-point
          (cnt 0)
          func arrow-start class)
***************
*** 6052,6069 ****
             (setq pos (point))
             (incf cnt)
             (when (and (= (following-char) ?\()
!                       (re-search-backward
                         "\\(::\\|\\<\\)\\([a-zA-Z][a-zA-Z0-9$_]*\\)[ \t]*\\="
                         bound t))
               (setq func (match-string 2)
                     func-point (goto-char (match-beginning 2))
                     pos func-point)
!              (if (re-search-backward
                    "->[ \t]*\\(\\([a-zA-Z][a-zA-Z0-9$_]*\\)::\\)?\\=" bound t)
                   (setq arrow-start (copy-marker (match-beginning 0))
                         class (or (match-string 2) t)))
!              (throw
!               'exit
                (list
                 (idlwave-sintern-routine-or-method func class)
                 (idlwave-sintern-class class)
--- 6074,6091 ----
             (setq pos (point))
             (incf cnt)
             (when (and (= (following-char) ?\()
!                       (re-search-backward 
                         "\\(::\\|\\<\\)\\([a-zA-Z][a-zA-Z0-9$_]*\\)[ \t]*\\="
                         bound t))
               (setq func (match-string 2)
                     func-point (goto-char (match-beginning 2))
                     pos func-point)
!              (if (re-search-backward 
                    "->[ \t]*\\(\\([a-zA-Z][a-zA-Z0-9$_]*\\)::\\)?\\=" bound t)
                   (setq arrow-start (copy-marker (match-beginning 0))
                         class (or (match-string 2) t)))
!              (throw 
!               'exit 
                (list
                 (idlwave-sintern-routine-or-method func class)
                 (idlwave-sintern-class class)
***************
*** 6079,6096 ****
    ;;    searches to this point.
    (let ((pos (point)) pro-point
        pro class arrow-start string)
!     (save-excursion
        ;;(idlwave-beginning-of-statement)
        (idlwave-start-of-substatement 'pre)
        (setq string (buffer-substring (point) pos))
!       (if (string-match
           "\\`[ \t]*\\([a-zA-Z][a-zA-Z0-9$_]*\\)[ \t]*\\(,\\|\\'\\)" string)
          (setq pro (match-string 1 string)
                pro-point (+ (point) (match-beginning 1)))
        (if (and (idlwave-skip-object)
                 (setq string (buffer-substring (point) pos))
!                (string-match
!                 "\\`[ \t]*\\(->\\)[ 
\t]*\\(\\([a-zA-Z][a-zA-Z0-9$_]*\\)::\\)?\\([a-zA-Z][a-zA-Z0-9$_]*\\)?[ 
\t]*\\(,\\|\\(\\$\\s *\\(;.*\\)?\\)?$\\)"
                  string))
            (setq pro (if (match-beginning 4)
                          (match-string 4 string))
--- 6101,6118 ----
    ;;    searches to this point.
    (let ((pos (point)) pro-point
        pro class arrow-start string)
!     (save-excursion 
        ;;(idlwave-beginning-of-statement)
        (idlwave-start-of-substatement 'pre)
        (setq string (buffer-substring (point) pos))
!       (if (string-match 
           "\\`[ \t]*\\([a-zA-Z][a-zA-Z0-9$_]*\\)[ \t]*\\(,\\|\\'\\)" string)
          (setq pro (match-string 1 string)
                pro-point (+ (point) (match-beginning 1)))
        (if (and (idlwave-skip-object)
                 (setq string (buffer-substring (point) pos))
!                (string-match 
!                 "\\`[ \t]*\\(->\\)[ 
\t]*\\(\\([a-zA-Z][a-zA-Z0-9$_]*\\)::\\)?\\([a-zA-Z][a-zA-Z0-9$_]*\\)?[ 
\t]*\\(,\\|\\(\\$\\s *\\(;.*\\)?\\)?$\\)" 
                  string))
            (setq pro (if (match-beginning 4)
                          (match-string 4 string))
***************
*** 6134,6140 ****
              (throw 'exit nil))))
        (goto-char pos)
        nil)))
! 
  (defun idlwave-last-valid-char ()
    "Return the last character before point which is not white or a comment
  and also not part of the current identifier.  Since we do this in
--- 6156,6162 ----
              (throw 'exit nil))))
        (goto-char pos)
        nil)))
!   
  (defun idlwave-last-valid-char ()
    "Return the last character before point which is not white or a comment
  and also not part of the current identifier.  Since we do this in
***************
*** 6155,6161 ****
         ((memq (preceding-char) '(?\; ?\$)) (throw 'exit nil))
         ((eq (preceding-char) ?\n)
          (beginning-of-line 0)
!         (if (looking-at "\\([^;\n]*\\)\\$[ \t]*\\(;[^\n]*\\)?\n")
              ;; continuation line
              (goto-char (match-end 1))
            (throw 'exit nil)))
--- 6177,6183 ----
         ((memq (preceding-char) '(?\; ?\$)) (throw 'exit nil))
         ((eq (preceding-char) ?\n)
          (beginning-of-line 0)
!         (if (looking-at "\\([^\n]*\\)\\$[ \t]*\\(;[^\n]*\\)?\n")
              ;; continuation line
              (goto-char (match-end 1))
            (throw 'exit nil)))
***************
*** 6224,6246 ****
       ((or (eq completion t)
          (and (= 1 (length (setq all-completions
                                  (idlwave-uniquify
!                                  (all-completions part list
!                                                   (or special-selector
                                                        selector))))))
               (equal dpart dcompletion)))
        ;; This is already complete
        (idlwave-after-successful-completion type slash beg)
        (message "%s is already the complete %s" part isa)
        nil)
!      (t
        ;; We cannot add something - offer a list.
        (message "Making completion list...")
! 
        (unless idlwave-completion-help-links ; already set somewhere?
        (mapcar (lambda (x)  ; Pass link prop through to highlight-linked
                  (let ((link (get-text-property 0 'link (car x))))
                    (if link
!                       (push (cons (car x) link)
                              idlwave-completion-help-links))))
                list))
        (let* ((list all-completions)
--- 6246,6268 ----
       ((or (eq completion t)
          (and (= 1 (length (setq all-completions
                                  (idlwave-uniquify
!                                  (all-completions part list 
!                                                   (or special-selector 
                                                        selector))))))
               (equal dpart dcompletion)))
        ;; This is already complete
        (idlwave-after-successful-completion type slash beg)
        (message "%s is already the complete %s" part isa)
        nil)
!      (t        
        ;; We cannot add something - offer a list.
        (message "Making completion list...")
!       
        (unless idlwave-completion-help-links ; already set somewhere?
        (mapcar (lambda (x)  ; Pass link prop through to highlight-linked
                  (let ((link (get-text-property 0 'link (car x))))
                    (if link
!                       (push (cons (car x) link) 
                              idlwave-completion-help-links))))
                list))
        (let* ((list all-completions)
***************
*** 6250,6256 ****
  ;          (completion-fixup-function               ; Emacs
  ;           (lambda () (and (eq (preceding-char) ?>)
  ;                           (re-search-backward " <" beg t)))))
! 
        (setq list (sort list (lambda (a b)
                                (string< (downcase a) (downcase b)))))
        (if prepare-display-function
--- 6272,6278 ----
  ;          (completion-fixup-function               ; Emacs
  ;           (lambda () (and (eq (preceding-char) ?>)
  ;                           (re-search-backward " <" beg t)))))
!            
        (setq list (sort list (lambda (a b)
                                (string< (downcase a) (downcase b)))))
        (if prepare-display-function
***************
*** 6260,6266 ****
                     idlwave-complete-empty-string-as-lower-case)
                 (not idlwave-completion-force-default-case))
            (setq list (mapcar (lambda (x)
!                                (if (listp x)
                                     (setcar x (downcase (car x)))
                                   (setq x (downcase x)))
                                 x)
--- 6282,6288 ----
                     idlwave-complete-empty-string-as-lower-case)
                 (not idlwave-completion-force-default-case))
            (setq list (mapcar (lambda (x)
!                                (if (listp x) 
                                     (setcar x (downcase (car x)))
                                   (setq x (downcase x)))
                                 x)
***************
*** 6280,6298 ****
           (re-search-backward "\\<\\(pro\\|function\\)[ \t]+\\="
                               (- (point) 15) t)
           (goto-char (point-min))
!          (re-search-forward
            "^[ \t]*\\(pro\\|function\\)[ \t]+\\([a-zA-Z0-9_]+::\\)" nil t))))
        ;; Yank the full class specification
        (insert (match-string 2))
      ;; Do the completion, using list gathered from `idlwave-routines'
!     (idlwave-complete-in-buffer
!      'class 'class (idlwave-class-alist) nil
       "Select a class" "class"
       '(lambda (list)  ;; Push it to help-links if system help available
        (mapcar (lambda (x)
                  (let* ((entry (idlwave-class-info x))
                         (link (nth 1 (assq 'link entry))))
!                   (if link (push (cons x link)
                                   idlwave-completion-help-links))
                    x))
                list)))))
--- 6302,6320 ----
           (re-search-backward "\\<\\(pro\\|function\\)[ \t]+\\="
                               (- (point) 15) t)
           (goto-char (point-min))
!          (re-search-forward 
            "^[ \t]*\\(pro\\|function\\)[ \t]+\\([a-zA-Z0-9_]+::\\)" nil t))))
        ;; Yank the full class specification
        (insert (match-string 2))
      ;; Do the completion, using list gathered from `idlwave-routines'
!     (idlwave-complete-in-buffer 
!      'class 'class (idlwave-class-alist) nil 
       "Select a class" "class"
       '(lambda (list)  ;; Push it to help-links if system help available
        (mapcar (lambda (x)
                  (let* ((entry (idlwave-class-info x))
                         (link (nth 1 (assq 'link entry))))
!                   (if link (push (cons x link) 
                                   idlwave-completion-help-links))
                    x))
                list)))))
***************
*** 6304,6310 ****
    ;; SHOW-CLASSES is the value of `idlwave-completion-show-classes'.
    (if (or (null show-classes)           ; don't want to see classes
          (null class-selector)         ; not a method call
!         (and
           (stringp class-selector) ; the class is already known
           (not super-classes)))    ; no possibilities for inheritance
        ;; In these cases, we do not have to do anything
--- 6326,6332 ----
    ;; SHOW-CLASSES is the value of `idlwave-completion-show-classes'.
    (if (or (null show-classes)           ; don't want to see classes
          (null class-selector)         ; not a method call
!         (and 
           (stringp class-selector) ; the class is already known
           (not super-classes)))    ; no possibilities for inheritance
        ;; In these cases, we do not have to do anything
***************
*** 6319,6331 ****
           (max (abs show-classes))
           (lmax (if do-dots (apply 'max (mapcar 'length list))))
          classes nclasses class-info space)
!       (mapcar
         (lambda (x)
         ;; get the classes
         (if (eq type 'class-tag)
             ;; Just one class for tags
             (setq classes
!                  (list
                    (idlwave-class-or-superclass-with-tag class-selector x)))
           ;; Multiple classes for method or method-keyword
           (setq classes
--- 6341,6353 ----
           (max (abs show-classes))
           (lmax (if do-dots (apply 'max (mapcar 'length list))))
          classes nclasses class-info space)
!       (mapcar 
         (lambda (x)
         ;; get the classes
         (if (eq type 'class-tag)
             ;; Just one class for tags
             (setq classes
!                  (list 
                    (idlwave-class-or-superclass-with-tag class-selector x)))
           ;; Multiple classes for method or method-keyword
           (setq classes
***************
*** 6334,6340 ****
                      method-selector x type-selector)
                   (idlwave-all-method-classes x type-selector)))
           (if inherit
!              (setq classes
                     (delq nil
                           (mapcar (lambda (x) (if (memq x inherit) x nil))
                                   classes)))))
--- 6356,6362 ----
                      method-selector x type-selector)
                   (idlwave-all-method-classes x type-selector)))
           (if inherit
!              (setq classes 
                     (delq nil
                           (mapcar (lambda (x) (if (memq x inherit) x nil))
                                   classes)))))
***************
*** 6371,6377 ****
  (defun idlwave-attach-class-tag-classes (list)
    ;; Call idlwave-attach-classes with class structure tags
    (idlwave-attach-classes list 'class-tag idlwave-completion-show-classes))
! 
  
  ;;----------------------------------------------------------------------
  ;;----------------------------------------------------------------------
--- 6393,6399 ----
  (defun idlwave-attach-class-tag-classes (list)
    ;; Call idlwave-attach-classes with class structure tags
    (idlwave-attach-classes list 'class-tag idlwave-completion-show-classes))
!                                       
  
  ;;----------------------------------------------------------------------
  ;;----------------------------------------------------------------------
***************
*** 6392,6398 ****
          ((= 1 (length list))
           (setq rtn (car list)))
          ((featurep 'xemacs)
!          (if sort (setq list (sort list (lambda (a b)
                                            (string< (upcase a) (upcase b))))))
           (setq menu
                 (append (list title)
--- 6414,6420 ----
          ((= 1 (length list))
           (setq rtn (car list)))
          ((featurep 'xemacs)
!          (if sort (setq list (sort list (lambda (a b) 
                                            (string< (upcase a) (upcase b))))))
           (setq menu
                 (append (list title)
***************
*** 6403,6409 ****
           (setq resp (get-popup-menu-response menu))
           (funcall (event-function resp) (event-object resp)))
          (t
!          (if sort (setq list (sort list (lambda (a b)
                                            (string< (upcase a) (upcase b))))))
           (setq menu (cons title
                            (list
--- 6425,6431 ----
           (setq resp (get-popup-menu-response menu))
           (funcall (event-function resp) (event-object resp)))
          (t
!          (if sort (setq list (sort list (lambda (a b) 
                                            (string< (upcase a) (upcase b))))))
           (setq menu (cons title
                            (list
***************
*** 6494,6500 ****
      (setq idlwave-before-completion-wconf (current-window-configuration)))
  
    (if (featurep 'xemacs)
!       (idlwave-display-completion-list-xemacs
         list)
      (idlwave-display-completion-list-emacs list))
  
--- 6516,6522 ----
      (setq idlwave-before-completion-wconf (current-window-configuration)))
  
    (if (featurep 'xemacs)
!       (idlwave-display-completion-list-xemacs 
         list)
      (idlwave-display-completion-list-emacs list))
  
***************
*** 6575,6581 ****
              (mapcar (lambda(x)
                        (princ (nth 1 x))
                        (princ "\n"))
!                     keys-alist))
            (setq char (read-char)))
        (setq char (read-char)))
      (message nil)
--- 6597,6603 ----
              (mapcar (lambda(x)
                        (princ (nth 1 x))
                        (princ "\n"))
!                     keys-alist))            
            (setq char (read-char)))
        (setq char (read-char)))
      (message nil)
***************
*** 6695,6701 ****
  (defun idlwave-make-modified-completion-map-emacs (old-map)
    "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP."
    (let ((new-map (copy-keymap old-map)))
!     (substitute-key-definition
       'choose-completion 'idlwave-choose-completion new-map)
      (substitute-key-definition
       'mouse-choose-completion 'idlwave-mouse-choose-completion new-map)
--- 6717,6723 ----
  (defun idlwave-make-modified-completion-map-emacs (old-map)
    "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP."
    (let ((new-map (copy-keymap old-map)))
!     (substitute-key-definition 
       'choose-completion 'idlwave-choose-completion new-map)
      (substitute-key-definition
       'mouse-choose-completion 'idlwave-mouse-choose-completion new-map)
***************
*** 6721,6728 ****
  ;;
  ;; - Go again over the documentation how to write a completion
  ;;   plugin.  It is in self.el, but currently still very bad.
! ;;   This could be in a separate file in the distribution, or
! ;;   in an appendix for the manual.
  
  (defvar idlwave-struct-skip
    "[ \t]*\\(\\$.*\n\\(^[ \t]*\\(\\$[ \t]*\\)?\\(;.*\\)?\n\\)*\\)?[ \t]*"
--- 6743,6750 ----
  ;;
  ;; - Go again over the documentation how to write a completion
  ;;   plugin.  It is in self.el, but currently still very bad.
! ;;   This could be in a separate file in the distribution, or 
! ;;   in an appendix for the manual.  
  
  (defvar idlwave-struct-skip
    "[ \t]*\\(\\$.*\n\\(^[ \t]*\\(\\$[ \t]*\\)?\\(;.*\\)?\n\\)*\\)?[ \t]*"
***************
*** 6761,6767 ****
         (beg (car borders))
         (end (cdr borders))
         (case-fold-search t))
!     (re-search-forward (concat "\\(^[ \t]*\\|[,{][ \t]*\\)" tag "[ \t]*:")
                       end t)))
  
  (defun idlwave-struct-inherits ()
--- 6783,6789 ----
         (beg (car borders))
         (end (cdr borders))
         (case-fold-search t))
!     (re-search-forward (concat "\\(^[ \t]*\\|[,{][ \t]*\\)" tag "[ \t]*:") 
                       end t)))
  
  (defun idlwave-struct-inherits ()
***************
*** 6776,6782 ****
        (goto-char beg)
        (save-restriction
        (narrow-to-region beg end)
!       (while (re-search-forward
                (concat "[{,]"  ;leading comma/brace
                        idlwave-struct-skip ; 4 groups
                        "inherits"    ; The INHERITS tag
--- 6798,6804 ----
        (goto-char beg)
        (save-restriction
        (narrow-to-region beg end)
!       (while (re-search-forward 
                (concat "[{,]"  ;leading comma/brace
                        idlwave-struct-skip ; 4 groups
                        "inherits"    ; The INHERITS tag
***************
*** 6826,6834 ****
                  (concat "\\<" (regexp-quote (downcase var)) "\\>" ws)
                "\\(\\)")
              "=" ws "\\({\\)"
!             (if name
                  (if (stringp name)
!                     (concat ws "\\(\\<" (downcase name) "\\)[^a-zA-Z0-9_$]")
                    ;; Just a generic name
                    (concat ws "\\<\\([a-zA-Z_0-9$]+\\)" ws ","))
                ""))))
--- 6848,6856 ----
                  (concat "\\<" (regexp-quote (downcase var)) "\\>" ws)
                "\\(\\)")
              "=" ws "\\({\\)"
!             (if name 
                  (if (stringp name)
!                     (concat ws "\\(\\<" (downcase name) "\\)[^a-zA-Z0-9_$]") 
                    ;; Just a generic name
                    (concat ws "\\<\\([a-zA-Z_0-9$]+\\)" ws ","))
                ""))))
***************
*** 6839,6845 ****
          (goto-char (match-beginning 3))
          (match-string-no-properties 5)))))
  
! (defvar idlwave-class-info nil)
  (defvar idlwave-system-class-info nil) ; Gathered from idlw-rinfo
  (defvar idlwave-class-reset nil) ; to reset buffer-local classes
  
--- 6861,6867 ----
          (goto-char (match-beginning 3))
          (match-string-no-properties 5)))))
  
! (defvar idlwave-class-info nil) 
  (defvar idlwave-system-class-info nil) ; Gathered from idlw-rinfo
  (defvar idlwave-class-reset nil) ; to reset buffer-local classes
  
***************
*** 6852,6864 ****
    (let (list entry)
      (if idlwave-class-info
        (if idlwave-class-reset
!           (setq
             idlwave-class-reset nil
             idlwave-class-info ; Remove any visited in a buffer
!            (delq nil (mapcar
!                       (lambda (x)
!                         (let ((filebuf
!                                (idlwave-class-file-or-buffer
                                  (or (cdr (assq 'found-in x)) (car x)))))
                            (if (cdr filebuf)
                                nil
--- 6874,6886 ----
    (let (list entry)
      (if idlwave-class-info
        (if idlwave-class-reset
!           (setq           
             idlwave-class-reset nil
             idlwave-class-info ; Remove any visited in a buffer
!            (delq nil (mapcar 
!                       (lambda (x) 
!                         (let ((filebuf 
!                                (idlwave-class-file-or-buffer 
                                  (or (cdr (assq 'found-in x)) (car x)))))
                            (if (cdr filebuf)
                                nil
***************
*** 6896,6902 ****
          (progn
            ;; For everything there
            (setq end-lim (save-excursion (idlwave-end-of-subprogram) (point)))
!           (while (setq name
                         (idlwave-find-structure-definition nil t end-lim))
              (funcall all-hook name)))
        (idlwave-find-structure-definition nil (or alt-class class))))))
--- 6918,6924 ----
          (progn
            ;; For everything there
            (setq end-lim (save-excursion (idlwave-end-of-subprogram) (point)))
!           (while (setq name 
                         (idlwave-find-structure-definition nil t end-lim))
              (funcall all-hook name)))
        (idlwave-find-structure-definition nil (or alt-class class))))))
***************
*** 6934,6944 ****
          (insert-file-contents file))
        (save-excursion
          (goto-char 1)
!         (idlwave-find-class-definition class
           ;; Scan all of the structures found there
           (lambda (name)
             (let* ((this-class (idlwave-sintern-class name))
!                   (entry
                     (list this-class
                           (cons 'tags (idlwave-struct-tags))
                           (cons 'inherits (idlwave-struct-inherits)))))
--- 6956,6966 ----
          (insert-file-contents file))
        (save-excursion
          (goto-char 1)
!         (idlwave-find-class-definition class 
           ;; Scan all of the structures found there
           (lambda (name)
             (let* ((this-class (idlwave-sintern-class name))
!                   (entry 
                     (list this-class
                           (cons 'tags (idlwave-struct-tags))
                           (cons 'inherits (idlwave-struct-inherits)))))
***************
*** 6963,6969 ****
    (condition-case err
        (apply 'append (mapcar 'idlwave-class-tags
                             (cons class (idlwave-all-class-inherits class))))
!     (error
       (idlwave-class-tag-reset)
       (error "%s" (error-message-string err)))))
  
--- 6985,6991 ----
    (condition-case err
        (apply 'append (mapcar 'idlwave-class-tags
                             (cons class (idlwave-all-class-inherits class))))
!     (error           
       (idlwave-class-tag-reset)
       (error "%s" (error-message-string err)))))
  
***************
*** 7000,7023 ****
          all-inherits))))))
  
  (defun idlwave-entry-keywords (entry &optional record-link)
!   "Return the flat entry keywords alist from routine-info entry.
  If RECORD-LINK is non-nil, the keyword text is copied and a text
  property indicating the link is added."
    (let (kwds)
      (mapcar
!      (lambda (key-list)
         (let ((file (car key-list)))
         (mapcar (lambda (key-cons)
                   (let ((key (car key-cons))
                         (link (cdr key-cons)))
                     (when (and record-link file)
                         (setq key (copy-sequence key))
!                        (put-text-property
                          0 (length key)
!                         'link
!                         (concat
!                          file
!                          (if link
                               (concat idlwave-html-link-sep
                                       (number-to-string link))))
                          key))
--- 7022,7045 ----
          all-inherits))))))
  
  (defun idlwave-entry-keywords (entry &optional record-link)
!   "Return the flat entry keywords alist from routine-info entry.  
  If RECORD-LINK is non-nil, the keyword text is copied and a text
  property indicating the link is added."
    (let (kwds)
      (mapcar
!      (lambda (key-list) 
         (let ((file (car key-list)))
         (mapcar (lambda (key-cons)
                   (let ((key (car key-cons))
                         (link (cdr key-cons)))
                     (when (and record-link file)
                         (setq key (copy-sequence key))
!                        (put-text-property 
                          0 (length key)
!                         'link 
!                         (concat 
!                          file 
!                          (if link 
                               (concat idlwave-html-link-sep
                                       (number-to-string link))))
                          key))
***************
*** 7030,7042 ****
    "Find keyword KEYWORD in entry ENTRY, and return (with link) if set"
    (catch 'exit
      (mapc
!      (lambda (key-list)
         (let ((file (car key-list))
             (kwd (assoc keyword (cdr key-list))))
         (when kwd
!          (setq kwd (cons (car kwd)
                           (if (and file (cdr kwd))
!                              (concat file
                                       idlwave-html-link-sep
                                       (number-to-string (cdr kwd)))
                             (cdr kwd))))
--- 7052,7064 ----
    "Find keyword KEYWORD in entry ENTRY, and return (with link) if set"
    (catch 'exit
      (mapc
!      (lambda (key-list) 
         (let ((file (car key-list))
             (kwd (assoc keyword (cdr key-list))))
         (when kwd
!          (setq kwd (cons (car kwd) 
                           (if (and file (cdr kwd))
!                              (concat file 
                                       idlwave-html-link-sep
                                       (number-to-string (cdr kwd)))
                             (cdr kwd))))
***************
*** 7074,7087 ****
          ;; Check if we need to update the "current" class
          (if (not (equal class-selector idlwave-current-tags-class))
              (idlwave-prepare-class-tag-completion class-selector))
!         (setq idlwave-completion-help-info
                (list 'idlwave-complete-class-structure-tag-help
!                     (idlwave-sintern-routine
                       (concat class-selector "__define"))
                      nil))
          (let  ((idlwave-cpl-bold idlwave-current-native-class-tags))
            (idlwave-complete-in-buffer
!            'class-tag 'class-tag
             idlwave-current-class-tags nil
             (format "Select a tag of class %s" class-selector)
             "class tag"
--- 7096,7109 ----
          ;; Check if we need to update the "current" class
          (if (not (equal class-selector idlwave-current-tags-class))
              (idlwave-prepare-class-tag-completion class-selector))
!         (setq idlwave-completion-help-info 
                (list 'idlwave-complete-class-structure-tag-help
!                     (idlwave-sintern-routine 
                       (concat class-selector "__define"))
                      nil))
          (let  ((idlwave-cpl-bold idlwave-current-native-class-tags))
            (idlwave-complete-in-buffer
!            'class-tag 'class-tag 
             idlwave-current-class-tags nil
             (format "Select a tag of class %s" class-selector)
             "class tag"
***************
*** 7133,7139 ****
             (skip-chars-backward "[a-zA-Z0-9_$]")
             (equal (char-before) ?!))
           (setq idlwave-completion-help-info '(idlwave-complete-sysvar-help))
!          (idlwave-complete-in-buffer 'sysvar 'sysvar
                                       idlwave-system-variables-alist nil
                                       "Select a system variable"
                                       "system variable")
--- 7155,7161 ----
             (skip-chars-backward "[a-zA-Z0-9_$]")
             (equal (char-before) ?!))
           (setq idlwave-completion-help-info '(idlwave-complete-sysvar-help))
!          (idlwave-complete-in-buffer 'sysvar 'sysvar 
                                       idlwave-system-variables-alist nil
                                       "Select a system variable"
                                       "system variable")
***************
*** 7152,7164 ****
             (or tags (error "System variable !%s is not a structure" var))
             (setq idlwave-completion-help-info
                   (list 'idlwave-complete-sysvar-tag-help var))
!            (idlwave-complete-in-buffer 'sysvartag 'sysvartag
                                         tags nil
                                         "Select a system variable tag"
                                         "system variable tag")
             t)) ; return t to skip other completions
          (t nil))))
  
  (defun idlwave-complete-sysvar-help (mode word)
    (let ((word (or (nth 1 idlwave-completion-help-info) word))
        (entry (assoc word idlwave-system-variables-alist)))
--- 7174,7187 ----
             (or tags (error "System variable !%s is not a structure" var))
             (setq idlwave-completion-help-info
                   (list 'idlwave-complete-sysvar-tag-help var))
!            (idlwave-complete-in-buffer 'sysvartag 'sysvartag 
                                         tags nil
                                         "Select a system variable tag"
                                         "system variable tag")
             t)) ; return t to skip other completions
          (t nil))))
  
+ (defvar link) ;dynamic
  (defun idlwave-complete-sysvar-help (mode word)
    (let ((word (or (nth 1 idlwave-completion-help-info) word))
        (entry (assoc word idlwave-system-variables-alist)))
***************
*** 7179,7186 ****
       ((eq mode 'test) ; we can at least link the main
        (and (stringp word) entry main))
       ((eq mode 'set)
!       (if entry
!         (setq link
                (if (setq target (cdr (assoc word tags)))
                  (idlwave-substitute-link-target main target)
                main)))) ;; setting dynamic!!!
--- 7202,7209 ----
       ((eq mode 'test) ; we can at least link the main
        (and (stringp word) entry main))
       ((eq mode 'set)
!       (if entry 
!         (setq link 
                (if (setq target (cdr (assoc word tags)))
                  (idlwave-substitute-link-target main target)
                main)))) ;; setting dynamic!!!
***************
*** 7198,7204 ****
  
  ;; Fake help in the source buffer for class structure tags.
  ;; KWD AND NAME ARE GLOBAL-VARIABLES HERE.
! (defvar name)
  (defvar kwd)
  (defvar idlwave-help-do-class-struct-tag nil)
  (defun idlwave-complete-class-structure-tag-help (mode word)
--- 7221,7227 ----
  
  ;; Fake help in the source buffer for class structure tags.
  ;; KWD AND NAME ARE GLOBAL-VARIABLES HERE.
! (defvar name) 
  (defvar kwd)
  (defvar idlwave-help-do-class-struct-tag nil)
  (defun idlwave-complete-class-structure-tag-help (mode word)
***************
*** 7207,7217 ****
      nil)
     ((eq mode 'set)
      (let (class-with found-in)
!       (when (setq class-with
!               (idlwave-class-or-superclass-with-tag
                 idlwave-current-tags-class
                 word))
!       (if (assq (idlwave-sintern-class class-with)
                  idlwave-system-class-info)
            (error "No help available for system class tags"))
        (if (setq found-in (idlwave-class-found-in class-with))
--- 7230,7240 ----
      nil)
     ((eq mode 'set)
      (let (class-with found-in)
!       (when (setq class-with 
!               (idlwave-class-or-superclass-with-tag 
                 idlwave-current-tags-class
                 word))
!       (if (assq (idlwave-sintern-class class-with) 
                  idlwave-system-class-info)
            (error "No help available for system class tags"))
        (if (setq found-in (idlwave-class-found-in class-with))
***************
*** 7224,7230 ****
  (defun idlwave-class-or-superclass-with-tag (class tag)
    "Find and return the CLASS or one of its superclass with the
  associated TAG, if any."
!   (let ((sclasses (cons class (cdr (assq 'all-inherits
                                         (idlwave-class-info class)))))
        cl)
     (catch 'exit
--- 7247,7253 ----
  (defun idlwave-class-or-superclass-with-tag (class tag)
    "Find and return the CLASS or one of its superclass with the
  associated TAG, if any."
!   (let ((sclasses (cons class (cdr (assq 'all-inherits 
                                         (idlwave-class-info class)))))
        cl)
     (catch 'exit
***************
*** 7233,7239 ****
         (let ((tags (idlwave-class-tags cl)))
         (while tags
           (if (eq t (compare-strings tag 0 nil (car tags) 0 nil t))
!            (throw 'exit cl))
           (setq tags (cdr tags))))))))
  
  
--- 7256,7262 ----
         (let ((tags (idlwave-class-tags cl)))
         (while tags
           (if (eq t (compare-strings tag 0 nil (car tags) 0 nil t))
!            (throw 'exit cl))         
           (setq tags (cdr tags))))))))
  
  
***************
*** 7256,7263 ****
        (setcar entry (idlwave-sintern-sysvar (car entry) 'set))
        (setq tags (assq 'tags entry))
        (if tags
!         (setcdr tags
!                 (mapcar (lambda (x)
                            (cons (idlwave-sintern-sysvartag (car x) 'set)
                                  (cdr x)))
                          (cdr tags)))))))
--- 7279,7286 ----
        (setcar entry (idlwave-sintern-sysvar (car entry) 'set))
        (setq tags (assq 'tags entry))
        (if tags
!         (setcdr tags 
!                 (mapcar (lambda (x) 
                            (cons (idlwave-sintern-sysvartag (car x) 'set)
                                  (cdr x)))
                          (cdr tags)))))))
***************
*** 7274,7292 ****
                         text start)
        (setq start (match-end 0)
            var (match-string 1 text)
!           tags (if (match-end 3)
                     (idlwave-split-string (match-string 3 text))))
        ;; Maintain old links, if present
        (setq old-entry (assq (idlwave-sintern-sysvar var) old))
        (setq link (assq 'link old-entry))
        (setq idlwave-system-variables-alist
!           (cons (list var
!                       (cons
!                        'tags
!                        (mapcar (lambda (x)
!                                  (cons x
!                                        (cdr (assq
!                                              (idlwave-sintern-sysvartag x)
                                               (cdr (assq 'tags old-entry))))))
                                 tags)) link)
                  idlwave-system-variables-alist)))
--- 7297,7315 ----
                         text start)
        (setq start (match-end 0)
            var (match-string 1 text)
!           tags (if (match-end 3) 
                     (idlwave-split-string (match-string 3 text))))
        ;; Maintain old links, if present
        (setq old-entry (assq (idlwave-sintern-sysvar var) old))
        (setq link (assq 'link old-entry))
        (setq idlwave-system-variables-alist
!           (cons (list var 
!                       (cons 
!                        'tags 
!                        (mapcar (lambda (x) 
!                                  (cons x 
!                                        (cdr (assq 
!                                              (idlwave-sintern-sysvartag x) 
                                               (cdr (assq 'tags old-entry))))))
                                 tags)) link)
                  idlwave-system-variables-alist)))
***************
*** 7308,7316 ****
  
  (defun idlwave-uniquify (list)
    (let ((ht (make-hash-table :size (length list) :test 'equal)))
!     (delq nil
          (mapcar (lambda (x)
!                   (unless (gethash x ht)
                      (puthash x t ht)
                      x))
                  list))))
--- 7331,7339 ----
  
  (defun idlwave-uniquify (list)
    (let ((ht (make-hash-table :size (length list) :test 'equal)))
!     (delq nil 
          (mapcar (lambda (x)
!                   (unless (gethash x ht) 
                      (puthash x t ht)
                      x))
                  list))))
***************
*** 7338,7348 ****
        nil)))
  
    ;; Restore the pre-completion window configuration if this is safe.
! 
!   (if (or (eq verify 'force)                                    ; force
!         (and
           (get-buffer-window "*Completions*")                  ; visible
!          (idlwave-local-value 'idlwave-completion-p
                                "*Completions*")                ; cib-buffer
           (eq (marker-buffer idlwave-completion-mark)
               (current-buffer))                                ; buffer OK
--- 7361,7371 ----
        nil)))
  
    ;; Restore the pre-completion window configuration if this is safe.
!   
!   (if (or (eq verify 'force)                                    ; force 
!         (and 
           (get-buffer-window "*Completions*")                  ; visible
!          (idlwave-local-value 'idlwave-completion-p 
                                "*Completions*")                ; cib-buffer
           (eq (marker-buffer idlwave-completion-mark)
               (current-buffer))                                ; buffer OK
***************
*** 7440,7446 ****
      (if (string-match "\\(pro\\|function\\)[ \t]+\\(\\(.*\\)::\\)?\\(.*\\)"
                      resolve)
        (setq type (match-string 1 resolve)
!             class (if (match-beginning 2)
                        (match-string 3 resolve)
                      nil)
              name (match-string 4 resolve)))
--- 7463,7469 ----
      (if (string-match "\\(pro\\|function\\)[ \t]+\\(\\(.*\\)::\\)?\\(.*\\)"
                      resolve)
        (setq type (match-string 1 resolve)
!             class (if (match-beginning 2) 
                        (match-string 3 resolve)
                      nil)
              name (match-string 4 resolve)))
***************
*** 7449,7467 ****
  
      (cond
       ((null class)
!       (idlwave-shell-send-command
         (format "resolve_routine,'%s'%s" (downcase name) kwd)
         'idlwave-update-routine-info
         nil t))
       (t
!       (idlwave-shell-send-command
         (format "resolve_routine,'%s__define'%s" (downcase class) kwd)
!        (list 'idlwave-shell-send-command
!            (format "resolve_routine,'%s__%s'%s"
                     (downcase class) (downcase name) kwd)
             '(idlwave-update-routine-info)
             nil t))))))
  
  (defun idlwave-find-module (&optional arg)
    "Find the source code of an IDL module.
  Works for modules for which IDLWAVE has routine info available.  The
--- 7472,7494 ----
  
      (cond
       ((null class)
!       (idlwave-shell-send-command 
         (format "resolve_routine,'%s'%s" (downcase name) kwd)
         'idlwave-update-routine-info
         nil t))
       (t
!       (idlwave-shell-send-command 
         (format "resolve_routine,'%s__define'%s" (downcase class) kwd)
!        (list 'idlwave-shell-send-command 
!            (format "resolve_routine,'%s__%s'%s" 
                     (downcase class) (downcase name) kwd)
             '(idlwave-update-routine-info)
             nil t))))))
  
+ (defun idlwave-find-module-this-file ()
+   (interactive)
+   (idlwave-find-module '(4)))
+ 
  (defun idlwave-find-module (&optional arg)
    "Find the source code of an IDL module.
  Works for modules for which IDLWAVE has routine info available.  The
***************
*** 7474,7492 ****
         (this-buffer (equal arg '(4)))
         (module (idlwave-fix-module-if-obj_new (idlwave-what-module)))
         (default (if module
!                     (concat (idlwave-make-full-name
                               (nth 2 module) (car module))
                              (if (eq (nth 1 module) 'pro) "<p>" "<f>"))
                    "none"))
!        (list
          (idlwave-uniquify
           (delq nil
!                (mapcar (lambda (x)
                           (if (eq 'system (car-safe (nth 3 x)))
                               ;; Take out system routines with no source.
                               nil
                             (list
!                             (concat (idlwave-make-full-name
                                       (nth 2 x) (car x))
                                      (if (eq (nth 1 x) 'pro) "<p>" "<f>")))))
                         (if this-buffer
--- 7501,7519 ----
         (this-buffer (equal arg '(4)))
         (module (idlwave-fix-module-if-obj_new (idlwave-what-module)))
         (default (if module
!                     (concat (idlwave-make-full-name 
                               (nth 2 module) (car module))
                              (if (eq (nth 1 module) 'pro) "<p>" "<f>"))
                    "none"))
!        (list 
          (idlwave-uniquify
           (delq nil
!                (mapcar (lambda (x) 
                           (if (eq 'system (car-safe (nth 3 x)))
                               ;; Take out system routines with no source.
                               nil
                             (list
!                             (concat (idlwave-make-full-name 
                                       (nth 2 x) (car x))
                                      (if (eq (nth 1 x) 'pro) "<p>" "<f>")))))
                         (if this-buffer
***************
*** 7515,7524 ****
                     (t t)))
      (idlwave-do-find-module name type class nil this-buffer)))
  
! (defun idlwave-do-find-module (name type class
                                    &optional force-source this-buffer)
    (let ((name1 (idlwave-make-full-name class name))
!       source buf1 entry
        (buf (current-buffer))
        (pos (point))
        file name2)
--- 7542,7551 ----
                     (t t)))
      (idlwave-do-find-module name type class nil this-buffer)))
  
! (defun idlwave-do-find-module (name type class 
                                    &optional force-source this-buffer)
    (let ((name1 (idlwave-make-full-name class name))
!       source buf1 entry 
        (buf (current-buffer))
        (pos (point))
        file name2)
***************
*** 7528,7538 ****
          name2 (if (nth 2 entry)
                    (idlwave-make-full-name (nth 2 entry) name)
                  name1))
!     (if source
        (setq file (idlwave-routine-source-file source)))
      (unless file  ; Try to find it on the path.
!       (setq file
!           (idlwave-expand-lib-file-name
             (if class
                 (format "%s__define.pro" (downcase class))
               (format "%s.pro" (downcase name))))))
--- 7555,7565 ----
          name2 (if (nth 2 entry)
                    (idlwave-make-full-name (nth 2 entry) name)
                  name1))
!     (if source        
        (setq file (idlwave-routine-source-file source)))
      (unless file  ; Try to find it on the path.
!       (setq file 
!           (idlwave-expand-lib-file-name 
             (if class
                 (format "%s__define.pro" (downcase class))
               (format "%s.pro" (downcase name))))))
***************
*** 7540,7553 ****
       ((or (null name) (equal name ""))
        (error "Abort"))
       ((eq (car source) 'system)
!       (error "Source code for system routine %s is not available"
             name2))
       ((or (not file) (not (file-regular-p file)))
        (error "Source code for routine %s is not available"
             name2))
       (t
        (when (not this-buffer)
!       (setq buf1
              (idlwave-find-file-noselect file 'find))
        (pop-to-buffer buf1 t))
        (goto-char (point-max))
--- 7567,7580 ----
       ((or (null name) (equal name ""))
        (error "Abort"))
       ((eq (car source) 'system)
!       (error "Source code for system routine %s is not available" 
             name2))
       ((or (not file) (not (file-regular-p file)))
        (error "Source code for routine %s is not available"
             name2))
       (t
        (when (not this-buffer)
!       (setq buf1 
              (idlwave-find-file-noselect file 'find))
        (pop-to-buffer buf1 t))
        (goto-char (point-max))
***************
*** 7557,7563 ****
                     (cond ((eq type 'fun) "function")
                           ((eq type 'pro) "pro")
                           (t "\\(pro\\|function\\)"))
!                    "\\>[ \t]+"
                     (regexp-quote (downcase name2))
                     "[^a-zA-Z0-9_$]")
             nil t)
--- 7584,7590 ----
                     (cond ((eq type 'fun) "function")
                           ((eq type 'pro) "pro")
                           (t "\\(pro\\|function\\)"))
!                    "\\>[ \t]+" 
                     (regexp-quote (downcase name2))
                     "[^a-zA-Z0-9_$]")
             nil t)
***************
*** 7594,7610 ****
        (cond
         ((and (eq cw 'procedure)
             (not (equal this-word "")))
!       (setq this-word (idlwave-sintern-routine-or-method
                         this-word (nth 2 (nth 3 where))))
        (list this-word 'pro
!             (idlwave-determine-class
               (cons this-word (cdr (nth 3 where)))
               'pro)))
!        ((and (eq cw 'function)
             (not (equal this-word ""))
             (or (eq next-char ?\()     ; exclude arrays, vars.
                 (looking-at "[a-zA-Z0-9_]*[ \t]*(")))
!       (setq this-word (idlwave-sintern-routine-or-method
                         this-word (nth 2 (nth 3 where))))
        (list this-word 'fun
              (idlwave-determine-class
--- 7621,7637 ----
        (cond
         ((and (eq cw 'procedure)
             (not (equal this-word "")))
!       (setq this-word (idlwave-sintern-routine-or-method 
                         this-word (nth 2 (nth 3 where))))
        (list this-word 'pro
!             (idlwave-determine-class 
               (cons this-word (cdr (nth 3 where)))
               'pro)))
!        ((and (eq cw 'function) 
             (not (equal this-word ""))
             (or (eq next-char ?\()     ; exclude arrays, vars.
                 (looking-at "[a-zA-Z0-9_]*[ \t]*(")))
!       (setq this-word (idlwave-sintern-routine-or-method 
                         this-word (nth 2 (nth 3 where))))
        (list this-word 'fun
              (idlwave-determine-class
***************
*** 7641,7647 ****
        class)))
  
  (defun idlwave-fix-module-if-obj_new (module)
!   "Check if MODULE points to obj_new.
  If yes, and if the cursor is in the keyword region, change to the
  appropriate Init method."
    (let* ((name (car module))
--- 7668,7674 ----
        class)))
  
  (defun idlwave-fix-module-if-obj_new (module)
!   "Check if MODULE points to obj_new.  
  If yes, and if the cursor is in the keyword region, change to the
  appropriate Init method."
    (let* ((name (car module))
***************
*** 7662,7671 ****
                             (idlwave-sintern-class class)))))
      module))
  
! (defun idlwave-fix-keywords (name type class keywords &optional super-classes)
    "Update a list of keywords.
  Translate OBJ_NEW, adding all super-class keywords, or all keywords
! from all classes if class equals t."
    (let ((case-fold-search t))
  
      ;; If this is the OBJ_NEW function, try to figure out the class and use
--- 7689,7700 ----
                             (idlwave-sintern-class class)))))
      module))
  
! (defun idlwave-fix-keywords (name type class keywords 
!                                 &optional super-classes system)
    "Update a list of keywords.
  Translate OBJ_NEW, adding all super-class keywords, or all keywords
! from all classes if class equals t.  If SYSTEM is non-nil, don't
! demand _EXTRA in the keyword list."
    (let ((case-fold-search t))
  
      ;; If this is the OBJ_NEW function, try to figure out the class and use
***************
*** 7681,7715 ****
                             string)
               (setq class (idlwave-sintern-class (match-string 1 string)))
               (setq idlwave-current-obj_new-class class)
!              (setq keywords
!                    (append keywords
                             (idlwave-entry-keywords
                              (idlwave-rinfo-assq
                               (idlwave-sintern-method "INIT")
                               'fun
                               class
                               (idlwave-routines)) 'do-link))))))
! 
      ;; If the class is `t', combine all keywords of all methods NAME
      (when (eq class t)
        (mapc (lambda (entry)
              (and
               (nth 2 entry)             ; non-nil class
               (eq (nth 1 entry) type)   ; correct type
!              (setq keywords
!                    (append keywords
                             (idlwave-entry-keywords entry 'do-link)))))
            (idlwave-all-assq name (idlwave-routines)))
        (setq keywords (idlwave-uniquify keywords)))
! 
      ;; If we have inheritance, add all keywords from superclasses, if
      ;; the user indicated that method in `idlwave-keyword-class-inheritance'
!     (when (and
           super-classes
           idlwave-keyword-class-inheritance
           (stringp class)
!          (or (assq (idlwave-sintern-keyword "_extra") keywords)
!              (assq (idlwave-sintern-keyword "_ref_extra") keywords))
           ;; Check if one of the keyword-class regexps matches the name
           (let ((regexps idlwave-keyword-class-inheritance) re)
             (catch 'exit
--- 7710,7746 ----
                             string)
               (setq class (idlwave-sintern-class (match-string 1 string)))
               (setq idlwave-current-obj_new-class class)
!              (setq keywords 
!                    (append keywords 
                             (idlwave-entry-keywords
                              (idlwave-rinfo-assq
                               (idlwave-sintern-method "INIT")
                               'fun
                               class
                               (idlwave-routines)) 'do-link))))))
!     
      ;; If the class is `t', combine all keywords of all methods NAME
      (when (eq class t)
        (mapc (lambda (entry)
              (and
               (nth 2 entry)             ; non-nil class
               (eq (nth 1 entry) type)   ; correct type
!              (setq keywords 
!                    (append keywords 
                             (idlwave-entry-keywords entry 'do-link)))))
            (idlwave-all-assq name (idlwave-routines)))
        (setq keywords (idlwave-uniquify keywords)))
!     
      ;; If we have inheritance, add all keywords from superclasses, if
      ;; the user indicated that method in `idlwave-keyword-class-inheritance'
!     (when (and 
           super-classes
           idlwave-keyword-class-inheritance
           (stringp class)
!          (or 
!           system
!           (assq (idlwave-sintern-keyword "_extra") keywords)
!           (assq (idlwave-sintern-keyword "_ref_extra") keywords))
           ;; Check if one of the keyword-class regexps matches the name
           (let ((regexps idlwave-keyword-class-inheritance) re)
             (catch 'exit
***************
*** 7724,7730 ****
                 (mapcar (lambda (k) (add-to-list 'keywords k))
                         (idlwave-entry-keywords entry 'do-link))))
        (setq keywords (idlwave-uniquify keywords)))
! 
      ;; Return the final list
      keywords))
  
--- 7755,7761 ----
                 (mapcar (lambda (k) (add-to-list 'keywords k))
                         (idlwave-entry-keywords entry 'do-link))))
        (setq keywords (idlwave-uniquify keywords)))
!     
      ;; Return the final list
      keywords))
  
***************
*** 7749,7762 ****
                    (assq (idlwave-sintern-keyword "_REF_EXTRA") kwd-alist)))
         (completion-ignore-case t)
         candidates)
!     (cond ((assq kwd kwd-alist)
           kwd)
          ((setq candidates (all-completions kwd kwd-alist))
           (if (= (length candidates) 1)
               (car candidates)
             candidates))
          ((and entry extra)
!          ;; Inheritance may cause this keyword to be correct
           keyword)
          (entry
           ;; We do know the function, which does not have the keyword.
--- 7780,7793 ----
                    (assq (idlwave-sintern-keyword "_REF_EXTRA") kwd-alist)))
         (completion-ignore-case t)
         candidates)
!     (cond ((assq kwd kwd-alist) 
           kwd)
          ((setq candidates (all-completions kwd kwd-alist))
           (if (= (length candidates) 1)
               (car candidates)
             candidates))
          ((and entry extra)
!          ;; Inheritance may cause this keyword to be correct 
           keyword)
          (entry
           ;; We do know the function, which does not have the keyword.
***************
*** 7768,7780 ****
  
  (defvar idlwave-rinfo-mouse-map (make-sparse-keymap))
  (defvar idlwave-rinfo-map (make-sparse-keymap))
! (define-key idlwave-rinfo-mouse-map
    (if (featurep 'xemacs) [button2] [mouse-2])
    'idlwave-mouse-active-rinfo)
! (define-key idlwave-rinfo-mouse-map
    (if (featurep 'xemacs) [(shift button2)] [(shift mouse-2)])
    'idlwave-mouse-active-rinfo-shift)
! (define-key idlwave-rinfo-mouse-map
    (if (featurep 'xemacs) [button3] [mouse-3])
    'idlwave-mouse-active-rinfo-right)
  (define-key idlwave-rinfo-mouse-map " " 'idlwave-active-rinfo-space)
--- 7799,7811 ----
  
  (defvar idlwave-rinfo-mouse-map (make-sparse-keymap))
  (defvar idlwave-rinfo-map (make-sparse-keymap))
! (define-key idlwave-rinfo-mouse-map 
    (if (featurep 'xemacs) [button2] [mouse-2])
    'idlwave-mouse-active-rinfo)
! (define-key idlwave-rinfo-mouse-map 
    (if (featurep 'xemacs) [(shift button2)] [(shift mouse-2)])
    'idlwave-mouse-active-rinfo-shift)
! (define-key idlwave-rinfo-mouse-map 
    (if (featurep 'xemacs) [button3] [mouse-3])
    'idlwave-mouse-active-rinfo-right)
  (define-key idlwave-rinfo-mouse-map " " 'idlwave-active-rinfo-space)
***************
*** 7800,7806 ****
    (let* ((initial-class (or initial-class class))
         (entry (or (idlwave-best-rinfo-assq name type class
                                             (idlwave-routines))
!                   (idlwave-rinfo-assq name type class
                                        idlwave-unresolved-routines)))
         (name (or (car entry) name))
         (class (or (nth 2 entry) class))
--- 7831,7837 ----
    (let* ((initial-class (or initial-class class))
         (entry (or (idlwave-best-rinfo-assq name type class
                                             (idlwave-routines))
!                   (idlwave-rinfo-assq name type class 
                                        idlwave-unresolved-routines)))
         (name (or (car entry) name))
         (class (or (nth 2 entry) class))
***************
*** 7825,7831 ****
         (km-prop (if (featurep 'xemacs) 'keymap 'local-map))
         (face 'idlwave-help-link-face)
         beg props win cnt total)
!     ;; Fix keywords, but don't add chained super-classes, since these
      ;; are shown separately for that super-class
      (setq keywords (idlwave-fix-keywords name type class keywords))
      (cond
--- 7856,7862 ----
         (km-prop (if (featurep 'xemacs) 'keymap 'local-map))
         (face 'idlwave-help-link-face)
         beg props win cnt total)
!     ;; Fix keywords, but don't add chained super-classes, since these 
      ;; are shown separately for that super-class
      (setq keywords (idlwave-fix-keywords name type class keywords))
      (cond
***************
*** 7867,7873 ****
                          km-prop idlwave-rinfo-mouse-map
                          'help-echo help-echo-use
                          'data (cons 'usage data)))
!       (if html-file (setq props (append (list 'face face 'link html-file)
                                          props)))
        (insert "Usage:    ")
        (setq beg (point))
--- 7898,7904 ----
                          km-prop idlwave-rinfo-mouse-map
                          'help-echo help-echo-use
                          'data (cons 'usage data)))
!       (if html-file (setq props (append (list 'face face 'link html-file) 
                                          props)))
        (insert "Usage:    ")
        (setq beg (point))
***************
*** 7876,7889 ****
                  (format calling-seq name name name name))
                "\n")
        (add-text-properties beg (point) props)
! 
        (insert "Keywords:")
        (if (null keywords)
            (insert " No keywords accepted.")
          (setq col 9)
          (mapcar
           (lambda (x)
!            (if (>= (+ col 1 (length (car x)))
                     (window-width))
                 (progn
                   (insert "\n         ")
--- 7907,7920 ----
                  (format calling-seq name name name name))
                "\n")
        (add-text-properties beg (point) props)
!       
        (insert "Keywords:")
        (if (null keywords)
            (insert " No keywords accepted.")
          (setq col 9)
          (mapcar
           (lambda (x)
!            (if (>= (+ col 1 (length (car x))) 
                     (window-width))
                 (progn
                   (insert "\n         ")
***************
*** 7901,7907 ****
             (add-text-properties beg (point) props)
             (setq col (+ col 1 (length (car x)))))
           keywords))
! 
        (setq cnt 1 total (length all))
        ;; Here entry is (key file (list of type-conses))
        (while (setq entry (pop all))
--- 7932,7938 ----
             (add-text-properties beg (point) props)
             (setq col (+ col 1 (length (car x)))))
           keywords))
!       
        (setq cnt 1 total (length all))
        ;; Here entry is (key file (list of type-conses))
        (while (setq entry (pop all))
***************
*** 7914,7920 ****
                                          (cdr (car (nth 2 entry))))
                            'data (cons 'source data)))
          (idlwave-insert-source-location
!          (format "\n%-8s  %s"
                   (if (equal cnt 1)
                       (if (> total 1) "Sources:" "Source:")
                     "")
--- 7945,7951 ----
                                          (cdr (car (nth 2 entry))))
                            'data (cons 'source data)))
          (idlwave-insert-source-location
!          (format "\n%-8s  %s" 
                   (if (equal cnt 1)
                       (if (> total 1) "Sources:" "Source:")
                     "")
***************
*** 7923,7929 ****
          (incf cnt)
          (when (and all (> cnt idlwave-rinfo-max-source-lines))
            ;; No more source lines, please
!           (insert (format
                     "\n          Source information truncated to %d entries."
                     idlwave-rinfo-max-source-lines))
            (setq all nil)))
--- 7954,7960 ----
          (incf cnt)
          (when (and all (> cnt idlwave-rinfo-max-source-lines))
            ;; No more source lines, please
!           (insert (format 
                     "\n          Source information truncated to %d entries."
                     idlwave-rinfo-max-source-lines))
            (setq all nil)))
***************
*** 7937,7943 ****
              (unwind-protect
                  (progn
                    (select-window win)
!                   (enlarge-window (- (/ (frame-height) 2)
                                       (window-height)))
                    (shrink-window-if-larger-than-buffer))
                (select-window ww)))))))))
--- 7968,7974 ----
              (unwind-protect
                  (progn
                    (select-window win)
!                   (enlarge-window (- (/ (frame-height) 2) 
                                       (window-height)))
                    (shrink-window-if-larger-than-buffer))
                (select-window ww)))))))))
***************
*** 7974,7982 ****
       ((and (not file) shell-flag)
        (insert "Unresolved"))
  
!      ((null file)
        (insert "ERROR"))
! 
       ((idlwave-syslib-p file)
        (if (string-match "obsolete" (file-name-directory file))
          (insert "Obsolete  ")
--- 8005,8013 ----
       ((and (not file) shell-flag)
        (insert "Unresolved"))
  
!      ((null file)               
        (insert "ERROR"))
!      
       ((idlwave-syslib-p file)
        (if (string-match "obsolete" (file-name-directory file))
          (insert "Obsolete  ")
***************
*** 7990,7996 ****
       ;; Old special syntax: a matching regexp
       ((setq special (idlwave-special-lib-test file))
        (insert (format "%-10s" special)))
! 
       ;; Catch-all with file
       ((idlwave-lib-p file)      (insert "Library   "))
  
--- 8021,8027 ----
       ;; Old special syntax: a matching regexp
       ((setq special (idlwave-special-lib-test file))
        (insert (format "%-10s" special)))
!      
       ;; Catch-all with file
       ((idlwave-lib-p file)      (insert "Library   "))
  
***************
*** 8005,8011 ****
               (if shell-flag "S" "-")
               (if buffer-flag "B" "-")
               "] ")))
!     (when (> ndupl 1)
        (setq beg (point))
        (insert (format "(%dx) " ndupl))
        (add-text-properties beg (point) (list 'face 'bold)))
--- 8036,8042 ----
               (if shell-flag "S" "-")
               (if buffer-flag "B" "-")
               "] ")))
!     (when (> ndupl 1) 
        (setq beg (point))
        (insert (format "(%dx) " ndupl))
        (add-text-properties beg (point) (list 'face 'bold)))
***************
*** 8029,8035 ****
                  alist nil)))
        rtn)
       (t nil))))
! 
  (defun idlwave-mouse-active-rinfo-right (ev)
    (interactive "e")
    (idlwave-mouse-active-rinfo ev 'right))
--- 8060,8066 ----
                  alist nil)))
        rtn)
       (t nil))))
!   
  (defun idlwave-mouse-active-rinfo-right (ev)
    (interactive "e")
    (idlwave-mouse-active-rinfo ev 'right))
***************
*** 8048,8054 ****
  was pressed."
    (interactive "e")
    (if ev (mouse-set-point ev))
!   (let (data id name type class buf bufwin source word initial-class)
      (setq data (get-text-property (point) 'data)
          source (get-text-property (point) 'source)
          keyword (get-text-property (point) 'keyword)
--- 8079,8086 ----
  was pressed."
    (interactive "e")
    (if ev (mouse-set-point ev))
!   (let (data id name type class buf bufwin source link keyword 
!            word initial-class)
      (setq data (get-text-property (point) 'data)
          source (get-text-property (point) 'source)
          keyword (get-text-property (point) 'keyword)
***************
*** 8062,8070 ****
  
      (cond ((eq id 'class) ; Switch class being displayed
           (if (window-live-p bufwin) (select-window bufwin))
!          (idlwave-display-calling-sequence
            (idlwave-sintern-method name)
!           type (idlwave-sintern-class word)
            initial-class))
          ((eq id 'usage) ; Online help on this routine
           (idlwave-online-help link name type class))
--- 8094,8102 ----
  
      (cond ((eq id 'class) ; Switch class being displayed
           (if (window-live-p bufwin) (select-window bufwin))
!          (idlwave-display-calling-sequence 
            (idlwave-sintern-method name)
!           type (idlwave-sintern-class word) 
            initial-class))
          ((eq id 'usage) ; Online help on this routine
           (idlwave-online-help link name type class))
***************
*** 8105,8113 ****
        (setq bwin (get-buffer-window buffer)))
      (if (eq (preceding-char) ?/)
        (insert keyword)
!       (unless (save-excursion
                (re-search-backward
!                "[(,][ \t]*\\(\\$[ \t]*\\(;.*\\)?\n\\)?[ \t]*\\="
                 (min (- (point) 100) (point-min)) t))
        (insert ", "))
        (if shift (insert "/"))
--- 8137,8145 ----
        (setq bwin (get-buffer-window buffer)))
      (if (eq (preceding-char) ?/)
        (insert keyword)
!       (unless (save-excursion 
                (re-search-backward
!                "[(,][ \t]*\\(\\$[ \t]*\\(;.*\\)?\n\\)?[ \t]*\\=" 
                 (min (- (point) 100) (point-min)) t))
        (insert ", "))
        (if shift (insert "/"))
***************
*** 8159,8165 ****
  command can be used to detect possible name clashes during this process."
    (idlwave-routines)  ; Make sure everything is loaded.
    (unless (or idlwave-user-catalog-routines idlwave-library-catalog-routines)
!     (or (y-or-n-p
         "You don't have any user or library catalogs.  Continue anyway? ")
        (error "Abort")))
    (let* ((routines (append idlwave-system-routines
--- 8191,8197 ----
  command can be used to detect possible name clashes during this process."
    (idlwave-routines)  ; Make sure everything is loaded.
    (unless (or idlwave-user-catalog-routines idlwave-library-catalog-routines)
!     (or (y-or-n-p 
         "You don't have any user or library catalogs.  Continue anyway? ")
        (error "Abort")))
    (let* ((routines (append idlwave-system-routines
***************
*** 8172,8178 ****
         (keymap (make-sparse-keymap))
         (props (list 'mouse-face 'highlight
                      km-prop keymap
!                     'help-echo "Mouse2: Find source"))
         (nroutines (length (or special-routines routines)))
         (step (/ nroutines 99))
         (n 0)
--- 8204,8210 ----
         (keymap (make-sparse-keymap))
         (props (list 'mouse-face 'highlight
                      km-prop keymap
!                     'help-echo "Mouse2: Find source"))      
         (nroutines (length (or special-routines routines)))
         (step (/ nroutines 99))
         (n 0)
***************
*** 8196,8208 ****
      (message "Sorting routines...done")
  
      (define-key keymap (if (featurep 'xemacs) [(button2)] [(mouse-2)])
!       (lambda (ev)
        (interactive "e")
        (mouse-set-point ev)
        (apply 'idlwave-do-find-module
               (get-text-property (point) 'find-args))))
      (define-key keymap [(return)]
!       (lambda ()
        (interactive)
        (apply 'idlwave-do-find-module
               (get-text-property (point) 'find-args))))
--- 8228,8240 ----
      (message "Sorting routines...done")
  
      (define-key keymap (if (featurep 'xemacs) [(button2)] [(mouse-2)])
!       (lambda (ev) 
        (interactive "e")
        (mouse-set-point ev)
        (apply 'idlwave-do-find-module
               (get-text-property (point) 'find-args))))
      (define-key keymap [(return)]
!       (lambda () 
        (interactive)
        (apply 'idlwave-do-find-module
               (get-text-property (point) 'find-args))))
***************
*** 8230,8242 ****
                  (> (idlwave-count-memq 'buffer (nth 2 (car dtwins))) 1))
          (incf cnt)
          (insert (format "\n%s%s"
!                         (idlwave-make-full-name (nth 2 routine)
                                                  (car routine))
                          (if (eq (nth 1 routine) 'fun) "()" "")))
          (while (setq twin (pop dtwins))
            (setq props1 (append (list 'find-args
!                                      (list (nth 0 routine)
!                                            (nth 1 routine)
                                             (nth 2 routine)))
                                 props))
            (idlwave-insert-source-location "\n   - " twin props1))))
--- 8262,8274 ----
                  (> (idlwave-count-memq 'buffer (nth 2 (car dtwins))) 1))
          (incf cnt)
          (insert (format "\n%s%s"
!                         (idlwave-make-full-name (nth 2 routine) 
                                                  (car routine))
                          (if (eq (nth 1 routine) 'fun) "()" "")))
          (while (setq twin (pop dtwins))
            (setq props1 (append (list 'find-args
!                                      (list (nth 0 routine) 
!                                            (nth 1 routine) 
                                             (nth 2 routine)))
                                 props))
            (idlwave-insert-source-location "\n   - " twin props1))))
***************
*** 8259,8265 ****
             (or (not (stringp sfile))
                 (not (string-match "\\S-" sfile))))
        (setq stype 'unresolved))
!     (princ (format "      %-10s %s\n"
                   stype
                   (if sfile sfile "No source code available")))))
  
--- 8291,8297 ----
             (or (not (stringp sfile))
                 (not (string-match "\\S-" sfile))))
        (setq stype 'unresolved))
!     (princ (format "      %-10s %s\n" 
                   stype
                   (if sfile sfile "No source code available")))))
  
***************
*** 8278,8297 ****
               (eq type (nth 1 candidate))
               (eq class (nth 2 candidate)))
          (push candidate twins)))
!     (if (setq candidate (idlwave-rinfo-assq name type class
                                            idlwave-unresolved-routines))
        (push candidate twins))
      (cons entry (nreverse twins))))
  
  (defun idlwave-study-twins (entries)
!   "Return dangerous twins of first entry in ENTRIES.
  Dangerous twins are routines with same name, but in different files on
  the load path.  If a file is in the system library and has an entry in
  the `idlwave-system-routines' list, we omit the latter as
  non-dangerous because many IDL routines are implemented as library
  routines, and may have been scanned."
    (let* ((entry (car entries))
!        (name (car entry))      ;
         (type (nth 1 entry))    ; Must be bound for
         (class (nth 2 entry))   ;  idlwave-routine-twin-compare
         (cnt 0)
--- 8310,8329 ----
               (eq type (nth 1 candidate))
               (eq class (nth 2 candidate)))
          (push candidate twins)))
!     (if (setq candidate (idlwave-rinfo-assq name type class 
                                            idlwave-unresolved-routines))
        (push candidate twins))
      (cons entry (nreverse twins))))
  
  (defun idlwave-study-twins (entries)
!   "Return dangerous twins of first entry in ENTRIES.  
  Dangerous twins are routines with same name, but in different files on
  the load path.  If a file is in the system library and has an entry in
  the `idlwave-system-routines' list, we omit the latter as
  non-dangerous because many IDL routines are implemented as library
  routines, and may have been scanned."
    (let* ((entry (car entries))
!        (name (car entry))      ; 
         (type (nth 1 entry))    ; Must be bound for
         (class (nth 2 entry))   ;  idlwave-routine-twin-compare
         (cnt 0)
***************
*** 8309,8331 ****
                      (t 'unresolved)))
  
        ;; Check for an entry in the system library
!       (if (and file
               (not syslibp)
               (idlwave-syslib-p file))
          (setq syslibp t))
! 
        ;; If there's more than one matching entry for the same file, just
        ;; append the type-cons to the type list.
        (if (setq entry (assoc key alist))
          (push type-cons (nth 2 entry))
        (push (list key file (list type-cons)) alist)))
! 
      (setq alist (nreverse alist))
! 
      (when syslibp
        ;; File is in system *library* - remove any 'system entry
        (setq alist (delq (assq 'system alist) alist)))
! 
      ;; If 'system remains and we've scanned the syslib, it's a builtin
      ;; (rather than a !DIR/lib/.pro file bundled as source).
      (when (and (idlwave-syslib-scanned-p)
--- 8341,8363 ----
                      (t 'unresolved)))
  
        ;; Check for an entry in the system library
!       (if (and file 
               (not syslibp)
               (idlwave-syslib-p file))
          (setq syslibp t))
!       
        ;; If there's more than one matching entry for the same file, just
        ;; append the type-cons to the type list.
        (if (setq entry (assoc key alist))
          (push type-cons (nth 2 entry))
        (push (list key file (list type-cons)) alist)))
!     
      (setq alist (nreverse alist))
!     
      (when syslibp
        ;; File is in system *library* - remove any 'system entry
        (setq alist (delq (assq 'system alist) alist)))
!     
      ;; If 'system remains and we've scanned the syslib, it's a builtin
      ;; (rather than a !DIR/lib/.pro file bundled as source).
      (when (and (idlwave-syslib-scanned-p)
***************
*** 8333,8339 ****
        (setcar entry 'builtin))
      (sort alist 'idlwave-routine-twin-compare)))
  
- (defvar name)
  (defvar type)
  (defvar class)
  (defvar idlwave-sort-prefer-buffer-info t
--- 8365,8370 ----
***************
*** 8362,8368 ****
       ((not (eq type (nth 1 b)))
        ;; Type decides
        (< (if (eq type 'fun) 1 0) (if (eq (nth 1 b) 'fun) 1 0)))
!      (t
        ;; A and B are twins - so the decision is more complicated.
        ;; Call twin-compare with the proper arguments.
        (idlwave-routine-entry-compare-twins a b)))))
--- 8393,8399 ----
       ((not (eq type (nth 1 b)))
        ;; Type decides
        (< (if (eq type 'fun) 1 0) (if (eq (nth 1 b) 'fun) 1 0)))
!      (t       
        ;; A and B are twins - so the decision is more complicated.
        ;; Call twin-compare with the proper arguments.
        (idlwave-routine-entry-compare-twins a b)))))
***************
*** 8414,8420 ****
         (tpath-alist (idlwave-true-path-alist))
         (apathp (and (stringp akey)
                      (assoc (file-name-directory akey) tpath-alist)))
!        (bpathp (and (stringp bkey)
                      (assoc (file-name-directory bkey) tpath-alist)))
         ;; How early on search path?  High number means early since we
         ;; measure the tail of the path list
--- 8445,8451 ----
         (tpath-alist (idlwave-true-path-alist))
         (apathp (and (stringp akey)
                      (assoc (file-name-directory akey) tpath-alist)))
!        (bpathp (and (stringp bkey) 
                      (assoc (file-name-directory bkey) tpath-alist)))
         ;; How early on search path?  High number means early since we
         ;; measure the tail of the path list
***************
*** 8450,8456 ****
       (t                                nil))))        ; Default
  
  (defun idlwave-routine-source-file (source)
!   (if (nth 2 source)
        (expand-file-name (nth 1 source) (nth 2 source))
      (nth 1 source)))
  
--- 8481,8487 ----
       (t                                nil))))        ; Default
  
  (defun idlwave-routine-source-file (source)
!   (if (nth 2 source) 
        (expand-file-name (nth 1 source) (nth 2 source))
      (nth 1 source)))
  
***************
*** 8540,8546 ****
    (forward-sexp 2)
    (forward-sexp -1)
    (let ((begin (point)))
!     (re-search-forward
       "[a-zA-Z_][a-zA-Z0-9$_]+\\(::[a-zA-Z_][a-zA-Z0-9$_]+\\)?")
      (if (fboundp 'buffer-substring-no-properties)
          (buffer-substring-no-properties begin (point))
--- 8571,8577 ----
    (forward-sexp 2)
    (forward-sexp -1)
    (let ((begin (point)))
!     (re-search-forward 
       "[a-zA-Z_][a-zA-Z0-9$_]+\\(::[a-zA-Z_][a-zA-Z0-9$_]+\\)?")
      (if (fboundp 'buffer-substring-no-properties)
          (buffer-substring-no-properties begin (point))
***************
*** 8580,8591 ****
    (start-process "idldeclient" nil
                 idlwave-shell-explicit-file-name "-c" "-e"
                   (buffer-file-name) "&"))
! 
  (defun idlwave-launch-idlhelp ()
    "Start the IDLhelp application."
    (interactive)
    (start-process "idlhelp" nil idlwave-help-application))
! 
  ;; Menus - using easymenu.el
  (defvar idlwave-mode-menu-def
    `("IDLWAVE"
--- 8611,8622 ----
    (start-process "idldeclient" nil
                 idlwave-shell-explicit-file-name "-c" "-e"
                   (buffer-file-name) "&"))
!                 
  (defun idlwave-launch-idlhelp ()
    "Start the IDLhelp application."
    (interactive)
    (start-process "idlhelp" nil idlwave-help-application))
!  
  ;; Menus - using easymenu.el
  (defvar idlwave-mode-menu-def
    `("IDLWAVE"
***************
*** 8672,8678 ****
      ("Customize"
       ["Browse IDLWAVE Group" idlwave-customize t]
       "--"
!      ["Build Full Customize Menu" idlwave-create-customize-menu
        (fboundp 'customize-menu-create)])
      ("Documentation"
       ["Describe Mode" describe-mode t]
--- 8703,8709 ----
      ("Customize"
       ["Browse IDLWAVE Group" idlwave-customize t]
       "--"
!      ["Build Full Customize Menu" idlwave-create-customize-menu 
        (fboundp 'customize-menu-create)])
      ("Documentation"
       ["Describe Mode" describe-mode t]
***************
*** 8689,8710 ****
    '("Debug"
      ["Start IDL shell" idlwave-shell t]
      ["Save and .RUN buffer" idlwave-shell-save-and-run
!      (and (boundp 'idlwave-shell-automatic-start)
          idlwave-shell-automatic-start)]))
  
  (if (or (featurep 'easymenu) (load "easymenu" t))
      (progn
!       (easy-menu-define idlwave-mode-menu idlwave-mode-map
!                       "IDL and WAVE CL editing menu"
                        idlwave-mode-menu-def)
!       (easy-menu-define idlwave-mode-debug-menu idlwave-mode-map
!                       "IDL and WAVE CL editing menu"
                        idlwave-mode-debug-menu-def)))
  
  (defun idlwave-customize ()
    "Call the customize function with idlwave as argument."
    (interactive)
!   ;; Try to load the code for the shell, so that we can customize it
    ;; as well.
    (or (featurep 'idlw-shell)
        (load "idlw-shell" t))
--- 8720,8741 ----
    '("Debug"
      ["Start IDL shell" idlwave-shell t]
      ["Save and .RUN buffer" idlwave-shell-save-and-run
!      (and (boundp 'idlwave-shell-automatic-start) 
          idlwave-shell-automatic-start)]))
  
  (if (or (featurep 'easymenu) (load "easymenu" t))
      (progn
!       (easy-menu-define idlwave-mode-menu idlwave-mode-map 
!                       "IDL and WAVE CL editing menu" 
                        idlwave-mode-menu-def)
!       (easy-menu-define idlwave-mode-debug-menu idlwave-mode-map 
!                       "IDL and WAVE CL editing menu" 
                        idlwave-mode-debug-menu-def)))
  
  (defun idlwave-customize ()
    "Call the customize function with idlwave as argument."
    (interactive)
!   ;; Try to load the code for the shell, so that we can customize it 
    ;; as well.
    (or (featurep 'idlw-shell)
        (load "idlw-shell" t))
***************
*** 8715,8725 ****
    (interactive)
    (if (fboundp 'customize-menu-create)
        (progn
!       ;; Try to load the code for the shell, so that we can customize it
        ;; as well.
        (or (featurep 'idlw-shell)
            (load "idlw-shell" t))
!       (easy-menu-change
         '("IDLWAVE") "Customize"
         `(["Browse IDLWAVE group" idlwave-customize t]
           "--"
--- 8746,8756 ----
    (interactive)
    (if (fboundp 'customize-menu-create)
        (progn
!       ;; Try to load the code for the shell, so that we can customize it 
        ;; as well.
        (or (featurep 'idlw-shell)
            (load "idlw-shell" t))
!       (easy-menu-change 
         '("IDLWAVE") "Customize"
         `(["Browse IDLWAVE group" idlwave-customize t]
           "--"
***************
*** 8767,8773 ****
    (let ((table (symbol-value 'idlwave-mode-abbrev-table))
        abbrevs
        str rpl func fmt (len-str 0) (len-rpl 0))
!     (mapatoms
       (lambda (sym)
         (if (symbol-value sym)
           (progn
--- 8798,8804 ----
    (let ((table (symbol-value 'idlwave-mode-abbrev-table))
        abbrevs
        str rpl func fmt (len-str 0) (len-rpl 0))
!     (mapatoms 
       (lambda (sym)
         (if (symbol-value sym)
           (progn
***************
*** 8793,8799 ****
      (with-output-to-temp-buffer "*Help*"
        (if arg
          (progn
!           (princ "Abbreviations and Actions in IDLWAVE-Mode\n")
            (princ "=========================================\n\n")
            (princ (format fmt "KEY" "REPLACE" "HOOK"))
            (princ (format fmt "---" "-------" "----")))
--- 8824,8830 ----
      (with-output-to-temp-buffer "*Help*"
        (if arg
          (progn
!           (princ "Abbreviations and Actions in IDLWAVE-Mode\n") 
            (princ "=========================================\n\n")
            (princ (format fmt "KEY" "REPLACE" "HOOK"))
            (princ (format fmt "---" "-------" "----")))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]