Show
Ignore:
Timestamp:
09/18/06 20:48:14 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/progmodes/idlwave.el

    r4079 r4166  
    7676;; SOURCE). 
    7777;; 
    78 ;;  
     78;; 
    7979;; ACKNOWLEDGMENTS 
    8080;; =============== 
     
    126126;;   point backward, e.g., "\cl" expanded with a space becomes 
    127127;;   "LONG( )" with point before the close paren.  This is solved by 
    128 ;;   using a temporary function in `post-command-hook' - not pretty,  
     128;;   using a temporary function in `post-command-hook' - not pretty, 
    129129;;   but it works. 
    130130;; 
     
    179179    ;; We have the old or no custom-library, hack around it! 
    180180    (defmacro defgroup (&rest args) nil) 
    181     (defmacro defcustom (var value doc &rest args)  
     181    (defmacro defcustom (var value doc &rest args) 
    182182      `(defvar ,var ,value ,doc)))) 
    183183 
     
    185185  "Major mode for editing IDL .pro files." 
    186186  :tag "IDLWAVE" 
    187   :link '(url-link :tag "Home Page"  
     187  :link '(url-link :tag "Home Page" 
    188188                   "http://idlwave.org") 
    189189  :link '(emacs-commentary-link :tag "Commentary in idlw-shell.el" 
     
    299299(defcustom idlwave-auto-fill-split-string t 
    300300  "*If non-nil then auto fill will split strings with the IDL `+' operator. 
    301 When the line end falls within a string, string concatenation with the  
    302 '+' operator will be used to distribute a long string over lines.   
     301When the line end falls within a string, string concatenation with the 
     302'+' operator will be used to distribute a long string over lines. 
    303303If nil and a string is split then a terminal beep and warning are issued. 
    304304 
     
    419419               (const :tag "After a buffer was killed" kill-buffer) 
    420420               (const :tag "After a buffer was compiled successfully, update shell info" compile-buffer)))) 
    421                 
     421 
    422422(defcustom idlwave-rinfo-max-source-lines 5 
    423423  "*Maximum number of source files displayed in the Routine Info window. 
     
    454454 
    455455;; Configuration files 
    456 (defcustom idlwave-config-directory  
     456(defcustom idlwave-config-directory 
    457457  (convert-standard-filename "~/.idlwave") 
    458458  "*Directory for configuration files and user-library catalog." 
     
    470470  "Alist of regular expressions matching special library directories. 
    471471When listing routine source locations, IDLWAVE gives a short hint where 
    472 the file defining the routine is located.  By default it lists `SystemLib'  
     472the file defining the routine is located.  By default it lists `SystemLib' 
    473473for routines in the system library `!DIR/lib' and `Library' for anything 
    474474else.  This variable can define additional types.  The car of each entry 
     
    481481 
    482482(defcustom idlwave-auto-write-paths t 
    483   "Write out path (!PATH) and system directory (!DIR) info automatically.   
     483  "Write out path (!PATH) and system directory (!DIR) info automatically. 
    484484Path info is needed to locate library catalog files.  If non-nil, 
    485485whenever the path-list changes as a result of shell-query, etc., it is 
     
    512512words inserted into the buffer by completion.  The preferred case can 
    513513be specified separately for routine names, keywords, classes and 
    514 methods.  
     514methods. 
    515515This alist should therefore have entries for `routine' (normal 
    516516functions and procedures, i.e. non-methods), `keyword', `class', and 
     
    599599  :group 'idlwave-routine-info 
    600600  :type '(repeat (regexp :tag "Match method:"))) 
    601    
     601 
    602602 
    603603(defcustom idlwave-completion-show-classes 1 
     
    664664completion, respectively. 
    665665 
    666 The alist may have additional entries specifying exceptions from the  
     666The alist may have additional entries specifying exceptions from the 
    667667keyword completion rule for specific methods, like INIT or 
    668668GETPROPERTY.  In order to turn on class specification for the INIT 
     
    688688 
    689689When you specify a class, this information can be stored as a text 
    690 property on the `->' arrow in the source code, so that during the same  
     690property on the `->' arrow in the source code, so that during the same 
    691691editing session, IDLWAVE will not have to ask again.  When this 
    692692variable is non-nil, IDLWAVE will store and reuse the class information. 
     
    10661066  :type 'boolean) 
    10671067 
    1068 (defcustom idlwave-default-font-lock-items  
     1068(defcustom idlwave-default-font-lock-items 
    10691069  '(pros-and-functions batch-files idlwave-idl-keywords label goto 
    10701070                       common-blocks class-arrows) 
     
    11281128 
    11291129;; The following are the reserved words in IDL.  Maybe we should 
    1130 ;; highlight some more stuff as well?        
     1130;; highlight some more stuff as well? 
    11311131;; Procedure declarations.  Fontify keyword plus procedure name. 
    11321132(defvar idlwave-idl-keywords 
    1133   ;; To update this regexp, update the list of keywords and  
     1133  ;; To update this regexp, update the list of keywords and 
    11341134  ;; evaluate the form. 
    1135   ;;    (insert  
     1135  ;;    (insert 
    11361136  ;;     (prin1-to-string 
    1137   ;;      (concat  
     1137  ;;      (concat 
    11381138  ;;       "\\<\\(" 
    1139   ;;       (regexp-opt  
     1139  ;;       (regexp-opt 
    11401140  ;;        '("||" "&&" "and" "or" "xor" "not" 
    1141   ;;          "eq" "ge" "gt" "le" "lt" "ne"  
     1141  ;;          "eq" "ge" "gt" "le" "lt" "ne" 
    11421142  ;;          "for" "do" "endfor" 
    1143   ;;          "if" "then" "endif" "else" "endelse"  
     1143  ;;          "if" "then" "endif" "else" "endelse" 
    11441144  ;;          "case" "of" "endcase" 
    11451145  ;;          "switch" "break" "continue" "endswitch" 
    11461146  ;;          "begin" "end" 
    11471147  ;;          "repeat" "until" "endrep" 
    1148   ;;          "while" "endwhile"  
     1148  ;;          "while" "endwhile" 
    11491149  ;;          "goto" "return" 
    11501150  ;;          "inherits" "mod" 
     
    11691169          ("[ \t]*\\(\\sw+\\)[ ,]*" 
    11701170           ;; Start with point after block name and comma 
    1171            (goto-char (match-end 0))  ; needed for XEmacs, could be nil  
     1171           (goto-char (match-end 0))  ; needed for XEmacs, could be nil 
    11721172           nil 
    11731173           (1 font-lock-variable-name-face)       ; variable names 
     
    12241224       (all-operators 
    12251225        '("[-*^#+<>/]" (0 font-lock-keyword-face))) 
    1226          
     1226 
    12271227       ;; Arrows with text property `idlwave-class' 
    12281228       (class-arrows 
     
    12611261(defvar idlwave-font-lock-defaults 
    12621262  '((idlwave-font-lock-keywords 
    1263      idlwave-font-lock-keywords-1  
     1263     idlwave-font-lock-keywords-1 
    12641264     idlwave-font-lock-keywords-2 
    12651265     idlwave-font-lock-keywords-3) 
    1266     nil t  
    1267     ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w"))  
     1266    nil t 
     1267    ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w")) 
    12681268    beginning-of-line)) 
    12691269 
    1270 (put 'idlwave-mode 'font-lock-defaults  
     1270(put 'idlwave-mode 'font-lock-defaults 
    12711271     idlwave-font-lock-defaults) ; XEmacs 
    12721272 
     
    12761276only by whitespace.") 
    12771277 
    1278 (defconst idlwave-begin-block-reg  
     1278(defconst idlwave-begin-block-reg 
    12791279  "\\<\\(pro\\|function\\|begin\\|case\\|switch\\)\\>" 
    12801280  "Regular expression to find the beginning of a block. The case does 
     
    13531353   '(case . ("case\\>" nil)) 
    13541354   '(switch . ("switch\\>" nil)) 
    1355    (cons 'call (list (concat "\\(" idlwave-variable "\\) *= *"  
     1355   (cons 'call (list (concat "\\(" idlwave-variable "\\) *= *" 
    13561356                             "\\(" idlwave-method-call "\\s *\\)?" 
    13571357                             idlwave-identifier 
    13581358                             "\\s *(") nil)) 
    1359    (cons 'call (list (concat  
     1359   (cons 'call (list (concat 
    13601360                      "\\(" idlwave-method-call "\\s *\\)?" 
    1361                       idlwave-identifier  
     1361                      idlwave-identifier 
    13621362                      "\\( *\\($\\|\\$\\)\\|\\s *,\\)") nil)) 
    1363    (cons 'assign (list (concat  
     1363   (cons 'assign (list (concat 
    13641364                        "\\(" idlwave-variable "\\) *=") nil))) 
    1365    
     1365 
    13661366  "Associated list of statement matching regular expressions. 
    13671367Each regular expression matches the start of an IDL statement.  The 
     
    13861386;; of length one rather than a single character. 
    13871387;; The code in this file accepts either format for compatibility. 
    1388 (defvar idlwave-comment-indent-char ?\  
     1388(defvar idlwave-comment-indent-char ?\ 
    13891389  "Character to be inserted for IDL comment indentation. 
    13901390Normally a space.") 
     
    15581558  ;; Bind the debug commands also with the special modifiers. 
    15591559  (let ((shift (memq 'shift idlwave-shell-debug-modifiers)) 
    1560         (mods-noshift (delq 'shift  
     1560        (mods-noshift (delq 'shift 
    15611561                            (copy-sequence idlwave-shell-debug-modifiers)))) 
    1562     (define-key idlwave-mode-map  
     1562    (define-key idlwave-mode-map 
    15631563      (vector (append mods-noshift (list (if shift ?C ?c)))) 
    15641564      'idlwave-shell-save-and-run) 
    1565     (define-key idlwave-mode-map  
     1565    (define-key idlwave-mode-map 
    15661566      (vector (append mods-noshift (list (if shift ?B ?b)))) 
    15671567      'idlwave-shell-break-here) 
    1568     (define-key idlwave-mode-map  
     1568    (define-key idlwave-mode-map 
    15691569      (vector (append mods-noshift (list (if shift ?E ?e)))) 
    15701570      'idlwave-shell-run-region))) 
     
    16031603(define-key idlwave-mode-map "\C-c\C-i" 'idlwave-update-routine-info) 
    16041604(define-key idlwave-mode-map "\C-c="    'idlwave-resolve) 
    1605 (define-key idlwave-mode-map  
     1605(define-key idlwave-mode-map 
    16061606  (if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)]) 
    16071607  'idlwave-mouse-context-help) 
     
    16181618(idlwave-action-and-binding "="  '(idlwave-expand-equal -1 -1)) 
    16191619 
    1620 ;; Actions for > and < are complicated by >=, <=, and ->...  
     1620;; Actions for > and < are complicated by >=, <=, and ->... 
    16211621(idlwave-action-and-binding "<"  '(idlwave-custom-ltgtr-surround nil)) 
    16221622(idlwave-action-and-binding ">"  '(idlwave-custom-ltgtr-surround 'gtr)) 
     
    16511651 
    16521652(condition-case nil 
    1653     (modify-syntax-entry (string-to-char idlwave-abbrev-start-char)  
     1653    (modify-syntax-entry (string-to-char idlwave-abbrev-start-char) 
    16541654                         "w" idlwave-mode-syntax-table) 
    16551655  (error nil)) 
     
    17751775(defvar imenu-prev-index-position-function) 
    17761776;; defined later - so just make the compiler hush 
    1777 (defvar idlwave-mode-menu)   
     1777(defvar idlwave-mode-menu) 
    17781778(defvar idlwave-mode-debug-menu) 
    17791779 
     
    18591859   \\elif      IF-ELSE statement template 
    18601860   \\b         BEGIN 
    1861     
     1861 
    18621862   For a full list, use \\[idlwave-list-abbrevs].  Some templates also 
    18631863   have direct keybindings - see the list of keybindings below. 
     
    19011901  (interactive) 
    19021902  (kill-all-local-variables) 
    1903    
     1903 
    19041904  (if idlwave-startup-message 
    19051905      (message "Emacs IDLWAVE mode version %s." idlwave-mode-version)) 
    19061906  (setq idlwave-startup-message nil) 
    1907    
     1907 
    19081908  (setq local-abbrev-table idlwave-mode-abbrev-table) 
    19091909  (set-syntax-table idlwave-mode-syntax-table) 
    1910    
     1910 
    19111911  (set (make-local-variable 'indent-line-function) 'idlwave-indent-and-action) 
    1912    
     1912 
    19131913  (make-local-variable idlwave-comment-indent-function) 
    19141914  (set idlwave-comment-indent-function 'idlwave-comment-hook) 
    1915    
     1915 
    19161916  (set (make-local-variable 'comment-start-skip) ";+[ \t]*") 
    19171917  (set (make-local-variable 'comment-start) ";") 
     
    19211921  (set (make-local-variable 'indent-tabs-mode) nil) 
    19221922  (set (make-local-variable 'completion-ignore-case) t) 
    1923    
     1923 
    19241924  (use-local-map idlwave-mode-map) 
    19251925 
     
    19311931  (setq major-mode 'idlwave-mode) 
    19321932  (setq abbrev-mode t) 
    1933    
     1933 
    19341934  (set (make-local-variable idlwave-fill-function) 'idlwave-auto-fill) 
    19351935  (setq comment-end "") 
    19361936  (set (make-local-variable 'comment-multi-line) nil) 
    1937   (set (make-local-variable 'paragraph-separate)  
     1937  (set (make-local-variable 'paragraph-separate) 
    19381938       "[ \t\f]*$\\|[ \t]*;+[ \t]*$\\|;+[+=-_*]+$") 
    19391939  (set (make-local-variable 'paragraph-start) "[ \t\f]\\|[ \t]*;+[ \t]") 
     
    19441944  (if (boundp 'tag-table-alist) 
    19451945      (add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS"))) 
    1946    
     1946 
    19471947  ;; Font-lock additions - originally Phil Williams, then Ulrik Dickow 
    19481948  ;; Following line is for Emacs - XEmacs uses the corresponding property 
     
    19691969                     ";" 
    19701970                     'idlwave-forward-block nil)) 
    1971    
     1971 
    19721972 
    19731973  ;; Make a local post-command-hook and add our hook to it 
     
    20012001    (if (not (file-directory-p idlwave-config-directory)) 
    20022002        (make-directory idlwave-config-directory)) 
    2003     (setq  
    2004      idlwave-user-catalog-file (expand-file-name  
    2005                                 idlwave-user-catalog-file  
     2003    (setq 
     2004     idlwave-user-catalog-file (expand-file-name 
     2005                                idlwave-user-catalog-file 
    20062006                                idlwave-config-directory) 
    2007      idlwave-xml-system-rinfo-converted-file  
    2008      (expand-file-name  
     2007     idlwave-xml-system-rinfo-converted-file 
     2008     (expand-file-name 
    20092009      idlwave-xml-system-rinfo-converted-file 
    20102010      idlwave-config-directory) 
    2011      idlwave-path-file (expand-file-name  
    2012                         idlwave-path-file  
     2011     idlwave-path-file (expand-file-name 
     2012                        idlwave-path-file 
    20132013                        idlwave-config-directory)) 
    20142014    (idlwave-read-paths)  ; we may need these early 
     
    20292029;; 
    20302030;; Code Formatting ---------------------------------------------------- 
    2031 ;;  
     2031;; 
    20322032 
    20332033(defun idlwave-hard-tab () 
     
    21722172            (setq end-pos pos)) 
    21732173        (goto-char end-pos) 
    2174         (setq end (buffer-substring  
     2174        (setq end (buffer-substring 
    21752175                   (progn 
    21762176                     (skip-chars-backward "a-zA-Z") 
     
    21942194           (t 
    21952195            (beep) 
    2196             (message "Warning: Shouldn't this be \"%s\" instead of \"%s\"?"  
     2196            (message "Warning: Shouldn't this be \"%s\" instead of \"%s\"?" 
    21972197                     end1 end) 
    21982198            (sit-for 1)))))))) 
     
    22062206        (assoc (downcase (match-string 0)) idlwave-block-matches)) 
    22072207       ((looking-at "begin\\>") 
    2208         (let ((limit (save-excursion  
    2209                        (idlwave-beginning-of-statement)  
     2208        (let ((limit (save-excursion 
     2209                       (idlwave-beginning-of-statement) 
    22102210                       (point)))) 
    22112211          (cond 
     
    24912491                     (idlwave-block-jump-out -1 'nomark) 
    24922492                     (point)))) 
    2493           (if (setq status (idlwave-find-key  
     2493          (if (setq status (idlwave-find-key 
    24942494                            idlwave-end-block-reg -1 'nomark eos)) 
    24952495              (idlwave-beginning-of-statement) 
     
    24992499                   (idlwave-block-jump-out 1 'nomark) 
    25002500                   (point)))) 
    2501         (if (setq status (idlwave-find-key  
     2501        (if (setq status (idlwave-find-key 
    25022502                          idlwave-begin-block-reg 1 'nomark eos)) 
    25032503            (idlwave-end-of-statement) 
     
    25132513    (goto-char (point-max)) 
    25142514    (if (re-search-backward idlwave-doclib-start nil t) 
    2515         (progn  
     2515        (progn 
    25162516          (setq beg (progn (beginning-of-line) (point))) 
    25172517          (if (re-search-forward idlwave-doclib-end nil t) 
     
    25462546    (if (re-search-backward idlwave-shell-prompt-pattern nil t) 
    25472547        (goto-char (match-end 0)))) 
    2548    (t   
     2548   (t 
    25492549    (if (save-excursion (forward-line -1) (idlwave-is-continuation-line)) 
    25502550        (idlwave-previous-statement) 
     
    26232623    (when (re-search-forward ".*&" lim t) 
    26242624      (goto-char (match-end 0)) 
    2625       (if (idlwave-quoted)  
     2625      (if (idlwave-quoted) 
    26262626          (goto-char save-point) 
    26272627        (if (eq (char-after (- (point) 2)) ?&) (goto-char save-point)))) 
     
    26402640  ;; - not followed by another ":" in explicit class, ala a->b::c 
    26412641  ;; As many in this mode, this function is heuristic and not an exact 
    2642   ;; parser.  
     2642  ;; parser. 
    26432643  (let* ((start (point)) 
    26442644         (eos (save-excursion (idlwave-end-of-statement) (point))) 
     
    27172717like assignment statements.  When nil, spaces are removed for keyword 
    27182718assignment.  Any other value keeps the current space around the `='. 
    2719 Limits in for loops are treated as keyword assignment.   
     2719Limits in for loops are treated as keyword assignment. 
    27202720 
    27212721Starting with IDL 6.0, a number of op= assignments are available. 
     
    27342734See `idlwave-surround'." 
    27352735  (if idlwave-surround-by-blank 
    2736       (let  
     2736      (let 
    27372737          ((non-an-ops "\\(##\\|\\*\\|\\+\\|-\\|/\\|<\\|>\\|\\^\\)\\=") 
    2738            (an-ops  
     2738           (an-ops 
    27392739            "\\s-\\(AND\\|EQ\\|GE\\|GT\\|LE\\|LT\\|MOD\\|NE\\|OR\\|XOR\\)\\=") 
    27402740           (len 1)) 
    2741          
    2742         (save-excursion  
     2741 
     2742        (save-excursion 
    27432743          (let ((case-fold-search t)) 
    27442744            (backward-char) 
    2745             (if (or  
     2745            (if (or 
    27462746                 (re-search-backward non-an-ops nil t) 
    27472747                 ;; Why doesn't ##? work for both? 
    2748                  (re-search-backward "\\(#\\)\\=" nil t))  
     2748                 (re-search-backward "\\(#\\)\\=" nil t)) 
    27492749                (setq len (1+ (length (match-string 1)))) 
    27502750              (when (re-search-backward an-ops nil t) 
    27512751                ;(setq begin nil) ; won't modify begin 
    27522752                (setq len (1+ (length (match-string 1)))))))) 
    2753          
    2754         (if (eq t idlwave-pad-keyword)   
     2753 
     2754        (if (eq t idlwave-pad-keyword) 
    27552755            ;; Everything gets padded equally 
    27562756            (idlwave-surround before after len) 
     
    27632763                        (nth 2 (idlwave-where))))) 
    27642764            (cond ((or (memq what '(function-keyword procedure-keyword)) 
    2765                        (memq (caar st) '(for pdef)))  
    2766                    (cond  
     2765                       (memq (caar st) '(for pdef))) 
     2766                   (cond 
    27672767                    ((null idlwave-pad-keyword) 
    27682768                     (idlwave-surround 0 0) 
     
    27702770                    (t))) ; leave any spaces alone 
    27712771                  (t (idlwave-surround before after len)))))))) 
    2772                
     2772 
    27732773 
    27742774(defun idlwave-indent-and-action (&optional arg) 
     
    27772777  (interactive "p") 
    27782778  (save-excursion 
    2779     (if (and idlwave-expand-generic-end  
    2780              (re-search-backward "\\<\\(end\\)\\s-*\\="  
     2779    (if (and idlwave-expand-generic-end 
     2780             (re-search-backward "\\<\\(end\\)\\s-*\\=" 
    27812781                                 (max 0 (- (point) 10)) t) 
    27822782             (looking-at "\\(end\\)\\([ \n\t]\\|\\'\\)")) 
     
    27882788    (setq arg current-prefix-arg) 
    27892789    (setq current-prefix-arg nil)) 
    2790   (if arg  
     2790  (if arg 
    27912791      (idlwave-indent-statement) 
    27922792    (idlwave-indent-line t))) 
     
    29232923                  (cond 
    29242924                   ;; Beginning of file 
    2925                    ((prog1  
     2925                   ((prog1 
    29262926                        (idlwave-previous-statement) 
    29272927                      (setq beg-prev-pos (point))) 
     
    29332933                   ;; Begin block 
    29342934                   ((idlwave-look-at idlwave-begin-block-reg t) 
    2935                     (+ (idlwave-min-current-statement-indent)  
     2935                    (+ (idlwave-min-current-statement-indent) 
    29362936                       idlwave-block-indent)) 
    29372937                   ;; End Block 
     
    29442944                      ;;                      idlwave-end-offset 
    29452945                      ;;                      idlwave-block-indent)) 
    2946                     
     2946 
    29472947                   ;; Default to current indent 
    29482948                   ((idlwave-current-statement-indent)))))) 
     
    29602960(defun idlwave-calculate-paren-indent (beg-reg end-reg close-exp) 
    29612961  "Calculate the continuation indent inside a paren group. 
    2962 Returns a cons-cell with (open . indent), where open is the  
     2962Returns a cons-cell with (open . indent), where open is the 
    29632963location of the open paren" 
    29642964  (let ((open (nth 1 (parse-partial-sexp beg-reg end-reg)))) 
     
    30013001           (beg-last-statement (save-excursion (idlwave-previous-statement) 
    30023002                                               (point))) 
    3003            (beg-reg (progn (idlwave-start-of-substatement 'pre)  
     3003           (beg-reg (progn (idlwave-start-of-substatement 'pre) 
    30043004                           (if (eq (line-beginning-position) end-reg) 
    30053005                               (goto-char beg-last-statement) 
     
    30083008                            idlwave-continuation-indent)) 
    30093009           fancy-nonparen-indent fancy-paren-indent) 
    3010       (cond  
     3010      (cond 
    30113011       ;; Align then with its matching if, etc. 
    30123012       ((let ((matchers '(("\\<if\\>" . "[ \t]*then") 
    30133013                          ("\\<\\(if\\|end\\(if\\)?\\)\\>" . "[ \t]*else") 
    30143014                          ("\\<\\(for\\|while\\)\\>" . "[ \t]*do") 
    3015                           ("\\<\\(repeat\\|end\\(rep\\)?\\)\\>" .  
     3015                          ("\\<\\(repeat\\|end\\(rep\\)?\\)\\>" . 
    30163016                           "[ \t]*until") 
    30173017                          ("\\<case\\>" . "[ \t]*of"))) 
    30183018              match cont-re) 
    30193019          (goto-char end-reg) 
    3020           (and  
     3020          (and 
    30213021           (setq cont-re 
    30223022                 (catch 'exit 
     
    30273027           (idlwave-find-key cont-re -1 'nomark beg-last-statement))) 
    30283028        (if (looking-at "end") ;; that one's special 
    3029             (- (idlwave-current-indent)  
     3029            (- (idlwave-current-indent) 
    30303030               (+ idlwave-block-indent idlwave-end-offset)) 
    30313031          (idlwave-current-indent))) 
     
    30533053                    (close-exp (progn 
    30543054                                 (goto-char end-reg) 
    3055                                  (skip-chars-forward " \t")  
     3055                                 (skip-chars-forward " \t") 
    30563056                                 (looking-at "\\s)"))) 
    30573057                    indent-cons) 
     
    30873087                       nil 
    30883088                     (current-column))) 
    3089                    
     3089 
    30903090                  ;; Continued assignment (with =): 
    30913091                  ((catch 'assign ; 
    30923092                     (while (looking-at "[^=\n\r]*\\(=\\)[ \t]*") 
    30933093                       (goto-char (match-end 0)) 
    3094                        (if (null (idlwave-what-function beg-reg))  
     3094                       (if (null (idlwave-what-function beg-reg)) 
    30953095                           (throw 'assign t)))) 
    30963096                   (unless (or 
     
    31543154         (case-fold-search t) 
    31553155         (limit (if (>= dir 0) (point-max) (point-min))) 
    3156          (block-limit (if (>= dir 0)  
     3156         (block-limit (if (>= dir 0) 
    31573157                          idlwave-begin-block-reg 
    31583158                        idlwave-end-block-reg)) 
     
    31653165                                idlwave-begin-unit-reg dir t limit) 
    31663166                             (end-of-line) 
    3167                              (idlwave-find-key  
     3167                             (idlwave-find-key 
    31683168                              idlwave-end-unit-reg dir t limit))) 
    31693169                         limit))) 
     
    31903190        (unless comm-or-empty (setq min (min min (idlwave-current-indent))))) 
    31913191      (if (or comm-or-empty (and end-reg (>= (point) end-reg))) 
    3192           min  
     3192          min 
    31933193        (min min (idlwave-current-indent)))))) 
    31943194 
     
    32173217  (let (p) 
    32183218    (save-excursion 
    3219       (or  
     3219      (or 
    32203220       (idlwave-look-at "\\<\\$") 
    32213221       (catch 'loop 
    3222          (while (and (looking-at "^[ \t]*\\(;.*\\)?$")  
     3222         (while (and (looking-at "^[ \t]*\\(;.*\\)?$") 
    32233223                     (eq (forward-line -1) 0)) 
    32243224           (if (setq p (idlwave-look-at "\\<\\$")) (throw 'loop p)))))))) 
     
    33183318                                        (point)))) 
    33193319               "[^;]")) 
    3320          
     3320 
    33213321        ;; Mark the beginning and end of the paragraph 
    33223322        (goto-char bcl) 
     
    33823382                (forward-line -1)) 
    33833383              ) 
    3384            
     3384 
    33853385          ;; No hang. Instead find minimum indentation of paragraph 
    33863386          ;; after first line. 
     
    34143414                 (current-column)) 
    34153415               indent)) 
    3416          
     3416 
    34173417        ;; try to keep point at its original place 
    34183418        (goto-char here) 
     
    34633463 
    34643464(defun idlwave-auto-fill () 
    3465   "Called to break lines in auto fill mode.   
     3465  "Called to break lines in auto fill mode. 
    34663466Only fills non-comment lines if `idlwave-fill-comment-line-only' is 
    34673467non-nil.  Places a continuation character at the end of the line if 
     
    36143614  (insert ", " (user-full-name)) 
    36153615  (if (boundp 'user-mail-address) 
    3616       (insert " <" user-mail-address ">")  
     3616      (insert " <" user-mail-address ">") 
    36173617    (insert " <" (user-login-name) "@" (system-name) ">")) 
    36183618  ;; Remove extra spaces from line 
     
    36403640        (progn 
    36413641          (goto-char beg) 
    3642           (if (re-search-forward  
     3642          (if (re-search-forward 
    36433643               (concat idlwave-doc-modifications-keyword ":") 
    36443644               end t) 
     
    37383738     (save-excursion 
    37393739       (forward-char) 
    3740        (re-search-backward (concat "\\(" idlwave-idl-keywords  
     3740       (re-search-backward (concat "\\(" idlwave-idl-keywords 
    37413741                                   "\\|[[(*+-/=,^><]\\)\\s-*\\*") limit t))))) 
    37423742 
     
    37843784      (if (stringp prompt) 
    37853785          (message prompt))))) 
    3786    
     3786 
    37873787(defun idlwave-rw-case (string) 
    37883788  "Make STRING have the case required by `idlwave-reserved-word-upcase'." 
     
    38023802  "Build skeleton IDL case statement." 
    38033803  (interactive) 
    3804   (idlwave-template  
     3804  (idlwave-template 
    38053805   (idlwave-rw-case "case") 
    38063806   (idlwave-rw-case " of\n\nendcase") 
     
    38103810  "Build skeleton IDL switch statement." 
    38113811  (interactive) 
    3812   (idlwave-template  
     3812  (idlwave-template 
    38133813   (idlwave-rw-case "switch") 
    38143814   (idlwave-rw-case " of\n\nendswitch") 
     
    38183818  "Build skeleton for loop statment." 
    38193819  (interactive) 
    3820   (idlwave-template  
     3820  (idlwave-template 
    38213821   (idlwave-rw-case "for") 
    38223822   (idlwave-rw-case " do begin\n\nendfor") 
     
    38333833(defun idlwave-procedure () 
    38343834  (interactive) 
    3835   (idlwave-template  
     3835  (idlwave-template 
    38363836   (idlwave-rw-case "pro") 
    38373837   (idlwave-rw-case "\n\nreturn\nend") 
     
    38403840(defun idlwave-function () 
    38413841  (interactive) 
    3842   (idlwave-template  
     3842  (idlwave-template 
    38433843   (idlwave-rw-case "function") 
    38443844   (idlwave-rw-case "\n\nreturn\nend") 
     
    38543854(defun idlwave-while () 
    38553855  (interactive) 
    3856   (idlwave-template  
     3856  (idlwave-template 
    38573857   (idlwave-rw-case "while") 
    38583858   (idlwave-rw-case " do begin\n\nendwhile") 
     
    39333933  "How many outlawed buffers have tag TAG?" 
    39343934  (length (delq nil 
    3935                 (mapcar  
    3936                  (lambda (x) (eq (cdr x) tag))  
     3935                (mapcar 
     3936                 (lambda (x) (eq (cdr x) tag)) 
    39373937                 idlwave-outlawed-buffers)))) 
    39383938 
     
    39483948               (kill-buffer (car entry)) 
    39493949               (incf cnt) 
    3950                (setq idlwave-outlawed-buffers  
     3950               (setq idlwave-outlawed-buffers 
    39513951                     (delq entry idlwave-outlawed-buffers))) 
    3952         (setq idlwave-outlawed-buffers  
     3952        (setq idlwave-outlawed-buffers 
    39533953              (delq entry idlwave-outlawed-buffers)))) 
    39543954    (message "%d buffer%s killed" cnt (if (= cnt 1) "" "s")))) 
     
    39623962    ;; Revoke license 
    39633963    (if entry 
    3964         (setq idlwave-outlawed-buffers  
     3964        (setq idlwave-outlawed-buffers 
    39653965              (delq entry idlwave-outlawed-buffers))) 
    39663966    ;; Remove this function from the hook. 
     
    39813981  ;; Find FILE on the scanned lib path and return a buffer visiting it 
    39823982  ;; This is for, e.g., finding source with no user catalog 
    3983   (cond  
     3983  (cond 
    39843984   ((null file) nil) 
    39853985   ((file-name-absolute-p file) file) 
     
    39963996  (let (directory directories cmd append status numdirs dir getsubdirs 
    39973997                  buffer save_buffer files numfiles item errbuf) 
    3998      
     3998 
    39993999    ;; 
    40004000    ;; Read list of directories 
     
    40484048                    (setq errbuf (get-buffer-create "*idltags-error*")) 
    40494049                    (setq status (+ status 
    4050                                     (if (eq 0 (call-process  
     4050                                    (if (eq 0 (call-process 
    40514051                                               "sh" nil errbuf nil "-c" 
    40524052                                               (concat cmd append item))) 
     
    40624062                  (setq item (nth numfiles files)) 
    40634063                  ))) 
    4064              
     4064 
    40654065            (setq numdirs (1+ numdirs)) 
    40664066            (setq dir (nth numdirs directories))) 
     
    40684068          (setq numdirs (1+ numdirs)) 
    40694069          (setq dir (nth numdirs directories))))) 
    4070      
     4070 
    40714071    (setq errbuf (get-buffer-create "*idltags-error*")) 
    40724072    (if (= status 0) 
     
    41444144  (if (or (not (fboundp 'gethash)) 
    41454145          (not (fboundp 'puthash))) 
    4146       (progn  
     4146      (progn 
    41474147        (require 'cl) 
    41484148        (or (fboundp 'puthash) 
     
    41634163      (loop for entry in entries 
    41644164        for var = (car entry) for size = (nth 1 entry) 
    4165         do (setcdr (symbol-value var)  
     4165        do (setcdr (symbol-value var) 
    41664166                   (make-hash-table ':size size ':test 'equal))) 
    41674167      (setq idlwave-sint-dirs nil 
     
    41734173      (loop for entry in entries 
    41744174        for var = (car entry) for size = (nth 1 entry) 
    4175         do (setcar (symbol-value var)  
     4175        do (setcar (symbol-value var) 
    41764176                   (make-hash-table ':size size ':test 'equal)))))) 
    41774177 
     
    42604260            (setq name (idlwave-sintern-method name set))) 
    42614261        (setq name (idlwave-sintern-routine name set))) 
    4262        
     4262 
    42634263      ;; The source 
    42644264      (let ((source-type (car source)) 
    42654265            (source-file  (nth 1 source)) 
    4266             (source-dir  (if default-dir   
     4266            (source-dir  (if default-dir 
    42674267                             (file-name-as-directory default-dir) 
    42684268                           (nth 2 source))) 
     
    42734273            (setq source-lib (idlwave-sintern-libname source-lib set))) 
    42744274        (setq source (list source-type source-file source-dir source-lib))) 
    4275        
     4275 
    42764276      ;; The keywords 
    42774277      (setq kwds (mapcar (lambda (x) 
     
    44084408          (not (file-regular-p idlwave-user-catalog-file))) 
    44094409      (error "No catalog has been produced yet")) 
    4410   (let* ((emacs (expand-file-name (invocation-name) (invocation-directory))) 
     4410  (let* ((emacs (concat invocation-directory invocation-name)) 
    44114411         (args (list "-batch" 
    44124412                     "-l" (expand-file-name "~/.emacs") 
    44134413                     "-l" "idlwave" 
    44144414                     "-f" "idlwave-rescan-catalog-directories")) 
    4415          (process (apply 'start-process "idlcat"  
     4415         (process (apply 'start-process "idlcat" 
    44164416                         nil emacs args))) 
    44174417    (setq idlwave-catalog-process process) 
    4418     (set-process-sentinel  
     4418    (set-process-sentinel 
    44194419     process 
    44204420     (lambda (pro why) 
     
    44334433;;  (system) | (lib pro_file dir "LIBNAME") | (user pro_file dir "USERLIB") | 
    44344434;;  (buffer pro_file dir) | (compiled pro_file dir) 
    4435 ;;   "calling_string" ("HELPFILE" (("KWD1" . link1) ...))  
     4435;;   "calling_string" ("HELPFILE" (("KWD1" . link1) ...)) 
    44364436;;                    ("HELPFILE2" (("KWD2" . link) ...)) ...) 
    44374437;; 
     
    44924492           ;; preparing work, load and renormalize everything anyway. 
    44934493           (override-idle (or arg idlwave-buffer-case-takes-precedence))) 
    4494        
     4494 
    44954495      (setq idlwave-buffer-routines nil 
    44964496            idlwave-compiled-routines nil 
     
    45034503                                     ((null idlwave-system-routines) t) 
    45044504                                     (t 'bufsh)))) 
    4505        
     4505 
    45064506      (if idlwave-buffer-case-takes-precedence 
    45074507          ;; We can safely scan the buffer stuff first 
     
    45184518             (ask-shell (and shell-is-running 
    45194519                             idlwave-query-shell-for-routine-info))) 
    4520        
     4520 
    45214521        ;; Load the library catalogs again, first re-scanning the path 
    4522         (when arg  
     4522        (when arg 
    45234523          (if shell-is-running 
    45244524              (idlwave-shell-send-command idlwave-shell-path-query 
     
    45404540            ;;    the shell might do it again. 
    45414541            (idlwave-concatenate-rinfo-lists nil 'run-hooks)) 
    4542        
     4542 
    45434543        (when ask-shell 
    45444544          ;; Ask the shell about the routines it knows of. 
     
    45774577  ;; disk.  As a last fallback, load the (likely outdated) idlw-rinfo 
    45784578  ;; file distributed with older IDLWAVE versions (<6.0) 
    4579   (unless (and (load idlwave-xml-system-rinfo-converted-file  
     4579  (unless (and (load idlwave-xml-system-rinfo-converted-file 
    45804580                     'noerror 'nomessage) 
    45814581               (idlwave-xml-system-routine-info-up-to-date)) 
     
    45834583    (condition-case nil 
    45844584        (idlwave-convert-xml-system-routine-info) 
    4585       (error  
    4586        (unless (load idlwave-xml-system-rinfo-converted-file  
     4585      (error 
     4586       (unless (load idlwave-xml-system-rinfo-converted-file 
    45874587                     'noerror 'nomessage) 
    45884588         (if idlwave-system-routines 
    4589              (message  
     4589             (message 
    45904590              "Failed to load converted routine info, using old conversion.") 
    4591            (message  
     4591           (message 
    45924592            "Failed to convert XML routine info, falling back on idlw-rinfo.") 
    45934593           (if (not (load "idlw-rinfo" 'noerror 'nomessage))