diff options
| author | Paul Eggert | 2006-09-12 16:43:25 +0000 |
|---|---|---|
| committer | Paul Eggert | 2006-09-12 16:43:25 +0000 |
| commit | 4b1aaa8b07cf2797b5a57e2a1fd88f3ec0aa41e2 (patch) | |
| tree | e00adba73d181d3d8b6a111ebfc856a0a3acc454 /lisp | |
| parent | afc05254f5403c9d977013c70e4391e7ac1643b6 (diff) | |
| download | emacs-4b1aaa8b07cf2797b5a57e2a1fd88f3ec0aa41e2.tar.gz emacs-4b1aaa8b07cf2797b5a57e2a1fd88f3ec0aa41e2.zip | |
* etc/NEWS: In terminal-oriented subshells, the EMACS environment
variable now defaults to Emacs's absolute file name, instead of
to "t".
* etc/PROBLEMS: Adjust tcsh advice for this.
* make-dist (EMACS): Exit and fail if the EMACS environment
variable is set to something other than an absolute file name.
* lisp/comint.el (comint-exec-1): Set EMACS to the full name of Emacs,
not to "t".
* lisp/progmodes/compile.el (compilation-start): Likewise.
* lisp/progmodes/idlwave.el (idlwave-rescan-asynchronously):
Don't use expand-file-name on invocation-directory, since this
might mishandle special characters in invocation-directory.
* man/faq.texi (Escape sequences in shell output): EMACS is now set
to Emacs's absolute file name, not to "t".
(^M in the shell buffer): Likewise.
* man/misc.texi (Interactive Shell): Likewise.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/comint.el | 3 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 3 | ||||
| -rw-r--r-- | lisp/progmodes/idlwave.el | 942 |
4 files changed, 484 insertions, 473 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7d38ae9f079..70149334770 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2006-09-12 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * comint.el (comint-exec-1): Set EMACS to the full name of Emacs, | ||
| 4 | not to "t". | ||
| 5 | * progmodes/compile.el (compilation-start): Likewise. | ||
| 6 | * progmodes/idlwave.el (idlwave-rescan-asynchronously): | ||
| 7 | Don't use expand-file-name on invocation-directory, since this | ||
| 8 | might mishandle special characters in invocation-directory. | ||
| 9 | |||
| 1 | 2006-09-12 Stefan Monnier <monnier@iro.umontreal.ca> | 10 | 2006-09-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 11 | ||
| 3 | * pcvs-defs.el: Remove * in defcustom's docstrings. | 12 | * pcvs-defs.el: Remove * in defcustom's docstrings. |
diff --git a/lisp/comint.el b/lisp/comint.el index eb5c9f28a4e..5e223ef8f18 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -765,7 +765,8 @@ buffer. The hook `comint-exec-hook' is run after each exec." | |||
| 765 | (format "COLUMNS=%d" (window-width))) | 765 | (format "COLUMNS=%d" (window-width))) |
| 766 | (list "TERM=emacs" | 766 | (list "TERM=emacs" |
| 767 | (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width)))) | 767 | (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width)))) |
| 768 | (if (getenv "EMACS") nil (list "EMACS=t")) | 768 | (unless (getenv "EMACS") |
| 769 | (list (concat "EMACS=" invocation-directory invocation-name))) | ||
| 769 | process-environment)) | 770 | process-environment)) |
| 770 | (default-directory | 771 | (default-directory |
| 771 | (if (file-accessible-directory-p default-directory) | 772 | (if (file-accessible-directory-p default-directory) |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index cfa871f0f09..f4dd0fb5597 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -1068,7 +1068,8 @@ Returns the compilation buffer created." | |||
| 1068 | (window-width)))) | 1068 | (window-width)))) |
| 1069 | ;; Set the EMACS variable, but | 1069 | ;; Set the EMACS variable, but |
| 1070 | ;; don't override users' setting of $EMACS. | 1070 | ;; don't override users' setting of $EMACS. |
| 1071 | (unless (getenv "EMACS") '("EMACS=t")) | 1071 | (unless (getenv "EMACS") |
| 1072 | (list (concat "EMACS=" invocation-directory invocation-name))) | ||
| 1072 | (copy-sequence process-environment)))) | 1073 | (copy-sequence process-environment)))) |
| 1073 | (set (make-local-variable 'compilation-arguments) | 1074 | (set (make-local-variable 'compilation-arguments) |
| 1074 | (list command mode name-function highlight-regexp)) | 1075 | (list command mode name-function highlight-regexp)) |
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 2f26c90ac21..52cfa602e59 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el | |||
| @@ -75,7 +75,7 @@ | |||
| 75 | ;; of the documentation is available from the maintainers webpage (see | 75 | ;; of the documentation is available from the maintainers webpage (see |
| 76 | ;; SOURCE). | 76 | ;; SOURCE). |
| 77 | ;; | 77 | ;; |
| 78 | ;; | 78 | ;; |
| 79 | ;; ACKNOWLEDGMENTS | 79 | ;; ACKNOWLEDGMENTS |
| 80 | ;; =============== | 80 | ;; =============== |
| 81 | ;; | 81 | ;; |
| @@ -125,7 +125,7 @@ | |||
| 125 | ;; up inserting the character that expanded the abbrev after moving | 125 | ;; up inserting the character that expanded the abbrev after moving |
| 126 | ;; point backward, e.g., "\cl" expanded with a space becomes | 126 | ;; point backward, e.g., "\cl" expanded with a space becomes |
| 127 | ;; "LONG( )" with point before the close paren. This is solved by | 127 | ;; "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, |
| 129 | ;; but it works. | 129 | ;; but it works. |
| 130 | ;; | 130 | ;; |
| 131 | ;; Tabs and spaces are treated equally as whitespace when filling a | 131 | ;; Tabs and spaces are treated equally as whitespace when filling a |
| @@ -178,13 +178,13 @@ | |||
| 178 | nil ;; We've got what we needed | 178 | nil ;; We've got what we needed |
| 179 | ;; We have the old or no custom-library, hack around it! | 179 | ;; We have the old or no custom-library, hack around it! |
| 180 | (defmacro defgroup (&rest args) nil) | 180 | (defmacro defgroup (&rest args) nil) |
| 181 | (defmacro defcustom (var value doc &rest args) | 181 | (defmacro defcustom (var value doc &rest args) |
| 182 | `(defvar ,var ,value ,doc)))) | 182 | `(defvar ,var ,value ,doc)))) |
| 183 | 183 | ||
| 184 | (defgroup idlwave nil | 184 | (defgroup idlwave nil |
| 185 | "Major mode for editing IDL .pro files." | 185 | "Major mode for editing IDL .pro files." |
| 186 | :tag "IDLWAVE" | 186 | :tag "IDLWAVE" |
| 187 | :link '(url-link :tag "Home Page" | 187 | :link '(url-link :tag "Home Page" |
| 188 | "http://idlwave.org") | 188 | "http://idlwave.org") |
| 189 | :link '(emacs-commentary-link :tag "Commentary in idlw-shell.el" | 189 | :link '(emacs-commentary-link :tag "Commentary in idlw-shell.el" |
| 190 | "idlw-shell.el") | 190 | "idlw-shell.el") |
| @@ -298,8 +298,8 @@ extends to the end of the match for the regular expression." | |||
| 298 | 298 | ||
| 299 | (defcustom idlwave-auto-fill-split-string t | 299 | (defcustom idlwave-auto-fill-split-string t |
| 300 | "*If non-nil then auto fill will split strings with the IDL `+' operator. | 300 | "*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 | 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. | 302 | '+' operator will be used to distribute a long string over lines. |
| 303 | If nil and a string is split then a terminal beep and warning are issued. | 303 | If nil and a string is split then a terminal beep and warning are issued. |
| 304 | 304 | ||
| 305 | This variable is ignored when `idlwave-fill-comment-line-only' is | 305 | This variable is ignored when `idlwave-fill-comment-line-only' is |
| @@ -418,7 +418,7 @@ t All available | |||
| 418 | (const :tag "When saving a buffer" save-buffer) | 418 | (const :tag "When saving a buffer" save-buffer) |
| 419 | (const :tag "After a buffer was killed" kill-buffer) | 419 | (const :tag "After a buffer was killed" kill-buffer) |
| 420 | (const :tag "After a buffer was compiled successfully, update shell info" compile-buffer)))) | 420 | (const :tag "After a buffer was compiled successfully, update shell info" compile-buffer)))) |
| 421 | 421 | ||
| 422 | (defcustom idlwave-rinfo-max-source-lines 5 | 422 | (defcustom idlwave-rinfo-max-source-lines 5 |
| 423 | "*Maximum number of source files displayed in the Routine Info window. | 423 | "*Maximum number of source files displayed in the Routine Info window. |
| 424 | When an integer, it is the maximum number of source files displayed. | 424 | When an integer, it is the maximum number of source files displayed. |
| @@ -453,7 +453,7 @@ value of `!DIR'. See also `idlwave-library-path'." | |||
| 453 | :type 'directory) | 453 | :type 'directory) |
| 454 | 454 | ||
| 455 | ;; Configuration files | 455 | ;; Configuration files |
| 456 | (defcustom idlwave-config-directory | 456 | (defcustom idlwave-config-directory |
| 457 | (convert-standard-filename "~/.idlwave") | 457 | (convert-standard-filename "~/.idlwave") |
| 458 | "*Directory for configuration files and user-library catalog." | 458 | "*Directory for configuration files and user-library catalog." |
| 459 | :group 'idlwave-routine-info | 459 | :group 'idlwave-routine-info |
| @@ -469,7 +469,7 @@ value of `!DIR'. See also `idlwave-library-path'." | |||
| 469 | (defcustom idlwave-special-lib-alist nil | 469 | (defcustom idlwave-special-lib-alist nil |
| 470 | "Alist of regular expressions matching special library directories. | 470 | "Alist of regular expressions matching special library directories. |
| 471 | When listing routine source locations, IDLWAVE gives a short hint where | 471 | When listing routine source locations, IDLWAVE gives a short hint where |
| 472 | the file defining the routine is located. By default it lists `SystemLib' | 472 | the file defining the routine is located. By default it lists `SystemLib' |
| 473 | for routines in the system library `!DIR/lib' and `Library' for anything | 473 | for routines in the system library `!DIR/lib' and `Library' for anything |
| 474 | else. This variable can define additional types. The car of each entry | 474 | else. This variable can define additional types. The car of each entry |
| 475 | is a regular expression matching the file name (they normally will match | 475 | is a regular expression matching the file name (they normally will match |
| @@ -480,7 +480,7 @@ chars are allowed." | |||
| 480 | (cons regexp string))) | 480 | (cons regexp string))) |
| 481 | 481 | ||
| 482 | (defcustom idlwave-auto-write-paths t | 482 | (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. |
| 484 | Path info is needed to locate library catalog files. If non-nil, | 484 | Path info is needed to locate library catalog files. If non-nil, |
| 485 | whenever the path-list changes as a result of shell-query, etc., it is | 485 | whenever the path-list changes as a result of shell-query, etc., it is |
| 486 | written to file. Otherwise, the menu option \"Write Paths\" can be | 486 | written to file. Otherwise, the menu option \"Write Paths\" can be |
| @@ -511,7 +511,7 @@ used to force a write." | |||
| 511 | This variable determines the case (UPPER/lower/Capitalized...) of | 511 | This variable determines the case (UPPER/lower/Capitalized...) of |
| 512 | words inserted into the buffer by completion. The preferred case can | 512 | words inserted into the buffer by completion. The preferred case can |
| 513 | be specified separately for routine names, keywords, classes and | 513 | be specified separately for routine names, keywords, classes and |
| 514 | methods. | 514 | methods. |
| 515 | This alist should therefore have entries for `routine' (normal | 515 | This alist should therefore have entries for `routine' (normal |
| 516 | functions and procedures, i.e. non-methods), `keyword', `class', and | 516 | functions and procedures, i.e. non-methods), `keyword', `class', and |
| 517 | `method'. Plausible values are | 517 | `method'. Plausible values are |
| @@ -598,7 +598,7 @@ certain methods this assumption is almost always true. The methods | |||
| 598 | for which to assume this can be set here." | 598 | for which to assume this can be set here." |
| 599 | :group 'idlwave-routine-info | 599 | :group 'idlwave-routine-info |
| 600 | :type '(repeat (regexp :tag "Match method:"))) | 600 | :type '(repeat (regexp :tag "Match method:"))) |
| 601 | 601 | ||
| 602 | 602 | ||
| 603 | (defcustom idlwave-completion-show-classes 1 | 603 | (defcustom idlwave-completion-show-classes 1 |
| 604 | "*Number of classes to show when completing object methods and keywords. | 604 | "*Number of classes to show when completing object methods and keywords. |
| @@ -663,7 +663,7 @@ should contain at least two elements: (method-default . VALUE) and | |||
| 663 | specify if the class should be found during method and keyword | 663 | specify if the class should be found during method and keyword |
| 664 | completion, respectively. | 664 | completion, respectively. |
| 665 | 665 | ||
| 666 | The alist may have additional entries specifying exceptions from the | 666 | The alist may have additional entries specifying exceptions from the |
| 667 | keyword completion rule for specific methods, like INIT or | 667 | keyword completion rule for specific methods, like INIT or |
| 668 | GETPROPERTY. In order to turn on class specification for the INIT | 668 | GETPROPERTY. In order to turn on class specification for the INIT |
| 669 | method, add an entry (\"INIT\" . t). The method name must be ALL-CAPS." | 669 | method, add an entry (\"INIT\" . t). The method name must be ALL-CAPS." |
| @@ -687,7 +687,7 @@ particular object method call. This happens during the commands | |||
| 687 | value of the variable `idlwave-query-class'. | 687 | value of the variable `idlwave-query-class'. |
| 688 | 688 | ||
| 689 | When you specify a class, this information can be stored as a text | 689 | When 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 | 690 | property on the `->' arrow in the source code, so that during the same |
| 691 | editing session, IDLWAVE will not have to ask again. When this | 691 | editing session, IDLWAVE will not have to ask again. When this |
| 692 | variable is non-nil, IDLWAVE will store and reuse the class information. | 692 | variable is non-nil, IDLWAVE will store and reuse the class information. |
| 693 | The class stored can be checked and removed with `\\[idlwave-routine-info]' | 693 | The class stored can be checked and removed with `\\[idlwave-routine-info]' |
| @@ -1065,7 +1065,7 @@ IDL process is made." | |||
| 1065 | :group 'idlwave-misc | 1065 | :group 'idlwave-misc |
| 1066 | :type 'boolean) | 1066 | :type 'boolean) |
| 1067 | 1067 | ||
| 1068 | (defcustom idlwave-default-font-lock-items | 1068 | (defcustom idlwave-default-font-lock-items |
| 1069 | '(pros-and-functions batch-files idlwave-idl-keywords label goto | 1069 | '(pros-and-functions batch-files idlwave-idl-keywords label goto |
| 1070 | common-blocks class-arrows) | 1070 | common-blocks class-arrows) |
| 1071 | "Items which should be fontified on the default fontification level 2. | 1071 | "Items which should be fontified on the default fontification level 2. |
| @@ -1127,25 +1127,25 @@ As a user, you should not set this to t.") | |||
| 1127 | ;;; and Carsten Dominik... | 1127 | ;;; and Carsten Dominik... |
| 1128 | 1128 | ||
| 1129 | ;; The following are the reserved words in IDL. Maybe we should | 1129 | ;; 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? |
| 1131 | ;; Procedure declarations. Fontify keyword plus procedure name. | 1131 | ;; Procedure declarations. Fontify keyword plus procedure name. |
| 1132 | (defvar idlwave-idl-keywords | 1132 | (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 |
| 1134 | ;; evaluate the form. | 1134 | ;; evaluate the form. |
| 1135 | ;; (insert | 1135 | ;; (insert |
| 1136 | ;; (prin1-to-string | 1136 | ;; (prin1-to-string |
| 1137 | ;; (concat | 1137 | ;; (concat |
| 1138 | ;; "\\<\\(" | 1138 | ;; "\\<\\(" |
| 1139 | ;; (regexp-opt | 1139 | ;; (regexp-opt |
| 1140 | ;; '("||" "&&" "and" "or" "xor" "not" | 1140 | ;; '("||" "&&" "and" "or" "xor" "not" |
| 1141 | ;; "eq" "ge" "gt" "le" "lt" "ne" | 1141 | ;; "eq" "ge" "gt" "le" "lt" "ne" |
| 1142 | ;; "for" "do" "endfor" | 1142 | ;; "for" "do" "endfor" |
| 1143 | ;; "if" "then" "endif" "else" "endelse" | 1143 | ;; "if" "then" "endif" "else" "endelse" |
| 1144 | ;; "case" "of" "endcase" | 1144 | ;; "case" "of" "endcase" |
| 1145 | ;; "switch" "break" "continue" "endswitch" | 1145 | ;; "switch" "break" "continue" "endswitch" |
| 1146 | ;; "begin" "end" | 1146 | ;; "begin" "end" |
| 1147 | ;; "repeat" "until" "endrep" | 1147 | ;; "repeat" "until" "endrep" |
| 1148 | ;; "while" "endwhile" | 1148 | ;; "while" "endwhile" |
| 1149 | ;; "goto" "return" | 1149 | ;; "goto" "return" |
| 1150 | ;; "inherits" "mod" | 1150 | ;; "inherits" "mod" |
| 1151 | ;; "compile_opt" "forward_function" | 1151 | ;; "compile_opt" "forward_function" |
| @@ -1168,7 +1168,7 @@ As a user, you should not set this to t.") | |||
| 1168 | (2 font-lock-reference-face nil t) ; block name | 1168 | (2 font-lock-reference-face nil t) ; block name |
| 1169 | ("[ \t]*\\(\\sw+\\)[ ,]*" | 1169 | ("[ \t]*\\(\\sw+\\)[ ,]*" |
| 1170 | ;; Start with point after block name and comma | 1170 | ;; 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 |
| 1172 | nil | 1172 | nil |
| 1173 | (1 font-lock-variable-name-face) ; variable names | 1173 | (1 font-lock-variable-name-face) ; variable names |
| 1174 | ))) | 1174 | ))) |
| @@ -1223,7 +1223,7 @@ As a user, you should not set this to t.") | |||
| 1223 | ;; All operators (not used because too noisy) | 1223 | ;; All operators (not used because too noisy) |
| 1224 | (all-operators | 1224 | (all-operators |
| 1225 | '("[-*^#+<>/]" (0 font-lock-keyword-face))) | 1225 | '("[-*^#+<>/]" (0 font-lock-keyword-face))) |
| 1226 | 1226 | ||
| 1227 | ;; Arrows with text property `idlwave-class' | 1227 | ;; Arrows with text property `idlwave-class' |
| 1228 | (class-arrows | 1228 | (class-arrows |
| 1229 | '(idlwave-match-class-arrows (0 idlwave-class-arrow-face)))) | 1229 | '(idlwave-match-class-arrows (0 idlwave-class-arrow-face)))) |
| @@ -1260,14 +1260,14 @@ As a user, you should not set this to t.") | |||
| 1260 | 1260 | ||
| 1261 | (defvar idlwave-font-lock-defaults | 1261 | (defvar idlwave-font-lock-defaults |
| 1262 | '((idlwave-font-lock-keywords | 1262 | '((idlwave-font-lock-keywords |
| 1263 | idlwave-font-lock-keywords-1 | 1263 | idlwave-font-lock-keywords-1 |
| 1264 | idlwave-font-lock-keywords-2 | 1264 | idlwave-font-lock-keywords-2 |
| 1265 | idlwave-font-lock-keywords-3) | 1265 | idlwave-font-lock-keywords-3) |
| 1266 | nil t | 1266 | nil t |
| 1267 | ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w")) | 1267 | ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w")) |
| 1268 | beginning-of-line)) | 1268 | beginning-of-line)) |
| 1269 | 1269 | ||
| 1270 | (put 'idlwave-mode 'font-lock-defaults | 1270 | (put 'idlwave-mode 'font-lock-defaults |
| 1271 | idlwave-font-lock-defaults) ; XEmacs | 1271 | idlwave-font-lock-defaults) ; XEmacs |
| 1272 | 1272 | ||
| 1273 | (defconst idlwave-comment-line-start-skip "^[ \t]*;" | 1273 | (defconst idlwave-comment-line-start-skip "^[ \t]*;" |
| @@ -1275,7 +1275,7 @@ As a user, you should not set this to t.") | |||
| 1275 | That is the _beginning_ of a line containing a comment delimiter `;' preceded | 1275 | That is the _beginning_ of a line containing a comment delimiter `;' preceded |
| 1276 | only by whitespace.") | 1276 | only by whitespace.") |
| 1277 | 1277 | ||
| 1278 | (defconst idlwave-begin-block-reg | 1278 | (defconst idlwave-begin-block-reg |
| 1279 | "\\<\\(pro\\|function\\|begin\\|case\\|switch\\)\\>" | 1279 | "\\<\\(pro\\|function\\|begin\\|case\\|switch\\)\\>" |
| 1280 | "Regular expression to find the beginning of a block. The case does | 1280 | "Regular expression to find the beginning of a block. The case does |
| 1281 | not matter. The search skips matches in comments.") | 1281 | not matter. The search skips matches in comments.") |
| @@ -1352,17 +1352,17 @@ blocks starting with a BEGIN statement. The matches must have associations | |||
| 1352 | '(goto . ("goto\\>" nil)) | 1352 | '(goto . ("goto\\>" nil)) |
| 1353 | '(case . ("case\\>" nil)) | 1353 | '(case . ("case\\>" nil)) |
| 1354 | '(switch . ("switch\\>" nil)) | 1354 | '(switch . ("switch\\>" nil)) |
| 1355 | (cons 'call (list (concat "\\(" idlwave-variable "\\) *= *" | 1355 | (cons 'call (list (concat "\\(" idlwave-variable "\\) *= *" |
| 1356 | "\\(" idlwave-method-call "\\s *\\)?" | 1356 | "\\(" idlwave-method-call "\\s *\\)?" |
| 1357 | idlwave-identifier | 1357 | idlwave-identifier |
| 1358 | "\\s *(") nil)) | 1358 | "\\s *(") nil)) |
| 1359 | (cons 'call (list (concat | 1359 | (cons 'call (list (concat |
| 1360 | "\\(" idlwave-method-call "\\s *\\)?" | 1360 | "\\(" idlwave-method-call "\\s *\\)?" |
| 1361 | idlwave-identifier | 1361 | idlwave-identifier |
| 1362 | "\\( *\\($\\|\\$\\)\\|\\s *,\\)") nil)) | 1362 | "\\( *\\($\\|\\$\\)\\|\\s *,\\)") nil)) |
| 1363 | (cons 'assign (list (concat | 1363 | (cons 'assign (list (concat |
| 1364 | "\\(" idlwave-variable "\\) *=") nil))) | 1364 | "\\(" idlwave-variable "\\) *=") nil))) |
| 1365 | 1365 | ||
| 1366 | "Associated list of statement matching regular expressions. | 1366 | "Associated list of statement matching regular expressions. |
| 1367 | Each regular expression matches the start of an IDL statement. The | 1367 | Each regular expression matches the start of an IDL statement. The |
| 1368 | first element of each association is a symbol giving the statement | 1368 | first element of each association is a symbol giving the statement |
| @@ -1385,7 +1385,7 @@ the leftover unidentified statements containing an equal sign." ) | |||
| 1385 | ;; Note that this is documented in the v18 manuals as being a string | 1385 | ;; Note that this is documented in the v18 manuals as being a string |
| 1386 | ;; of length one rather than a single character. | 1386 | ;; of length one rather than a single character. |
| 1387 | ;; The code in this file accepts either format for compatibility. | 1387 | ;; The code in this file accepts either format for compatibility. |
| 1388 | (defvar idlwave-comment-indent-char ?\ | 1388 | (defvar idlwave-comment-indent-char ?\ |
| 1389 | "Character to be inserted for IDL comment indentation. | 1389 | "Character to be inserted for IDL comment indentation. |
| 1390 | Normally a space.") | 1390 | Normally a space.") |
| 1391 | 1391 | ||
| @@ -1557,15 +1557,15 @@ Capitalize system variables - action only | |||
| 1557 | (not (equal idlwave-shell-debug-modifiers '()))) | 1557 | (not (equal idlwave-shell-debug-modifiers '()))) |
| 1558 | ;; Bind the debug commands also with the special modifiers. | 1558 | ;; Bind the debug commands also with the special modifiers. |
| 1559 | (let ((shift (memq 'shift idlwave-shell-debug-modifiers)) | 1559 | (let ((shift (memq 'shift idlwave-shell-debug-modifiers)) |
| 1560 | (mods-noshift (delq 'shift | 1560 | (mods-noshift (delq 'shift |
| 1561 | (copy-sequence idlwave-shell-debug-modifiers)))) | 1561 | (copy-sequence idlwave-shell-debug-modifiers)))) |
| 1562 | (define-key idlwave-mode-map | 1562 | (define-key idlwave-mode-map |
| 1563 | (vector (append mods-noshift (list (if shift ?C ?c)))) | 1563 | (vector (append mods-noshift (list (if shift ?C ?c)))) |
| 1564 | 'idlwave-shell-save-and-run) | 1564 | 'idlwave-shell-save-and-run) |
| 1565 | (define-key idlwave-mode-map | 1565 | (define-key idlwave-mode-map |
| 1566 | (vector (append mods-noshift (list (if shift ?B ?b)))) | 1566 | (vector (append mods-noshift (list (if shift ?B ?b)))) |
| 1567 | 'idlwave-shell-break-here) | 1567 | 'idlwave-shell-break-here) |
| 1568 | (define-key idlwave-mode-map | 1568 | (define-key idlwave-mode-map |
| 1569 | (vector (append mods-noshift (list (if shift ?E ?e)))) | 1569 | (vector (append mods-noshift (list (if shift ?E ?e)))) |
| 1570 | 'idlwave-shell-run-region))) | 1570 | 'idlwave-shell-run-region))) |
| 1571 | (define-key idlwave-mode-map "\C-c\C-d\C-c" 'idlwave-shell-save-and-run) | 1571 | (define-key idlwave-mode-map "\C-c\C-d\C-c" 'idlwave-shell-save-and-run) |
| @@ -1602,7 +1602,7 @@ Capitalize system variables - action only | |||
| 1602 | (define-key idlwave-mode-map "\M-\C-i" 'idlwave-complete) | 1602 | (define-key idlwave-mode-map "\M-\C-i" 'idlwave-complete) |
| 1603 | (define-key idlwave-mode-map "\C-c\C-i" 'idlwave-update-routine-info) | 1603 | (define-key idlwave-mode-map "\C-c\C-i" 'idlwave-update-routine-info) |
| 1604 | (define-key idlwave-mode-map "\C-c=" 'idlwave-resolve) | 1604 | (define-key idlwave-mode-map "\C-c=" 'idlwave-resolve) |
| 1605 | (define-key idlwave-mode-map | 1605 | (define-key idlwave-mode-map |
| 1606 | (if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)]) | 1606 | (if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)]) |
| 1607 | 'idlwave-mouse-context-help) | 1607 | 'idlwave-mouse-context-help) |
| 1608 | 1608 | ||
| @@ -1617,7 +1617,7 @@ Capitalize system variables - action only | |||
| 1617 | ;; to go ahead of > and <, so >= and <= will be treated correctly | 1617 | ;; to go ahead of > and <, so >= and <= will be treated correctly |
| 1618 | (idlwave-action-and-binding "=" '(idlwave-expand-equal -1 -1)) | 1618 | (idlwave-action-and-binding "=" '(idlwave-expand-equal -1 -1)) |
| 1619 | 1619 | ||
| 1620 | ;; Actions for > and < are complicated by >=, <=, and ->... | 1620 | ;; Actions for > and < are complicated by >=, <=, and ->... |
| 1621 | (idlwave-action-and-binding "<" '(idlwave-custom-ltgtr-surround nil)) | 1621 | (idlwave-action-and-binding "<" '(idlwave-custom-ltgtr-surround nil)) |
| 1622 | (idlwave-action-and-binding ">" '(idlwave-custom-ltgtr-surround 'gtr)) | 1622 | (idlwave-action-and-binding ">" '(idlwave-custom-ltgtr-surround 'gtr)) |
| 1623 | 1623 | ||
| @@ -1650,7 +1650,7 @@ idlwave-mode-abbrev-table unless TABLE is non-nil." | |||
| 1650 | (error (apply 'define-abbrev args))))) | 1650 | (error (apply 'define-abbrev args))))) |
| 1651 | 1651 | ||
| 1652 | (condition-case nil | 1652 | (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) |
| 1654 | "w" idlwave-mode-syntax-table) | 1654 | "w" idlwave-mode-syntax-table) |
| 1655 | (error nil)) | 1655 | (error nil)) |
| 1656 | 1656 | ||
| @@ -1774,7 +1774,7 @@ idlwave-mode-abbrev-table unless TABLE is non-nil." | |||
| 1774 | (defvar imenu-extract-index-name-function) | 1774 | (defvar imenu-extract-index-name-function) |
| 1775 | (defvar imenu-prev-index-position-function) | 1775 | (defvar imenu-prev-index-position-function) |
| 1776 | ;; defined later - so just make the compiler hush | 1776 | ;; defined later - so just make the compiler hush |
| 1777 | (defvar idlwave-mode-menu) | 1777 | (defvar idlwave-mode-menu) |
| 1778 | (defvar idlwave-mode-debug-menu) | 1778 | (defvar idlwave-mode-debug-menu) |
| 1779 | 1779 | ||
| 1780 | ;;;###autoload | 1780 | ;;;###autoload |
| @@ -1858,7 +1858,7 @@ The main features of this mode are | |||
| 1858 | \\i IF statement template | 1858 | \\i IF statement template |
| 1859 | \\elif IF-ELSE statement template | 1859 | \\elif IF-ELSE statement template |
| 1860 | \\b BEGIN | 1860 | \\b BEGIN |
| 1861 | 1861 | ||
| 1862 | For a full list, use \\[idlwave-list-abbrevs]. Some templates also | 1862 | For a full list, use \\[idlwave-list-abbrevs]. Some templates also |
| 1863 | have direct keybindings - see the list of keybindings below. | 1863 | have direct keybindings - see the list of keybindings below. |
| 1864 | 1864 | ||
| @@ -1900,19 +1900,19 @@ The main features of this mode are | |||
| 1900 | 1900 | ||
| 1901 | (interactive) | 1901 | (interactive) |
| 1902 | (kill-all-local-variables) | 1902 | (kill-all-local-variables) |
| 1903 | 1903 | ||
| 1904 | (if idlwave-startup-message | 1904 | (if idlwave-startup-message |
| 1905 | (message "Emacs IDLWAVE mode version %s." idlwave-mode-version)) | 1905 | (message "Emacs IDLWAVE mode version %s." idlwave-mode-version)) |
| 1906 | (setq idlwave-startup-message nil) | 1906 | (setq idlwave-startup-message nil) |
| 1907 | 1907 | ||
| 1908 | (setq local-abbrev-table idlwave-mode-abbrev-table) | 1908 | (setq local-abbrev-table idlwave-mode-abbrev-table) |
| 1909 | (set-syntax-table idlwave-mode-syntax-table) | 1909 | (set-syntax-table idlwave-mode-syntax-table) |
| 1910 | 1910 | ||
| 1911 | (set (make-local-variable 'indent-line-function) 'idlwave-indent-and-action) | 1911 | (set (make-local-variable 'indent-line-function) 'idlwave-indent-and-action) |
| 1912 | 1912 | ||
| 1913 | (make-local-variable idlwave-comment-indent-function) | 1913 | (make-local-variable idlwave-comment-indent-function) |
| 1914 | (set idlwave-comment-indent-function 'idlwave-comment-hook) | 1914 | (set idlwave-comment-indent-function 'idlwave-comment-hook) |
| 1915 | 1915 | ||
| 1916 | (set (make-local-variable 'comment-start-skip) ";+[ \t]*") | 1916 | (set (make-local-variable 'comment-start-skip) ";+[ \t]*") |
| 1917 | (set (make-local-variable 'comment-start) ";") | 1917 | (set (make-local-variable 'comment-start) ";") |
| 1918 | (set (make-local-variable 'comment-add) 1) ; ";;" for new and regions | 1918 | (set (make-local-variable 'comment-add) 1) ; ";;" for new and regions |
| @@ -1920,7 +1920,7 @@ The main features of this mode are | |||
| 1920 | (set (make-local-variable 'abbrev-all-caps) t) | 1920 | (set (make-local-variable 'abbrev-all-caps) t) |
| 1921 | (set (make-local-variable 'indent-tabs-mode) nil) | 1921 | (set (make-local-variable 'indent-tabs-mode) nil) |
| 1922 | (set (make-local-variable 'completion-ignore-case) t) | 1922 | (set (make-local-variable 'completion-ignore-case) t) |
| 1923 | 1923 | ||
| 1924 | (use-local-map idlwave-mode-map) | 1924 | (use-local-map idlwave-mode-map) |
| 1925 | 1925 | ||
| 1926 | (when (featurep 'easymenu) | 1926 | (when (featurep 'easymenu) |
| @@ -1930,11 +1930,11 @@ The main features of this mode are | |||
| 1930 | (setq mode-name "IDLWAVE") | 1930 | (setq mode-name "IDLWAVE") |
| 1931 | (setq major-mode 'idlwave-mode) | 1931 | (setq major-mode 'idlwave-mode) |
| 1932 | (setq abbrev-mode t) | 1932 | (setq abbrev-mode t) |
| 1933 | 1933 | ||
| 1934 | (set (make-local-variable idlwave-fill-function) 'idlwave-auto-fill) | 1934 | (set (make-local-variable idlwave-fill-function) 'idlwave-auto-fill) |
| 1935 | (setq comment-end "") | 1935 | (setq comment-end "") |
| 1936 | (set (make-local-variable 'comment-multi-line) nil) | 1936 | (set (make-local-variable 'comment-multi-line) nil) |
| 1937 | (set (make-local-variable 'paragraph-separate) | 1937 | (set (make-local-variable 'paragraph-separate) |
| 1938 | "[ \t\f]*$\\|[ \t]*;+[ \t]*$\\|;+[+=-_*]+$") | 1938 | "[ \t\f]*$\\|[ \t]*;+[ \t]*$\\|;+[+=-_*]+$") |
| 1939 | (set (make-local-variable 'paragraph-start) "[ \t\f]\\|[ \t]*;+[ \t]") | 1939 | (set (make-local-variable 'paragraph-start) "[ \t\f]\\|[ \t]*;+[ \t]") |
| 1940 | (set (make-local-variable 'paragraph-ignore-fill-prefix) nil) | 1940 | (set (make-local-variable 'paragraph-ignore-fill-prefix) nil) |
| @@ -1943,7 +1943,7 @@ The main features of this mode are | |||
| 1943 | ;; Set tag table list to use IDLTAGS as file name. | 1943 | ;; Set tag table list to use IDLTAGS as file name. |
| 1944 | (if (boundp 'tag-table-alist) | 1944 | (if (boundp 'tag-table-alist) |
| 1945 | (add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS"))) | 1945 | (add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS"))) |
| 1946 | 1946 | ||
| 1947 | ;; Font-lock additions - originally Phil Williams, then Ulrik Dickow | 1947 | ;; Font-lock additions - originally Phil Williams, then Ulrik Dickow |
| 1948 | ;; Following line is for Emacs - XEmacs uses the corresponding property | 1948 | ;; Following line is for Emacs - XEmacs uses the corresponding property |
| 1949 | ;; on the `idlwave-mode' symbol. | 1949 | ;; on the `idlwave-mode' symbol. |
| @@ -1968,7 +1968,7 @@ The main features of this mode are | |||
| 1968 | idlwave-end-block-reg | 1968 | idlwave-end-block-reg |
| 1969 | ";" | 1969 | ";" |
| 1970 | 'idlwave-forward-block nil)) | 1970 | 'idlwave-forward-block nil)) |
| 1971 | 1971 | ||
| 1972 | 1972 | ||
| 1973 | ;; Make a local post-command-hook and add our hook to it | 1973 | ;; Make a local post-command-hook and add our hook to it |
| 1974 | ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility | 1974 | ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility |
| @@ -2000,16 +2000,16 @@ The main features of this mode are | |||
| 2000 | (unless idlwave-setup-done | 2000 | (unless idlwave-setup-done |
| 2001 | (if (not (file-directory-p idlwave-config-directory)) | 2001 | (if (not (file-directory-p idlwave-config-directory)) |
| 2002 | (make-directory idlwave-config-directory)) | 2002 | (make-directory idlwave-config-directory)) |
| 2003 | (setq | 2003 | (setq |
| 2004 | idlwave-user-catalog-file (expand-file-name | 2004 | idlwave-user-catalog-file (expand-file-name |
| 2005 | idlwave-user-catalog-file | 2005 | idlwave-user-catalog-file |
| 2006 | idlwave-config-directory) | 2006 | idlwave-config-directory) |
| 2007 | idlwave-xml-system-rinfo-converted-file | 2007 | idlwave-xml-system-rinfo-converted-file |
| 2008 | (expand-file-name | 2008 | (expand-file-name |
| 2009 | idlwave-xml-system-rinfo-converted-file | 2009 | idlwave-xml-system-rinfo-converted-file |
| 2010 | idlwave-config-directory) | 2010 | idlwave-config-directory) |
| 2011 | idlwave-path-file (expand-file-name | 2011 | idlwave-path-file (expand-file-name |
| 2012 | idlwave-path-file | 2012 | idlwave-path-file |
| 2013 | idlwave-config-directory)) | 2013 | idlwave-config-directory)) |
| 2014 | (idlwave-read-paths) ; we may need these early | 2014 | (idlwave-read-paths) ; we may need these early |
| 2015 | (setq idlwave-setup-done t))) | 2015 | (setq idlwave-setup-done t))) |
| @@ -2028,7 +2028,7 @@ The main features of this mode are | |||
| 2028 | 2028 | ||
| 2029 | ;; | 2029 | ;; |
| 2030 | ;; Code Formatting ---------------------------------------------------- | 2030 | ;; Code Formatting ---------------------------------------------------- |
| 2031 | ;; | 2031 | ;; |
| 2032 | 2032 | ||
| 2033 | (defun idlwave-hard-tab () | 2033 | (defun idlwave-hard-tab () |
| 2034 | "Inserts TAB in buffer in current position." | 2034 | "Inserts TAB in buffer in current position." |
| @@ -2171,7 +2171,7 @@ Also checks if the correct end statement has been used." | |||
| 2171 | (if (> end-pos eol-pos) | 2171 | (if (> end-pos eol-pos) |
| 2172 | (setq end-pos pos)) | 2172 | (setq end-pos pos)) |
| 2173 | (goto-char end-pos) | 2173 | (goto-char end-pos) |
| 2174 | (setq end (buffer-substring | 2174 | (setq end (buffer-substring |
| 2175 | (progn | 2175 | (progn |
| 2176 | (skip-chars-backward "a-zA-Z") | 2176 | (skip-chars-backward "a-zA-Z") |
| 2177 | (point)) | 2177 | (point)) |
| @@ -2193,7 +2193,7 @@ Also checks if the correct end statement has been used." | |||
| 2193 | (sit-for 1)) | 2193 | (sit-for 1)) |
| 2194 | (t | 2194 | (t |
| 2195 | (beep) | 2195 | (beep) |
| 2196 | (message "Warning: Shouldn't this be \"%s\" instead of \"%s\"?" | 2196 | (message "Warning: Shouldn't this be \"%s\" instead of \"%s\"?" |
| 2197 | end1 end) | 2197 | end1 end) |
| 2198 | (sit-for 1)))))))) | 2198 | (sit-for 1)))))))) |
| 2199 | ;;(delete-char 1)) | 2199 | ;;(delete-char 1)) |
| @@ -2205,8 +2205,8 @@ Also checks if the correct end statement has been used." | |||
| 2205 | ((looking-at "pro\\|case\\|switch\\|function\\>") | 2205 | ((looking-at "pro\\|case\\|switch\\|function\\>") |
| 2206 | (assoc (downcase (match-string 0)) idlwave-block-matches)) | 2206 | (assoc (downcase (match-string 0)) idlwave-block-matches)) |
| 2207 | ((looking-at "begin\\>") | 2207 | ((looking-at "begin\\>") |
| 2208 | (let ((limit (save-excursion | 2208 | (let ((limit (save-excursion |
| 2209 | (idlwave-beginning-of-statement) | 2209 | (idlwave-beginning-of-statement) |
| 2210 | (point)))) | 2210 | (point)))) |
| 2211 | (cond | 2211 | (cond |
| 2212 | ((re-search-backward ":[ \t]*\\=" limit t) | 2212 | ((re-search-backward ":[ \t]*\\=" limit t) |
| @@ -2490,7 +2490,7 @@ Returns non-nil if successfull." | |||
| 2490 | (let ((eos (save-excursion | 2490 | (let ((eos (save-excursion |
| 2491 | (idlwave-block-jump-out -1 'nomark) | 2491 | (idlwave-block-jump-out -1 'nomark) |
| 2492 | (point)))) | 2492 | (point)))) |
| 2493 | (if (setq status (idlwave-find-key | 2493 | (if (setq status (idlwave-find-key |
| 2494 | idlwave-end-block-reg -1 'nomark eos)) | 2494 | idlwave-end-block-reg -1 'nomark eos)) |
| 2495 | (idlwave-beginning-of-statement) | 2495 | (idlwave-beginning-of-statement) |
| 2496 | (message "No nested block before beginning of containing block."))) | 2496 | (message "No nested block before beginning of containing block."))) |
| @@ -2498,7 +2498,7 @@ Returns non-nil if successfull." | |||
| 2498 | (let ((eos (save-excursion | 2498 | (let ((eos (save-excursion |
| 2499 | (idlwave-block-jump-out 1 'nomark) | 2499 | (idlwave-block-jump-out 1 'nomark) |
| 2500 | (point)))) | 2500 | (point)))) |
| 2501 | (if (setq status (idlwave-find-key | 2501 | (if (setq status (idlwave-find-key |
| 2502 | idlwave-begin-block-reg 1 'nomark eos)) | 2502 | idlwave-begin-block-reg 1 'nomark eos)) |
| 2503 | (idlwave-end-of-statement) | 2503 | (idlwave-end-of-statement) |
| 2504 | (message "No nested block before end of containing block.")))) | 2504 | (message "No nested block before end of containing block.")))) |
| @@ -2512,7 +2512,7 @@ The marks are pushed." | |||
| 2512 | (here (point))) | 2512 | (here (point))) |
| 2513 | (goto-char (point-max)) | 2513 | (goto-char (point-max)) |
| 2514 | (if (re-search-backward idlwave-doclib-start nil t) | 2514 | (if (re-search-backward idlwave-doclib-start nil t) |
| 2515 | (progn | 2515 | (progn |
| 2516 | (setq beg (progn (beginning-of-line) (point))) | 2516 | (setq beg (progn (beginning-of-line) (point))) |
| 2517 | (if (re-search-forward idlwave-doclib-end nil t) | 2517 | (if (re-search-forward idlwave-doclib-end nil t) |
| 2518 | (progn | 2518 | (progn |
| @@ -2545,7 +2545,7 @@ actual statement." | |||
| 2545 | ((eq major-mode 'idlwave-shell-mode) | 2545 | ((eq major-mode 'idlwave-shell-mode) |
| 2546 | (if (re-search-backward idlwave-shell-prompt-pattern nil t) | 2546 | (if (re-search-backward idlwave-shell-prompt-pattern nil t) |
| 2547 | (goto-char (match-end 0)))) | 2547 | (goto-char (match-end 0)))) |
| 2548 | (t | 2548 | (t |
| 2549 | (if (save-excursion (forward-line -1) (idlwave-is-continuation-line)) | 2549 | (if (save-excursion (forward-line -1) (idlwave-is-continuation-line)) |
| 2550 | (idlwave-previous-statement) | 2550 | (idlwave-previous-statement) |
| 2551 | (beginning-of-line))))) | 2551 | (beginning-of-line))))) |
| @@ -2622,7 +2622,7 @@ If not in a statement just moves to end of line. Returns position." | |||
| 2622 | (let ((save-point (point))) | 2622 | (let ((save-point (point))) |
| 2623 | (when (re-search-forward ".*&" lim t) | 2623 | (when (re-search-forward ".*&" lim t) |
| 2624 | (goto-char (match-end 0)) | 2624 | (goto-char (match-end 0)) |
| 2625 | (if (idlwave-quoted) | 2625 | (if (idlwave-quoted) |
| 2626 | (goto-char save-point) | 2626 | (goto-char save-point) |
| 2627 | (if (eq (char-after (- (point) 2)) ?&) (goto-char save-point)))) | 2627 | (if (eq (char-after (- (point) 2)) ?&) (goto-char save-point)))) |
| 2628 | (point))) | 2628 | (point))) |
| @@ -2639,7 +2639,7 @@ If there is no label point is not moved and nil is returned." | |||
| 2639 | ;; - not in parenthesis (like a[0:3]) | 2639 | ;; - not in parenthesis (like a[0:3]) |
| 2640 | ;; - not followed by another ":" in explicit class, ala a->b::c | 2640 | ;; - not followed by another ":" in explicit class, ala a->b::c |
| 2641 | ;; As many in this mode, this function is heuristic and not an exact | 2641 | ;; As many in this mode, this function is heuristic and not an exact |
| 2642 | ;; parser. | 2642 | ;; parser. |
| 2643 | (let* ((start (point)) | 2643 | (let* ((start (point)) |
| 2644 | (eos (save-excursion (idlwave-end-of-statement) (point))) | 2644 | (eos (save-excursion (idlwave-end-of-statement) (point))) |
| 2645 | (end (idlwave-find-key ":" 1 'nomark eos))) | 2645 | (end (idlwave-find-key ":" 1 'nomark eos))) |
| @@ -2716,7 +2716,7 @@ equal sign will be surrounded by BEFORE and AFTER blanks. If | |||
| 2716 | `idlwave-pad-keyword' is t then keyword assignment is treated just | 2716 | `idlwave-pad-keyword' is t then keyword assignment is treated just |
| 2717 | like assignment statements. When nil, spaces are removed for keyword | 2717 | like assignment statements. When nil, spaces are removed for keyword |
| 2718 | assignment. Any other value keeps the current space around the `='. | 2718 | assignment. Any other value keeps the current space around the `='. |
| 2719 | Limits in for loops are treated as keyword assignment. | 2719 | Limits in for loops are treated as keyword assignment. |
| 2720 | 2720 | ||
| 2721 | Starting with IDL 6.0, a number of op= assignments are available. | 2721 | Starting with IDL 6.0, a number of op= assignments are available. |
| 2722 | Since ambiguities of the form: | 2722 | Since ambiguities of the form: |
| @@ -2733,25 +2733,25 @@ IS-ACTION is ignored. | |||
| 2733 | 2733 | ||
| 2734 | See `idlwave-surround'." | 2734 | See `idlwave-surround'." |
| 2735 | (if idlwave-surround-by-blank | 2735 | (if idlwave-surround-by-blank |
| 2736 | (let | 2736 | (let |
| 2737 | ((non-an-ops "\\(##\\|\\*\\|\\+\\|-\\|/\\|<\\|>\\|\\^\\)\\=") | 2737 | ((non-an-ops "\\(##\\|\\*\\|\\+\\|-\\|/\\|<\\|>\\|\\^\\)\\=") |
| 2738 | (an-ops | 2738 | (an-ops |
| 2739 | "\\s-\\(AND\\|EQ\\|GE\\|GT\\|LE\\|LT\\|MOD\\|NE\\|OR\\|XOR\\)\\=") | 2739 | "\\s-\\(AND\\|EQ\\|GE\\|GT\\|LE\\|LT\\|MOD\\|NE\\|OR\\|XOR\\)\\=") |
| 2740 | (len 1)) | 2740 | (len 1)) |
| 2741 | 2741 | ||
| 2742 | (save-excursion | 2742 | (save-excursion |
| 2743 | (let ((case-fold-search t)) | 2743 | (let ((case-fold-search t)) |
| 2744 | (backward-char) | 2744 | (backward-char) |
| 2745 | (if (or | 2745 | (if (or |
| 2746 | (re-search-backward non-an-ops nil t) | 2746 | (re-search-backward non-an-ops nil t) |
| 2747 | ;; Why doesn't ##? work for both? | 2747 | ;; Why doesn't ##? work for both? |
| 2748 | (re-search-backward "\\(#\\)\\=" nil t)) | 2748 | (re-search-backward "\\(#\\)\\=" nil t)) |
| 2749 | (setq len (1+ (length (match-string 1)))) | 2749 | (setq len (1+ (length (match-string 1)))) |
| 2750 | (when (re-search-backward an-ops nil t) | 2750 | (when (re-search-backward an-ops nil t) |
| 2751 | ;(setq begin nil) ; won't modify begin | 2751 | ;(setq begin nil) ; won't modify begin |
| 2752 | (setq len (1+ (length (match-string 1)))))))) | 2752 | (setq len (1+ (length (match-string 1)))))))) |
| 2753 | 2753 | ||
| 2754 | (if (eq t idlwave-pad-keyword) | 2754 | (if (eq t idlwave-pad-keyword) |
| 2755 | ;; Everything gets padded equally | 2755 | ;; Everything gets padded equally |
| 2756 | (idlwave-surround before after len) | 2756 | (idlwave-surround before after len) |
| 2757 | ;; Treating keywords/for variables specially... | 2757 | ;; Treating keywords/for variables specially... |
| @@ -2762,22 +2762,22 @@ See `idlwave-surround'." | |||
| 2762 | (skip-chars-backward "= \t") | 2762 | (skip-chars-backward "= \t") |
| 2763 | (nth 2 (idlwave-where))))) | 2763 | (nth 2 (idlwave-where))))) |
| 2764 | (cond ((or (memq what '(function-keyword procedure-keyword)) | 2764 | (cond ((or (memq what '(function-keyword procedure-keyword)) |
| 2765 | (memq (caar st) '(for pdef))) | 2765 | (memq (caar st) '(for pdef))) |
| 2766 | (cond | 2766 | (cond |
| 2767 | ((null idlwave-pad-keyword) | 2767 | ((null idlwave-pad-keyword) |
| 2768 | (idlwave-surround 0 0) | 2768 | (idlwave-surround 0 0) |
| 2769 | ) ; remove space | 2769 | ) ; remove space |
| 2770 | (t))) ; leave any spaces alone | 2770 | (t))) ; leave any spaces alone |
| 2771 | (t (idlwave-surround before after len)))))))) | 2771 | (t (idlwave-surround before after len)))))))) |
| 2772 | 2772 | ||
| 2773 | 2773 | ||
| 2774 | (defun idlwave-indent-and-action (&optional arg) | 2774 | (defun idlwave-indent-and-action (&optional arg) |
| 2775 | "Call `idlwave-indent-line' and do expand actions. | 2775 | "Call `idlwave-indent-line' and do expand actions. |
| 2776 | With prefix ARG non-nil, indent the entire sub-statement." | 2776 | With prefix ARG non-nil, indent the entire sub-statement." |
| 2777 | (interactive "p") | 2777 | (interactive "p") |
| 2778 | (save-excursion | 2778 | (save-excursion |
| 2779 | (if (and idlwave-expand-generic-end | 2779 | (if (and idlwave-expand-generic-end |
| 2780 | (re-search-backward "\\<\\(end\\)\\s-*\\=" | 2780 | (re-search-backward "\\<\\(end\\)\\s-*\\=" |
| 2781 | (max 0 (- (point) 10)) t) | 2781 | (max 0 (- (point) 10)) t) |
| 2782 | (looking-at "\\(end\\)\\([ \n\t]\\|\\'\\)")) | 2782 | (looking-at "\\(end\\)\\([ \n\t]\\|\\'\\)")) |
| 2783 | (progn (goto-char (match-end 1)) | 2783 | (progn (goto-char (match-end 1)) |
| @@ -2787,7 +2787,7 @@ With prefix ARG non-nil, indent the entire sub-statement." | |||
| 2787 | (when (and (not arg) current-prefix-arg) | 2787 | (when (and (not arg) current-prefix-arg) |
| 2788 | (setq arg current-prefix-arg) | 2788 | (setq arg current-prefix-arg) |
| 2789 | (setq current-prefix-arg nil)) | 2789 | (setq current-prefix-arg nil)) |
| 2790 | (if arg | 2790 | (if arg |
| 2791 | (idlwave-indent-statement) | 2791 | (idlwave-indent-statement) |
| 2792 | (idlwave-indent-line t))) | 2792 | (idlwave-indent-line t))) |
| 2793 | 2793 | ||
| @@ -2922,7 +2922,7 @@ Inserts spaces before markers at point." | |||
| 2922 | (save-excursion | 2922 | (save-excursion |
| 2923 | (cond | 2923 | (cond |
| 2924 | ;; Beginning of file | 2924 | ;; Beginning of file |
| 2925 | ((prog1 | 2925 | ((prog1 |
| 2926 | (idlwave-previous-statement) | 2926 | (idlwave-previous-statement) |
| 2927 | (setq beg-prev-pos (point))) | 2927 | (setq beg-prev-pos (point))) |
| 2928 | 0) | 2928 | 0) |
| @@ -2932,7 +2932,7 @@ Inserts spaces before markers at point." | |||
| 2932 | idlwave-main-block-indent)) | 2932 | idlwave-main-block-indent)) |
| 2933 | ;; Begin block | 2933 | ;; Begin block |
| 2934 | ((idlwave-look-at idlwave-begin-block-reg t) | 2934 | ((idlwave-look-at idlwave-begin-block-reg t) |
| 2935 | (+ (idlwave-min-current-statement-indent) | 2935 | (+ (idlwave-min-current-statement-indent) |
| 2936 | idlwave-block-indent)) | 2936 | idlwave-block-indent)) |
| 2937 | ;; End Block | 2937 | ;; End Block |
| 2938 | ((idlwave-look-at idlwave-end-block-reg t) | 2938 | ((idlwave-look-at idlwave-end-block-reg t) |
| @@ -2943,7 +2943,7 @@ Inserts spaces before markers at point." | |||
| 2943 | (idlwave-min-current-statement-indent))) | 2943 | (idlwave-min-current-statement-indent))) |
| 2944 | ;; idlwave-end-offset | 2944 | ;; idlwave-end-offset |
| 2945 | ;; idlwave-block-indent)) | 2945 | ;; idlwave-block-indent)) |
| 2946 | 2946 | ||
| 2947 | ;; Default to current indent | 2947 | ;; Default to current indent |
| 2948 | ((idlwave-current-statement-indent)))))) | 2948 | ((idlwave-current-statement-indent)))))) |
| 2949 | ;; adjust the indentation based on the current statement | 2949 | ;; adjust the indentation based on the current statement |
| @@ -2959,7 +2959,7 @@ Inserts spaces before markers at point." | |||
| 2959 | 2959 | ||
| 2960 | (defun idlwave-calculate-paren-indent (beg-reg end-reg close-exp) | 2960 | (defun idlwave-calculate-paren-indent (beg-reg end-reg close-exp) |
| 2961 | "Calculate the continuation indent inside a paren group. | 2961 | "Calculate the continuation indent inside a paren group. |
| 2962 | Returns a cons-cell with (open . indent), where open is the | 2962 | Returns a cons-cell with (open . indent), where open is the |
| 2963 | location of the open paren" | 2963 | location of the open paren" |
| 2964 | (let ((open (nth 1 (parse-partial-sexp beg-reg end-reg)))) | 2964 | (let ((open (nth 1 (parse-partial-sexp beg-reg end-reg)))) |
| 2965 | ;; Found an innermost open paren. | 2965 | ;; Found an innermost open paren. |
| @@ -3000,24 +3000,24 @@ groupings, are treated separately." | |||
| 3000 | (end-reg (progn (beginning-of-line) (point))) | 3000 | (end-reg (progn (beginning-of-line) (point))) |
| 3001 | (beg-last-statement (save-excursion (idlwave-previous-statement) | 3001 | (beg-last-statement (save-excursion (idlwave-previous-statement) |
| 3002 | (point))) | 3002 | (point))) |
| 3003 | (beg-reg (progn (idlwave-start-of-substatement 'pre) | 3003 | (beg-reg (progn (idlwave-start-of-substatement 'pre) |
| 3004 | (if (eq (line-beginning-position) end-reg) | 3004 | (if (eq (line-beginning-position) end-reg) |
| 3005 | (goto-char beg-last-statement) | 3005 | (goto-char beg-last-statement) |
| 3006 | (point)))) | 3006 | (point)))) |
| 3007 | (basic-indent (+ (idlwave-min-current-statement-indent end-reg) | 3007 | (basic-indent (+ (idlwave-min-current-statement-indent end-reg) |
| 3008 | idlwave-continuation-indent)) | 3008 | idlwave-continuation-indent)) |
| 3009 | fancy-nonparen-indent fancy-paren-indent) | 3009 | fancy-nonparen-indent fancy-paren-indent) |
| 3010 | (cond | 3010 | (cond |
| 3011 | ;; Align then with its matching if, etc. | 3011 | ;; Align then with its matching if, etc. |
| 3012 | ((let ((matchers '(("\\<if\\>" . "[ \t]*then") | 3012 | ((let ((matchers '(("\\<if\\>" . "[ \t]*then") |
| 3013 | ("\\<\\(if\\|end\\(if\\)?\\)\\>" . "[ \t]*else") | 3013 | ("\\<\\(if\\|end\\(if\\)?\\)\\>" . "[ \t]*else") |
| 3014 | ("\\<\\(for\\|while\\)\\>" . "[ \t]*do") | 3014 | ("\\<\\(for\\|while\\)\\>" . "[ \t]*do") |
| 3015 | ("\\<\\(repeat\\|end\\(rep\\)?\\)\\>" . | 3015 | ("\\<\\(repeat\\|end\\(rep\\)?\\)\\>" . |
| 3016 | "[ \t]*until") | 3016 | "[ \t]*until") |
| 3017 | ("\\<case\\>" . "[ \t]*of"))) | 3017 | ("\\<case\\>" . "[ \t]*of"))) |
| 3018 | match cont-re) | 3018 | match cont-re) |
| 3019 | (goto-char end-reg) | 3019 | (goto-char end-reg) |
| 3020 | (and | 3020 | (and |
| 3021 | (setq cont-re | 3021 | (setq cont-re |
| 3022 | (catch 'exit | 3022 | (catch 'exit |
| 3023 | (while (setq match (car matchers)) | 3023 | (while (setq match (car matchers)) |
| @@ -3026,7 +3026,7 @@ groupings, are treated separately." | |||
| 3026 | (setq matchers (cdr matchers))))) | 3026 | (setq matchers (cdr matchers))))) |
| 3027 | (idlwave-find-key cont-re -1 'nomark beg-last-statement))) | 3027 | (idlwave-find-key cont-re -1 'nomark beg-last-statement))) |
| 3028 | (if (looking-at "end") ;; that one's special | 3028 | (if (looking-at "end") ;; that one's special |
| 3029 | (- (idlwave-current-indent) | 3029 | (- (idlwave-current-indent) |
| 3030 | (+ idlwave-block-indent idlwave-end-offset)) | 3030 | (+ idlwave-block-indent idlwave-end-offset)) |
| 3031 | (idlwave-current-indent))) | 3031 | (idlwave-current-indent))) |
| 3032 | 3032 | ||
| @@ -3052,7 +3052,7 @@ groupings, are treated separately." | |||
| 3052 | (let* ((end-reg end-reg) | 3052 | (let* ((end-reg end-reg) |
| 3053 | (close-exp (progn | 3053 | (close-exp (progn |
| 3054 | (goto-char end-reg) | 3054 | (goto-char end-reg) |
| 3055 | (skip-chars-forward " \t") | 3055 | (skip-chars-forward " \t") |
| 3056 | (looking-at "\\s)"))) | 3056 | (looking-at "\\s)"))) |
| 3057 | indent-cons) | 3057 | indent-cons) |
| 3058 | (catch 'loop | 3058 | (catch 'loop |
| @@ -3086,12 +3086,12 @@ groupings, are treated separately." | |||
| 3086 | (if (save-match-data (looking-at "[ \t$]*\\(;.*\\)?$")) | 3086 | (if (save-match-data (looking-at "[ \t$]*\\(;.*\\)?$")) |
| 3087 | nil | 3087 | nil |
| 3088 | (current-column))) | 3088 | (current-column))) |
| 3089 | 3089 | ||
| 3090 | ;; Continued assignment (with =): | 3090 | ;; Continued assignment (with =): |
| 3091 | ((catch 'assign ; | 3091 | ((catch 'assign ; |
| 3092 | (while (looking-at "[^=\n\r]*\\(=\\)[ \t]*") | 3092 | (while (looking-at "[^=\n\r]*\\(=\\)[ \t]*") |
| 3093 | (goto-char (match-end 0)) | 3093 | (goto-char (match-end 0)) |
| 3094 | (if (null (idlwave-what-function beg-reg)) | 3094 | (if (null (idlwave-what-function beg-reg)) |
| 3095 | (throw 'assign t)))) | 3095 | (throw 'assign t)))) |
| 3096 | (unless (or | 3096 | (unless (or |
| 3097 | (idlwave-in-quote) | 3097 | (idlwave-in-quote) |
| @@ -3153,7 +3153,7 @@ possibility of unbalanced blocks." | |||
| 3153 | (let* ((here (point)) | 3153 | (let* ((here (point)) |
| 3154 | (case-fold-search t) | 3154 | (case-fold-search t) |
| 3155 | (limit (if (>= dir 0) (point-max) (point-min))) | 3155 | (limit (if (>= dir 0) (point-max) (point-min))) |
| 3156 | (block-limit (if (>= dir 0) | 3156 | (block-limit (if (>= dir 0) |
| 3157 | idlwave-begin-block-reg | 3157 | idlwave-begin-block-reg |
| 3158 | idlwave-end-block-reg)) | 3158 | idlwave-end-block-reg)) |
| 3159 | found | 3159 | found |
| @@ -3164,7 +3164,7 @@ possibility of unbalanced blocks." | |||
| 3164 | (idlwave-find-key | 3164 | (idlwave-find-key |
| 3165 | idlwave-begin-unit-reg dir t limit) | 3165 | idlwave-begin-unit-reg dir t limit) |
| 3166 | (end-of-line) | 3166 | (end-of-line) |
| 3167 | (idlwave-find-key | 3167 | (idlwave-find-key |
| 3168 | idlwave-end-unit-reg dir t limit))) | 3168 | idlwave-end-unit-reg dir t limit))) |
| 3169 | limit))) | 3169 | limit))) |
| 3170 | (if (>= dir 0) (end-of-line)) ;Make sure we are in current block | 3170 | (if (>= dir 0) (end-of-line)) ;Make sure we are in current block |
| @@ -3189,7 +3189,7 @@ possibility of unbalanced blocks." | |||
| 3189 | (or (null end-reg) (< (point) end-reg))) | 3189 | (or (null end-reg) (< (point) end-reg))) |
| 3190 | (unless comm-or-empty (setq min (min min (idlwave-current-indent))))) | 3190 | (unless comm-or-empty (setq min (min min (idlwave-current-indent))))) |
| 3191 | (if (or comm-or-empty (and end-reg (>= (point) end-reg))) | 3191 | (if (or comm-or-empty (and end-reg (>= (point) end-reg))) |
| 3192 | min | 3192 | min |
| 3193 | (min min (idlwave-current-indent)))))) | 3193 | (min min (idlwave-current-indent)))))) |
| 3194 | 3194 | ||
| 3195 | (defun idlwave-current-statement-indent (&optional last-line) | 3195 | (defun idlwave-current-statement-indent (&optional last-line) |
| @@ -3216,10 +3216,10 @@ Blank or comment-only lines following regular continuation lines (with | |||
| 3216 | `$') count as continuations too." | 3216 | `$') count as continuations too." |
| 3217 | (let (p) | 3217 | (let (p) |
| 3218 | (save-excursion | 3218 | (save-excursion |
| 3219 | (or | 3219 | (or |
| 3220 | (idlwave-look-at "\\<\\$") | 3220 | (idlwave-look-at "\\<\\$") |
| 3221 | (catch 'loop | 3221 | (catch 'loop |
| 3222 | (while (and (looking-at "^[ \t]*\\(;.*\\)?$") | 3222 | (while (and (looking-at "^[ \t]*\\(;.*\\)?$") |
| 3223 | (eq (forward-line -1) 0)) | 3223 | (eq (forward-line -1) 0)) |
| 3224 | (if (setq p (idlwave-look-at "\\<\\$")) (throw 'loop p)))))))) | 3224 | (if (setq p (idlwave-look-at "\\<\\$")) (throw 'loop p)))))))) |
| 3225 | 3225 | ||
| @@ -3317,7 +3317,7 @@ ignored." | |||
| 3317 | (beginning-of-line) (point)) | 3317 | (beginning-of-line) (point)) |
| 3318 | (point)))) | 3318 | (point)))) |
| 3319 | "[^;]")) | 3319 | "[^;]")) |
| 3320 | 3320 | ||
| 3321 | ;; Mark the beginning and end of the paragraph | 3321 | ;; Mark the beginning and end of the paragraph |
| 3322 | (goto-char bcl) | 3322 | (goto-char bcl) |
| 3323 | (while (and (looking-at fill-prefix-reg) | 3323 | (while (and (looking-at fill-prefix-reg) |
| @@ -3381,7 +3381,7 @@ ignored." | |||
| 3381 | (insert (make-string diff ?\ )))) | 3381 | (insert (make-string diff ?\ )))) |
| 3382 | (forward-line -1)) | 3382 | (forward-line -1)) |
| 3383 | ) | 3383 | ) |
| 3384 | 3384 | ||
| 3385 | ;; No hang. Instead find minimum indentation of paragraph | 3385 | ;; No hang. Instead find minimum indentation of paragraph |
| 3386 | ;; after first line. | 3386 | ;; after first line. |
| 3387 | ;; For the following while statement, since START is at the | 3387 | ;; For the following while statement, since START is at the |
| @@ -3413,7 +3413,7 @@ ignored." | |||
| 3413 | t) | 3413 | t) |
| 3414 | (current-column)) | 3414 | (current-column)) |
| 3415 | indent)) | 3415 | indent)) |
| 3416 | 3416 | ||
| 3417 | ;; try to keep point at its original place | 3417 | ;; try to keep point at its original place |
| 3418 | (goto-char here) | 3418 | (goto-char here) |
| 3419 | 3419 | ||
| @@ -3462,7 +3462,7 @@ If not found returns nil." | |||
| 3462 | (current-column))))) | 3462 | (current-column))))) |
| 3463 | 3463 | ||
| 3464 | (defun idlwave-auto-fill () | 3464 | (defun idlwave-auto-fill () |
| 3465 | "Called to break lines in auto fill mode. | 3465 | "Called to break lines in auto fill mode. |
| 3466 | Only fills non-comment lines if `idlwave-fill-comment-line-only' is | 3466 | Only fills non-comment lines if `idlwave-fill-comment-line-only' is |
| 3467 | non-nil. Places a continuation character at the end of the line if | 3467 | non-nil. Places a continuation character at the end of the line if |
| 3468 | not in a comment. Splits strings with IDL concatenation operator `+' | 3468 | not in a comment. Splits strings with IDL concatenation operator `+' |
| @@ -3613,7 +3613,7 @@ is non-nil." | |||
| 3613 | (insert (current-time-string)) | 3613 | (insert (current-time-string)) |
| 3614 | (insert ", " (user-full-name)) | 3614 | (insert ", " (user-full-name)) |
| 3615 | (if (boundp 'user-mail-address) | 3615 | (if (boundp 'user-mail-address) |
| 3616 | (insert " <" user-mail-address ">") | 3616 | (insert " <" user-mail-address ">") |
| 3617 | (insert " <" (user-login-name) "@" (system-name) ">")) | 3617 | (insert " <" (user-login-name) "@" (system-name) ">")) |
| 3618 | ;; Remove extra spaces from line | 3618 | ;; Remove extra spaces from line |
| 3619 | (idlwave-fill-paragraph) | 3619 | (idlwave-fill-paragraph) |
| @@ -3639,7 +3639,7 @@ location on mark ring so that the user can return to previous point." | |||
| 3639 | (setq end (match-end 0))) | 3639 | (setq end (match-end 0))) |
| 3640 | (progn | 3640 | (progn |
| 3641 | (goto-char beg) | 3641 | (goto-char beg) |
| 3642 | (if (re-search-forward | 3642 | (if (re-search-forward |
| 3643 | (concat idlwave-doc-modifications-keyword ":") | 3643 | (concat idlwave-doc-modifications-keyword ":") |
| 3644 | end t) | 3644 | end t) |
| 3645 | (end-of-line) | 3645 | (end-of-line) |
| @@ -3737,7 +3737,7 @@ constants - a double quote followed by an octal digit." | |||
| 3737 | (not (idlwave-in-quote)) | 3737 | (not (idlwave-in-quote)) |
| 3738 | (save-excursion | 3738 | (save-excursion |
| 3739 | (forward-char) | 3739 | (forward-char) |
| 3740 | (re-search-backward (concat "\\(" idlwave-idl-keywords | 3740 | (re-search-backward (concat "\\(" idlwave-idl-keywords |
| 3741 | "\\|[[(*+-/=,^><]\\)\\s-*\\*") limit t))))) | 3741 | "\\|[[(*+-/=,^><]\\)\\s-*\\*") limit t))))) |
| 3742 | 3742 | ||
| 3743 | 3743 | ||
| @@ -3783,7 +3783,7 @@ unless the optional second argument NOINDENT is non-nil." | |||
| 3783 | (indent-region beg end nil)) | 3783 | (indent-region beg end nil)) |
| 3784 | (if (stringp prompt) | 3784 | (if (stringp prompt) |
| 3785 | (message prompt))))) | 3785 | (message prompt))))) |
| 3786 | 3786 | ||
| 3787 | (defun idlwave-rw-case (string) | 3787 | (defun idlwave-rw-case (string) |
| 3788 | "Make STRING have the case required by `idlwave-reserved-word-upcase'." | 3788 | "Make STRING have the case required by `idlwave-reserved-word-upcase'." |
| 3789 | (if idlwave-reserved-word-upcase | 3789 | (if idlwave-reserved-word-upcase |
| @@ -3801,7 +3801,7 @@ unless the optional second argument NOINDENT is non-nil." | |||
| 3801 | (defun idlwave-case () | 3801 | (defun idlwave-case () |
| 3802 | "Build skeleton IDL case statement." | 3802 | "Build skeleton IDL case statement." |
| 3803 | (interactive) | 3803 | (interactive) |
| 3804 | (idlwave-template | 3804 | (idlwave-template |
| 3805 | (idlwave-rw-case "case") | 3805 | (idlwave-rw-case "case") |
| 3806 | (idlwave-rw-case " of\n\nendcase") | 3806 | (idlwave-rw-case " of\n\nendcase") |
| 3807 | "Selector expression")) | 3807 | "Selector expression")) |
| @@ -3809,7 +3809,7 @@ unless the optional second argument NOINDENT is non-nil." | |||
| 3809 | (defun idlwave-switch () | 3809 | (defun idlwave-switch () |
| 3810 | "Build skeleton IDL switch statement." | 3810 | "Build skeleton IDL switch statement." |
| 3811 | (interactive) | 3811 | (interactive) |
| 3812 | (idlwave-template | 3812 | (idlwave-template |
| 3813 | (idlwave-rw-case "switch") | 3813 | (idlwave-rw-case "switch") |
| 3814 | (idlwave-rw-case " of\n\nendswitch") | 3814 | (idlwave-rw-case " of\n\nendswitch") |
| 3815 | "Selector expression")) | 3815 | "Selector expression")) |
| @@ -3817,7 +3817,7 @@ unless the optional second argument NOINDENT is non-nil." | |||
| 3817 | (defun idlwave-for () | 3817 | (defun idlwave-for () |
| 3818 | "Build skeleton for loop statment." | 3818 | "Build skeleton for loop statment." |
| 3819 | (interactive) | 3819 | (interactive) |
| 3820 | (idlwave-template | 3820 | (idlwave-template |
| 3821 | (idlwave-rw-case "for") | 3821 | (idlwave-rw-case "for") |
| 3822 | (idlwave-rw-case " do begin\n\nendfor") | 3822 | (idlwave-rw-case " do begin\n\nendfor") |
| 3823 | "Loop expression")) | 3823 | "Loop expression")) |
| @@ -3832,14 +3832,14 @@ unless the optional second argument NOINDENT is non-nil." | |||
| 3832 | 3832 | ||
| 3833 | (defun idlwave-procedure () | 3833 | (defun idlwave-procedure () |
| 3834 | (interactive) | 3834 | (interactive) |
| 3835 | (idlwave-template | 3835 | (idlwave-template |
| 3836 | (idlwave-rw-case "pro") | 3836 | (idlwave-rw-case "pro") |
| 3837 | (idlwave-rw-case "\n\nreturn\nend") | 3837 | (idlwave-rw-case "\n\nreturn\nend") |
| 3838 | "Procedure name")) | 3838 | "Procedure name")) |
| 3839 | 3839 | ||
| 3840 | (defun idlwave-function () | 3840 | (defun idlwave-function () |
| 3841 | (interactive) | 3841 | (interactive) |
| 3842 | (idlwave-template | 3842 | (idlwave-template |
| 3843 | (idlwave-rw-case "function") | 3843 | (idlwave-rw-case "function") |
| 3844 | (idlwave-rw-case "\n\nreturn\nend") | 3844 | (idlwave-rw-case "\n\nreturn\nend") |
| 3845 | "Function name")) | 3845 | "Function name")) |
| @@ -3853,7 +3853,7 @@ unless the optional second argument NOINDENT is non-nil." | |||
| 3853 | 3853 | ||
| 3854 | (defun idlwave-while () | 3854 | (defun idlwave-while () |
| 3855 | (interactive) | 3855 | (interactive) |
| 3856 | (idlwave-template | 3856 | (idlwave-template |
| 3857 | (idlwave-rw-case "while") | 3857 | (idlwave-rw-case "while") |
| 3858 | (idlwave-rw-case " do begin\n\nendwhile") | 3858 | (idlwave-rw-case " do begin\n\nendwhile") |
| 3859 | "Entry condition")) | 3859 | "Entry condition")) |
| @@ -3932,8 +3932,8 @@ Buffer containing unsaved changes require confirmation before they are killed." | |||
| 3932 | (defun idlwave-count-outlawed-buffers (tag) | 3932 | (defun idlwave-count-outlawed-buffers (tag) |
| 3933 | "How many outlawed buffers have tag TAG?" | 3933 | "How many outlawed buffers have tag TAG?" |
| 3934 | (length (delq nil | 3934 | (length (delq nil |
| 3935 | (mapcar | 3935 | (mapcar |
| 3936 | (lambda (x) (eq (cdr x) tag)) | 3936 | (lambda (x) (eq (cdr x) tag)) |
| 3937 | idlwave-outlawed-buffers)))) | 3937 | idlwave-outlawed-buffers)))) |
| 3938 | 3938 | ||
| 3939 | (defun idlwave-do-kill-autoloaded-buffers (&rest reasons) | 3939 | (defun idlwave-do-kill-autoloaded-buffers (&rest reasons) |
| @@ -3947,9 +3947,9 @@ Buffer containing unsaved changes require confirmation before they are killed." | |||
| 3947 | (memq (cdr entry) reasons)) | 3947 | (memq (cdr entry) reasons)) |
| 3948 | (kill-buffer (car entry)) | 3948 | (kill-buffer (car entry)) |
| 3949 | (incf cnt) | 3949 | (incf cnt) |
| 3950 | (setq idlwave-outlawed-buffers | 3950 | (setq idlwave-outlawed-buffers |
| 3951 | (delq entry idlwave-outlawed-buffers))) | 3951 | (delq entry idlwave-outlawed-buffers))) |
| 3952 | (setq idlwave-outlawed-buffers | 3952 | (setq idlwave-outlawed-buffers |
| 3953 | (delq entry idlwave-outlawed-buffers)))) | 3953 | (delq entry idlwave-outlawed-buffers)))) |
| 3954 | (message "%d buffer%s killed" cnt (if (= cnt 1) "" "s")))) | 3954 | (message "%d buffer%s killed" cnt (if (= cnt 1) "" "s")))) |
| 3955 | 3955 | ||
| @@ -3961,7 +3961,7 @@ Intended for `after-save-hook'." | |||
| 3961 | (entry (assq buf idlwave-outlawed-buffers))) | 3961 | (entry (assq buf idlwave-outlawed-buffers))) |
| 3962 | ;; Revoke license | 3962 | ;; Revoke license |
| 3963 | (if entry | 3963 | (if entry |
| 3964 | (setq idlwave-outlawed-buffers | 3964 | (setq idlwave-outlawed-buffers |
| 3965 | (delq entry idlwave-outlawed-buffers))) | 3965 | (delq entry idlwave-outlawed-buffers))) |
| 3966 | ;; Remove this function from the hook. | 3966 | ;; Remove this function from the hook. |
| 3967 | (remove-hook 'after-save-hook 'idlwave-revoke-license-to-kill 'local))) | 3967 | (remove-hook 'after-save-hook 'idlwave-revoke-license-to-kill 'local))) |
| @@ -3980,7 +3980,7 @@ Intended for `after-save-hook'." | |||
| 3980 | (defun idlwave-expand-lib-file-name (file) | 3980 | (defun idlwave-expand-lib-file-name (file) |
| 3981 | ;; Find FILE on the scanned lib path and return a buffer visiting it | 3981 | ;; Find FILE on the scanned lib path and return a buffer visiting it |
| 3982 | ;; This is for, e.g., finding source with no user catalog | 3982 | ;; This is for, e.g., finding source with no user catalog |
| 3983 | (cond | 3983 | (cond |
| 3984 | ((null file) nil) | 3984 | ((null file) nil) |
| 3985 | ((file-name-absolute-p file) file) | 3985 | ((file-name-absolute-p file) file) |
| 3986 | (t (idlwave-locate-lib-file file)))) | 3986 | (t (idlwave-locate-lib-file file)))) |
| @@ -3995,7 +3995,7 @@ you specify /." | |||
| 3995 | (interactive) | 3995 | (interactive) |
| 3996 | (let (directory directories cmd append status numdirs dir getsubdirs | 3996 | (let (directory directories cmd append status numdirs dir getsubdirs |
| 3997 | buffer save_buffer files numfiles item errbuf) | 3997 | buffer save_buffer files numfiles item errbuf) |
| 3998 | 3998 | ||
| 3999 | ;; | 3999 | ;; |
| 4000 | ;; Read list of directories | 4000 | ;; Read list of directories |
| 4001 | (setq directory (read-string "Tag Directories: " ".")) | 4001 | (setq directory (read-string "Tag Directories: " ".")) |
| @@ -4047,7 +4047,7 @@ you specify /." | |||
| 4047 | (message "%s" (concat "Tagging " item "...")) | 4047 | (message "%s" (concat "Tagging " item "...")) |
| 4048 | (setq errbuf (get-buffer-create "*idltags-error*")) | 4048 | (setq errbuf (get-buffer-create "*idltags-error*")) |
| 4049 | (setq status (+ status | 4049 | (setq status (+ status |
| 4050 | (if (eq 0 (call-process | 4050 | (if (eq 0 (call-process |
| 4051 | "sh" nil errbuf nil "-c" | 4051 | "sh" nil errbuf nil "-c" |
| 4052 | (concat cmd append item))) | 4052 | (concat cmd append item))) |
| 4053 | 0 | 4053 | 0 |
| @@ -4061,13 +4061,13 @@ you specify /." | |||
| 4061 | (setq numfiles (1+ numfiles)) | 4061 | (setq numfiles (1+ numfiles)) |
| 4062 | (setq item (nth numfiles files)) | 4062 | (setq item (nth numfiles files)) |
| 4063 | ))) | 4063 | ))) |
| 4064 | 4064 | ||
| 4065 | (setq numdirs (1+ numdirs)) | 4065 | (setq numdirs (1+ numdirs)) |
| 4066 | (setq dir (nth numdirs directories))) | 4066 | (setq dir (nth numdirs directories))) |
| 4067 | (progn | 4067 | (progn |
| 4068 | (setq numdirs (1+ numdirs)) | 4068 | (setq numdirs (1+ numdirs)) |
| 4069 | (setq dir (nth numdirs directories))))) | 4069 | (setq dir (nth numdirs directories))))) |
| 4070 | 4070 | ||
| 4071 | (setq errbuf (get-buffer-create "*idltags-error*")) | 4071 | (setq errbuf (get-buffer-create "*idltags-error*")) |
| 4072 | (if (= status 0) | 4072 | (if (= status 0) |
| 4073 | (kill-buffer errbuf)) | 4073 | (kill-buffer errbuf)) |
| @@ -4143,7 +4143,7 @@ blank lines." | |||
| 4143 | ;; Make sure the hash functions are accessible. | 4143 | ;; Make sure the hash functions are accessible. |
| 4144 | (if (or (not (fboundp 'gethash)) | 4144 | (if (or (not (fboundp 'gethash)) |
| 4145 | (not (fboundp 'puthash))) | 4145 | (not (fboundp 'puthash))) |
| 4146 | (progn | 4146 | (progn |
| 4147 | (require 'cl) | 4147 | (require 'cl) |
| 4148 | (or (fboundp 'puthash) | 4148 | (or (fboundp 'puthash) |
| 4149 | (defalias 'puthash 'cl-puthash)))) | 4149 | (defalias 'puthash 'cl-puthash)))) |
| @@ -4162,7 +4162,7 @@ blank lines." | |||
| 4162 | (null (cdr idlwave-sint-routines))) | 4162 | (null (cdr idlwave-sint-routines))) |
| 4163 | (loop for entry in entries | 4163 | (loop for entry in entries |
| 4164 | for var = (car entry) for size = (nth 1 entry) | 4164 | for var = (car entry) for size = (nth 1 entry) |
| 4165 | do (setcdr (symbol-value var) | 4165 | do (setcdr (symbol-value var) |
| 4166 | (make-hash-table ':size size ':test 'equal))) | 4166 | (make-hash-table ':size size ':test 'equal))) |
| 4167 | (setq idlwave-sint-dirs nil | 4167 | (setq idlwave-sint-dirs nil |
| 4168 | idlwave-sint-libnames nil)) | 4168 | idlwave-sint-libnames nil)) |
| @@ -4172,7 +4172,7 @@ blank lines." | |||
| 4172 | (null (car idlwave-sint-routines))) | 4172 | (null (car idlwave-sint-routines))) |
| 4173 | (loop for entry in entries | 4173 | (loop for entry in entries |
| 4174 | for var = (car entry) for size = (nth 1 entry) | 4174 | for var = (car entry) for size = (nth 1 entry) |
| 4175 | do (setcar (symbol-value var) | 4175 | do (setcar (symbol-value var) |
| 4176 | (make-hash-table ':size size ':test 'equal)))))) | 4176 | (make-hash-table ':size size ':test 'equal)))))) |
| 4177 | 4177 | ||
| 4178 | (defun idlwave-sintern-routine-or-method (name &optional class set) | 4178 | (defun idlwave-sintern-routine-or-method (name &optional class set) |
| @@ -4259,11 +4259,11 @@ If DEFAULT-DIR is passed, it is used as the base of the directory" | |||
| 4259 | (setq class (idlwave-sintern-class class set)) | 4259 | (setq class (idlwave-sintern-class class set)) |
| 4260 | (setq name (idlwave-sintern-method name set))) | 4260 | (setq name (idlwave-sintern-method name set))) |
| 4261 | (setq name (idlwave-sintern-routine name set))) | 4261 | (setq name (idlwave-sintern-routine name set))) |
| 4262 | 4262 | ||
| 4263 | ;; The source | 4263 | ;; The source |
| 4264 | (let ((source-type (car source)) | 4264 | (let ((source-type (car source)) |
| 4265 | (source-file (nth 1 source)) | 4265 | (source-file (nth 1 source)) |
| 4266 | (source-dir (if default-dir | 4266 | (source-dir (if default-dir |
| 4267 | (file-name-as-directory default-dir) | 4267 | (file-name-as-directory default-dir) |
| 4268 | (nth 2 source))) | 4268 | (nth 2 source))) |
| 4269 | (source-lib (nth 3 source))) | 4269 | (source-lib (nth 3 source))) |
| @@ -4272,7 +4272,7 @@ If DEFAULT-DIR is passed, it is used as the base of the directory" | |||
| 4272 | (if (stringp source-lib) | 4272 | (if (stringp source-lib) |
| 4273 | (setq source-lib (idlwave-sintern-libname source-lib set))) | 4273 | (setq source-lib (idlwave-sintern-libname source-lib set))) |
| 4274 | (setq source (list source-type source-file source-dir source-lib))) | 4274 | (setq source (list source-type source-file source-dir source-lib))) |
| 4275 | 4275 | ||
| 4276 | ;; The keywords | 4276 | ;; The keywords |
| 4277 | (setq kwds (mapcar (lambda (x) | 4277 | (setq kwds (mapcar (lambda (x) |
| 4278 | (idlwave-sintern-keyword-list x set)) | 4278 | (idlwave-sintern-keyword-list x set)) |
| @@ -4407,15 +4407,15 @@ will re-read the catalog." | |||
| 4407 | (not (stringp idlwave-user-catalog-file)) | 4407 | (not (stringp idlwave-user-catalog-file)) |
| 4408 | (not (file-regular-p idlwave-user-catalog-file))) | 4408 | (not (file-regular-p idlwave-user-catalog-file))) |
| 4409 | (error "No catalog has been produced yet")) | 4409 | (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)) |
| 4411 | (args (list "-batch" | 4411 | (args (list "-batch" |
| 4412 | "-l" (expand-file-name "~/.emacs") | 4412 | "-l" (expand-file-name "~/.emacs") |
| 4413 | "-l" "idlwave" | 4413 | "-l" "idlwave" |
| 4414 | "-f" "idlwave-rescan-catalog-directories")) | 4414 | "-f" "idlwave-rescan-catalog-directories")) |
| 4415 | (process (apply 'start-process "idlcat" | 4415 | (process (apply 'start-process "idlcat" |
| 4416 | nil emacs args))) | 4416 | nil emacs args))) |
| 4417 | (setq idlwave-catalog-process process) | 4417 | (setq idlwave-catalog-process process) |
| 4418 | (set-process-sentinel | 4418 | (set-process-sentinel |
| 4419 | process | 4419 | process |
| 4420 | (lambda (pro why) | 4420 | (lambda (pro why) |
| 4421 | (when (string-match "finished" why) | 4421 | (when (string-match "finished" why) |
| @@ -4432,7 +4432,7 @@ will re-read the catalog." | |||
| 4432 | ;; ("ROUTINE" type class | 4432 | ;; ("ROUTINE" type class |
| 4433 | ;; (system) | (lib pro_file dir "LIBNAME") | (user pro_file dir "USERLIB") | | 4433 | ;; (system) | (lib pro_file dir "LIBNAME") | (user pro_file dir "USERLIB") | |
| 4434 | ;; (buffer pro_file dir) | (compiled pro_file dir) | 4434 | ;; (buffer pro_file dir) | (compiled pro_file dir) |
| 4435 | ;; "calling_string" ("HELPFILE" (("KWD1" . link1) ...)) | 4435 | ;; "calling_string" ("HELPFILE" (("KWD1" . link1) ...)) |
| 4436 | ;; ("HELPFILE2" (("KWD2" . link) ...)) ...) | 4436 | ;; ("HELPFILE2" (("KWD2" . link) ...)) ...) |
| 4437 | ;; | 4437 | ;; |
| 4438 | ;; DIR will be supplied dynamically while loading library catalogs, | 4438 | ;; DIR will be supplied dynamically while loading library catalogs, |
| @@ -4491,7 +4491,7 @@ information updated immediately, leave NO-CONCATENATE nil." | |||
| 4491 | ;; The override-idle means, even if the idle timer has done some | 4491 | ;; The override-idle means, even if the idle timer has done some |
| 4492 | ;; preparing work, load and renormalize everything anyway. | 4492 | ;; preparing work, load and renormalize everything anyway. |
| 4493 | (override-idle (or arg idlwave-buffer-case-takes-precedence))) | 4493 | (override-idle (or arg idlwave-buffer-case-takes-precedence))) |
| 4494 | 4494 | ||
| 4495 | (setq idlwave-buffer-routines nil | 4495 | (setq idlwave-buffer-routines nil |
| 4496 | idlwave-compiled-routines nil | 4496 | idlwave-compiled-routines nil |
| 4497 | idlwave-unresolved-routines nil) | 4497 | idlwave-unresolved-routines nil) |
| @@ -4502,7 +4502,7 @@ information updated immediately, leave NO-CONCATENATE nil." | |||
| 4502 | (idlwave-reset-sintern (cond (load t) | 4502 | (idlwave-reset-sintern (cond (load t) |
| 4503 | ((null idlwave-system-routines) t) | 4503 | ((null idlwave-system-routines) t) |
| 4504 | (t 'bufsh)))) | 4504 | (t 'bufsh)))) |
| 4505 | 4505 | ||
| 4506 | (if idlwave-buffer-case-takes-precedence | 4506 | (if idlwave-buffer-case-takes-precedence |
| 4507 | ;; We can safely scan the buffer stuff first | 4507 | ;; We can safely scan the buffer stuff first |
| 4508 | (progn | 4508 | (progn |
| @@ -4517,9 +4517,9 @@ information updated immediately, leave NO-CONCATENATE nil." | |||
| 4517 | (idlwave-shell-is-running))) | 4517 | (idlwave-shell-is-running))) |
| 4518 | (ask-shell (and shell-is-running | 4518 | (ask-shell (and shell-is-running |
| 4519 | idlwave-query-shell-for-routine-info))) | 4519 | idlwave-query-shell-for-routine-info))) |
| 4520 | 4520 | ||
| 4521 | ;; Load the library catalogs again, first re-scanning the path | 4521 | ;; Load the library catalogs again, first re-scanning the path |
| 4522 | (when arg | 4522 | (when arg |
| 4523 | (if shell-is-running | 4523 | (if shell-is-running |
| 4524 | (idlwave-shell-send-command idlwave-shell-path-query | 4524 | (idlwave-shell-send-command idlwave-shell-path-query |
| 4525 | '(progn | 4525 | '(progn |
| @@ -4539,7 +4539,7 @@ information updated immediately, leave NO-CONCATENATE nil." | |||
| 4539 | ;; Therefore, we do a concatenation now, even though | 4539 | ;; Therefore, we do a concatenation now, even though |
| 4540 | ;; the shell might do it again. | 4540 | ;; the shell might do it again. |
| 4541 | (idlwave-concatenate-rinfo-lists nil 'run-hooks)) | 4541 | (idlwave-concatenate-rinfo-lists nil 'run-hooks)) |
| 4542 | 4542 | ||
| 4543 | (when ask-shell | 4543 | (when ask-shell |
| 4544 | ;; Ask the shell about the routines it knows of. | 4544 | ;; Ask the shell about the routines it knows of. |
| 4545 | (message "Querying the shell") | 4545 | (message "Querying the shell") |
| @@ -4576,26 +4576,26 @@ information updated immediately, leave NO-CONCATENATE nil." | |||
| 4576 | ;; which, if necessary, will be re-created from the XML file on | 4576 | ;; which, if necessary, will be re-created from the XML file on |
| 4577 | ;; disk. As a last fallback, load the (likely outdated) idlw-rinfo | 4577 | ;; disk. As a last fallback, load the (likely outdated) idlw-rinfo |
| 4578 | ;; file distributed with older IDLWAVE versions (<6.0) | 4578 | ;; 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 |
| 4580 | 'noerror 'nomessage) | 4580 | 'noerror 'nomessage) |
| 4581 | (idlwave-xml-system-routine-info-up-to-date)) | 4581 | (idlwave-xml-system-routine-info-up-to-date)) |
| 4582 | ;; See if we can create it from XML source | 4582 | ;; See if we can create it from XML source |
| 4583 | (condition-case nil | 4583 | (condition-case nil |
| 4584 | (idlwave-convert-xml-system-routine-info) | 4584 | (idlwave-convert-xml-system-routine-info) |
| 4585 | (error | 4585 | (error |
| 4586 | (unless (load idlwave-xml-system-rinfo-converted-file | 4586 | (unless (load idlwave-xml-system-rinfo-converted-file |
| 4587 | 'noerror 'nomessage) | 4587 | 'noerror 'nomessage) |
| 4588 | (if idlwave-system-routines | 4588 | (if idlwave-system-routines |
| 4589 | (message | 4589 | (message |
| 4590 | "Failed to load converted routine info, using old conversion.") | 4590 | "Failed to load converted routine info, using old conversion.") |
| 4591 | (message | 4591 | (message |
| 4592 | "Failed to convert XML routine info, falling back on idlw-rinfo.") | 4592 | "Failed to convert XML routine info, falling back on idlw-rinfo.") |
| 4593 | (if (not (load "idlw-rinfo" 'noerror 'nomessage)) | 4593 | (if (not (load "idlw-rinfo" 'noerror 'nomessage)) |
| 4594 | (message | 4594 | (message |
| 4595 | "Could not locate any system routine information.")))))))) | 4595 | "Could not locate any system routine information.")))))))) |
| 4596 | 4596 | ||
| 4597 | (defun idlwave-xml-system-routine-info-up-to-date() | 4597 | (defun idlwave-xml-system-routine-info-up-to-date() |
| 4598 | (let* ((dir (file-name-as-directory | 4598 | (let* ((dir (file-name-as-directory |
| 4599 | (expand-file-name "help/online_help" (idlwave-sys-dir)))) | 4599 | (expand-file-name "help/online_help" (idlwave-sys-dir)))) |
| 4600 | (catalog-file (expand-file-name "idl_catalog.xml" dir))) | 4600 | (catalog-file (expand-file-name "idl_catalog.xml" dir))) |
| 4601 | (file-newer-than-file-p ;converted file is newer than catalog | 4601 | (file-newer-than-file-p ;converted file is newer than catalog |
| @@ -4610,15 +4610,15 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4610 | "Alist of system variables and their help files.") | 4610 | "Alist of system variables and their help files.") |
| 4611 | (defvar idlwave-help-special-topic-words nil) | 4611 | (defvar idlwave-help-special-topic-words nil) |
| 4612 | 4612 | ||
| 4613 | 4613 | ||
| 4614 | (defun idlwave-shorten-syntax (syntax name &optional class) | 4614 | (defun idlwave-shorten-syntax (syntax name &optional class) |
| 4615 | ;; From a list of syntax statments, shorten with %s and group with "or" | 4615 | ;; From a list of syntax statments, shorten with %s and group with "or" |
| 4616 | (let ((case-fold-search t)) | 4616 | (let ((case-fold-search t)) |
| 4617 | (mapconcat | 4617 | (mapconcat |
| 4618 | (lambda (x) | 4618 | (lambda (x) |
| 4619 | (while (string-match name x) | 4619 | (while (string-match name x) |
| 4620 | (setq x (replace-match "%s" t t x))) | 4620 | (setq x (replace-match "%s" t t x))) |
| 4621 | (if class | 4621 | (if class |
| 4622 | (while (string-match class x) | 4622 | (while (string-match class x) |
| 4623 | (setq x (replace-match "%s" t t x)))) | 4623 | (setq x (replace-match "%s" t t x)))) |
| 4624 | x) | 4624 | x) |
| @@ -4670,8 +4670,8 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4670 | (put 'set-props 'matched t) | 4670 | (put 'set-props 'matched t) |
| 4671 | set-props) | 4671 | set-props) |
| 4672 | (t nil))) | 4672 | (t nil))) |
| 4673 | (setq methods-entry | 4673 | (setq methods-entry |
| 4674 | (nconc (idlwave-xml-create-rinfo-list pelem class extra-kwds) | 4674 | (nconc (idlwave-xml-create-rinfo-list pelem class extra-kwds) |
| 4675 | methods-entry))) | 4675 | methods-entry))) |
| 4676 | (t))) | 4676 | (t))) |
| 4677 | (setq params (cdr params))) | 4677 | (setq params (cdr params))) |
| @@ -4681,12 +4681,12 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4681 | ; (message "Failed to match GetProperty in class %s" class)) | 4681 | ; (message "Failed to match GetProperty in class %s" class)) |
| 4682 | ;(unless (get 'set-props 'matched) | 4682 | ;(unless (get 'set-props 'matched) |
| 4683 | ; (message "Failed to match SetProperty in class %s" class)) | 4683 | ; (message "Failed to match SetProperty in class %s" class)) |
| 4684 | (setq class-entry | 4684 | (setq class-entry |
| 4685 | (if inherits | 4685 | (if inherits |
| 4686 | (list class (append '(inherits) inherits) (list 'link link)) | 4686 | (list class (append '(inherits) inherits) (list 'link link)) |
| 4687 | (list class (list 'link link)))) | 4687 | (list class (list 'link link)))) |
| 4688 | (cons class-entry methods-entry))) | 4688 | (cons class-entry methods-entry))) |
| 4689 | 4689 | ||
| 4690 | (defun idlwave-xml-create-rinfo-list (xml-entry &optional class extra-kws) | 4690 | (defun idlwave-xml-create-rinfo-list (xml-entry &optional class extra-kws) |
| 4691 | ;; Create correctly structured list elements from ROUTINE or METHOD | 4691 | ;; Create correctly structured list elements from ROUTINE or METHOD |
| 4692 | ;; XML list structures. Return a list of list elements, with more | 4692 | ;; XML list structures. Return a list of list elements, with more |
| @@ -4722,8 +4722,8 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4722 | (setq kwd (cdr (assq 'name props)) | 4722 | (setq kwd (cdr (assq 'name props)) |
| 4723 | klink (cdr (assq 'link props))) | 4723 | klink (cdr (assq 'link props))) |
| 4724 | (if (string-match "^\\[XY\\(Z?\\)\\]" kwd) | 4724 | (if (string-match "^\\[XY\\(Z?\\)\\]" kwd) |
| 4725 | (progn | 4725 | (progn |
| 4726 | (setq pref-list | 4726 | (setq pref-list |
| 4727 | (if (match-string 1 kwd) '("X" "Y" "Z") '("X" "Y")) | 4727 | (if (match-string 1 kwd) '("X" "Y" "Z") '("X" "Y")) |
| 4728 | kwd (substring kwd (match-end 0))) | 4728 | kwd (substring kwd (match-end 0))) |
| 4729 | (loop for x in pref-list do | 4729 | (loop for x in pref-list do |
| @@ -4732,7 +4732,7 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4732 | 4732 | ||
| 4733 | (t))); Do nothing for the others | 4733 | (t))); Do nothing for the others |
| 4734 | (setq params (cdr params))) | 4734 | (setq params (cdr params))) |
| 4735 | 4735 | ||
| 4736 | ;; Debug | 4736 | ;; Debug |
| 4737 | ; (if (and (null (aref syntax-vec 0)) | 4737 | ; (if (and (null (aref syntax-vec 0)) |
| 4738 | ; (null (aref syntax-vec 1)) | 4738 | ; (null (aref syntax-vec 1)) |
| @@ -4749,16 +4749,16 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4749 | (setq kwds (idlwave-rinfo-group-keywords kwds link)) | 4749 | (setq kwds (idlwave-rinfo-group-keywords kwds link)) |
| 4750 | (loop for idx from 0 to 1 do | 4750 | (loop for idx from 0 to 1 do |
| 4751 | (if (aref syntax-vec idx) | 4751 | (if (aref syntax-vec idx) |
| 4752 | (push (append (list name (if (eq idx 0) 'pro 'fun) | 4752 | (push (append (list name (if (eq idx 0) 'pro 'fun) |
| 4753 | class '(system) | 4753 | class '(system) |
| 4754 | (idlwave-shorten-syntax | 4754 | (idlwave-shorten-syntax |
| 4755 | (aref syntax-vec idx) name class)) | 4755 | (aref syntax-vec idx) name class)) |
| 4756 | kwds) result))) | 4756 | kwds) result))) |
| 4757 | result))) | 4757 | result))) |
| 4758 | 4758 | ||
| 4759 | 4759 | ||
| 4760 | (defun idlwave-rinfo-group-keywords (kwds master-link) | 4760 | (defun idlwave-rinfo-group-keywords (kwds master-link) |
| 4761 | ;; Group keywords by link file, as a list with elements | 4761 | ;; Group keywords by link file, as a list with elements |
| 4762 | ;; (linkfile ( ("KWD1" . link1) ("KWD2" . link2)) | 4762 | ;; (linkfile ( ("KWD1" . link1) ("KWD2" . link2)) |
| 4763 | (let (kwd link anchor linkfiles block master-elt) | 4763 | (let (kwd link anchor linkfiles block master-elt) |
| 4764 | (while kwds | 4764 | (while kwds |
| @@ -4777,7 +4777,7 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4777 | linkfiles | 4777 | linkfiles |
| 4778 | (cons master-elt (delq master-elt linkfiles))) | 4778 | (cons master-elt (delq master-elt linkfiles))) |
| 4779 | (push (list master-link) linkfiles)))) | 4779 | (push (list master-link) linkfiles)))) |
| 4780 | 4780 | ||
| 4781 | (defun idlwave-convert-xml-clean-statement-aliases (aliases) | 4781 | (defun idlwave-convert-xml-clean-statement-aliases (aliases) |
| 4782 | ;; Clean up the syntax of routines which are actually aliases by | 4782 | ;; Clean up the syntax of routines which are actually aliases by |
| 4783 | ;; removing the "OR" from the statements | 4783 | ;; removing the "OR" from the statements |
| @@ -4790,7 +4790,7 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4790 | 4790 | ||
| 4791 | (defun idlwave-convert-xml-clean-routine-aliases (aliases) | 4791 | (defun idlwave-convert-xml-clean-routine-aliases (aliases) |
| 4792 | ;; Duplicate and trim original routine aliases from rinfo list | 4792 | ;; Duplicate and trim original routine aliases from rinfo list |
| 4793 | ;; This if for, e.g. OPENR/OPENW/OPENU | 4793 | ;; This if for, e.g. OPENR/OPENW/OPENU |
| 4794 | (let (alias remove-list new parts all-parts) | 4794 | (let (alias remove-list new parts all-parts) |
| 4795 | (loop for x in aliases do | 4795 | (loop for x in aliases do |
| 4796 | (when (setq parts (split-string (cdr x) "/")) | 4796 | (when (setq parts (split-string (cdr x) "/")) |
| @@ -4799,7 +4799,7 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4799 | (setq new (cons (cdr x) parts)) | 4799 | (setq new (cons (cdr x) parts)) |
| 4800 | (push new all-parts)) | 4800 | (push new all-parts)) |
| 4801 | (setcdr new (delete (car x) (cdr new))))) | 4801 | (setcdr new (delete (car x) (cdr new))))) |
| 4802 | 4802 | ||
| 4803 | ;; Add any missing aliases (separate by slashes) | 4803 | ;; Add any missing aliases (separate by slashes) |
| 4804 | (loop for x in all-parts do | 4804 | (loop for x in all-parts do |
| 4805 | (if (cdr x) | 4805 | (if (cdr x) |
| @@ -4843,7 +4843,7 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4843 | props (car (cdr pelem))) | 4843 | props (car (cdr pelem))) |
| 4844 | (cond | 4844 | (cond |
| 4845 | ((eq ptype 'FIELD) | 4845 | ((eq ptype 'FIELD) |
| 4846 | (push (cons (cdr (assq 'name props)) | 4846 | (push (cons (cdr (assq 'name props)) |
| 4847 | (cdr | 4847 | (cdr |
| 4848 | (idlwave-split-link-target (cdr (assq 'link props))))) | 4848 | (idlwave-split-link-target (cdr (assq 'link props))))) |
| 4849 | tags)))) | 4849 | tags)))) |
| @@ -4857,10 +4857,10 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4857 | (defun idlwave-save-routine-info () | 4857 | (defun idlwave-save-routine-info () |
| 4858 | (if idlwave-xml-routine-info-file | 4858 | (if idlwave-xml-routine-info-file |
| 4859 | (with-temp-file idlwave-xml-system-rinfo-converted-file | 4859 | (with-temp-file idlwave-xml-system-rinfo-converted-file |
| 4860 | (insert | 4860 | (insert |
| 4861 | (concat ";; *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* | 4861 | (concat ";; *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* |
| 4862 | ;; IDLWAVE Routine Information File (IDLWAVE version " idlwave-mode-version ") | 4862 | ;; IDLWAVE Routine Information File (IDLWAVE version " idlwave-mode-version ") |
| 4863 | ;; Automatically generated from source file: | 4863 | ;; Automatically generated from source file: |
| 4864 | ;; " idlwave-xml-routine-info-file " | 4864 | ;; " idlwave-xml-routine-info-file " |
| 4865 | ;; on " (current-time-string) " | 4865 | ;; on " (current-time-string) " |
| 4866 | ;; Do not edit.")) | 4866 | ;; Do not edit.")) |
| @@ -4886,11 +4886,11 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4886 | "Convert XML supplied IDL routine info into internal form. | 4886 | "Convert XML supplied IDL routine info into internal form. |
| 4887 | Cache to disk for quick recovery." | 4887 | Cache to disk for quick recovery." |
| 4888 | (interactive) | 4888 | (interactive) |
| 4889 | (let* ((dir (file-name-as-directory | 4889 | (let* ((dir (file-name-as-directory |
| 4890 | (expand-file-name "help/online_help" (idlwave-sys-dir)))) | 4890 | (expand-file-name "help/online_help" (idlwave-sys-dir)))) |
| 4891 | (catalog-file (expand-file-name "idl_catalog.xml" dir)) | 4891 | (catalog-file (expand-file-name "idl_catalog.xml" dir)) |
| 4892 | (elem-cnt 0) | 4892 | (elem-cnt 0) |
| 4893 | props rinfo msg-cnt elem type nelem class-result alias | 4893 | props rinfo msg-cnt elem type nelem class-result alias |
| 4894 | routines routine-aliases statement-aliases sysvar-aliases | 4894 | routines routine-aliases statement-aliases sysvar-aliases |
| 4895 | buf version-string) | 4895 | buf version-string) |
| 4896 | (if (not (file-exists-p catalog-file)) | 4896 | (if (not (file-exists-p catalog-file)) |
| @@ -4898,7 +4898,7 @@ Cache to disk for quick recovery." | |||
| 4898 | (if (not (file-readable-p catalog-file)) | 4898 | (if (not (file-readable-p catalog-file)) |
| 4899 | (error "Cannot read XML routine info file: %s" catalog-file))) | 4899 | (error "Cannot read XML routine info file: %s" catalog-file))) |
| 4900 | (require 'xml) | 4900 | (require 'xml) |
| 4901 | (message "Reading XML routine info...") | 4901 | (message "Reading XML routine info...") |
| 4902 | (unwind-protect | 4902 | (unwind-protect |
| 4903 | (progn | 4903 | (progn |
| 4904 | ;; avoid warnings about read-only files | 4904 | ;; avoid warnings about read-only files |
| @@ -4909,13 +4909,13 @@ Cache to disk for quick recovery." | |||
| 4909 | (setq rinfo (assq 'CATALOG rinfo)) | 4909 | (setq rinfo (assq 'CATALOG rinfo)) |
| 4910 | (unless rinfo (error "Failed to parse XML routine info")) | 4910 | (unless rinfo (error "Failed to parse XML routine info")) |
| 4911 | ;;(setq rinfo (car rinfo)) ; Skip the catalog stuff. | 4911 | ;;(setq rinfo (car rinfo)) ; Skip the catalog stuff. |
| 4912 | 4912 | ||
| 4913 | (setq version-string (cdr (assq 'version (nth 1 rinfo))) | 4913 | (setq version-string (cdr (assq 'version (nth 1 rinfo))) |
| 4914 | rinfo (cddr rinfo)) | 4914 | rinfo (cddr rinfo)) |
| 4915 | 4915 | ||
| 4916 | (setq nelem (length rinfo) | 4916 | (setq nelem (length rinfo) |
| 4917 | msg-cnt (/ nelem 20)) | 4917 | msg-cnt (/ nelem 20)) |
| 4918 | 4918 | ||
| 4919 | (setq idlwave-xml-routine-info-file nil) | 4919 | (setq idlwave-xml-routine-info-file nil) |
| 4920 | (message "Converting XML routine info...") | 4920 | (message "Converting XML routine info...") |
| 4921 | (setq idlwave-system-routines nil | 4921 | (setq idlwave-system-routines nil |
| @@ -4932,12 +4932,12 @@ Cache to disk for quick recovery." | |||
| 4932 | (setq type (car elem) | 4932 | (setq type (car elem) |
| 4933 | props (car (cdr elem))) | 4933 | props (car (cdr elem))) |
| 4934 | (if (= (mod elem-cnt msg-cnt) 0) | 4934 | (if (= (mod elem-cnt msg-cnt) 0) |
| 4935 | (message "Converting XML routine info...%2d%%" | 4935 | (message "Converting XML routine info...%2d%%" |
| 4936 | (/ (* elem-cnt 100) nelem))) | 4936 | (/ (* elem-cnt 100) nelem))) |
| 4937 | (cond | 4937 | (cond |
| 4938 | ((eq type 'ROUTINE) | 4938 | ((eq type 'ROUTINE) |
| 4939 | (if (setq alias (assq 'alias_to props)) | 4939 | (if (setq alias (assq 'alias_to props)) |
| 4940 | (push (cons (cdr (assq 'name props)) (cdr alias)) | 4940 | (push (cons (cdr (assq 'name props)) (cdr alias)) |
| 4941 | routine-aliases) | 4941 | routine-aliases) |
| 4942 | (setq routines (idlwave-xml-create-rinfo-list elem)) | 4942 | (setq routines (idlwave-xml-create-rinfo-list elem)) |
| 4943 | (if (listp (cdr routines)) | 4943 | (if (listp (cdr routines)) |
| @@ -4945,7 +4945,7 @@ Cache to disk for quick recovery." | |||
| 4945 | (nconc idlwave-system-routines routines)) | 4945 | (nconc idlwave-system-routines routines)) |
| 4946 | ;; a cons cell is an executive commands | 4946 | ;; a cons cell is an executive commands |
| 4947 | (push routines idlwave-executive-commands-alist)))) | 4947 | (push routines idlwave-executive-commands-alist)))) |
| 4948 | 4948 | ||
| 4949 | ((eq type 'CLASS) | 4949 | ((eq type 'CLASS) |
| 4950 | (setq class-result (idlwave-xml-create-class-method-lists elem)) | 4950 | (setq class-result (idlwave-xml-create-class-method-lists elem)) |
| 4951 | (push (car class-result) idlwave-system-class-info) | 4951 | (push (car class-result) idlwave-system-class-info) |
| @@ -4963,10 +4963,10 @@ Cache to disk for quick recovery." | |||
| 4963 | 4963 | ||
| 4964 | ((eq type 'SYSVAR) | 4964 | ((eq type 'SYSVAR) |
| 4965 | (if (setq alias (cdr (assq 'alias_to props))) | 4965 | (if (setq alias (cdr (assq 'alias_to props))) |
| 4966 | (push (cons (substring (cdr (assq 'name props)) 1) | 4966 | (push (cons (substring (cdr (assq 'name props)) 1) |
| 4967 | (substring alias 1)) | 4967 | (substring alias 1)) |
| 4968 | sysvar-aliases) | 4968 | sysvar-aliases) |
| 4969 | (push (idlwave-xml-create-sysvar-alist elem) | 4969 | (push (idlwave-xml-create-sysvar-alist elem) |
| 4970 | idlwave-system-variables-alist))) | 4970 | idlwave-system-variables-alist))) |
| 4971 | (t)))) | 4971 | (t)))) |
| 4972 | (idlwave-convert-xml-clean-routine-aliases routine-aliases) | 4972 | (idlwave-convert-xml-clean-routine-aliases routine-aliases) |
| @@ -4976,12 +4976,12 @@ Cache to disk for quick recovery." | |||
| 4976 | (setq idlwave-xml-routine-info-file catalog-file) | 4976 | (setq idlwave-xml-routine-info-file catalog-file) |
| 4977 | (idlwave-save-routine-info) | 4977 | (idlwave-save-routine-info) |
| 4978 | (message "Converting XML routine info...done"))) | 4978 | (message "Converting XML routine info...done"))) |
| 4979 | 4979 | ||
| 4980 | 4980 | ||
| 4981 | ;; ("ROUTINE" type class | 4981 | ;; ("ROUTINE" type class |
| 4982 | ;; (system) | (lib pro_file dir "LIBNAME") | (user pro_file dir "USERLIB") | | 4982 | ;; (system) | (lib pro_file dir "LIBNAME") | (user pro_file dir "USERLIB") | |
| 4983 | ;; (buffer pro_file dir) | (compiled pro_file dir) | 4983 | ;; (buffer pro_file dir) | (compiled pro_file dir) |
| 4984 | ;; "calling_string" ("HELPFILE" (("KWD1" . link1) ...)) | 4984 | ;; "calling_string" ("HELPFILE" (("KWD1" . link1) ...)) |
| 4985 | ;; ("HELPFILE2" (("KWD2" . link) ...)) ...) | 4985 | ;; ("HELPFILE2" (("KWD2" . link) ...)) ...) |
| 4986 | 4986 | ||
| 4987 | 4987 | ||
| @@ -4996,7 +4996,7 @@ Cache to disk for quick recovery." | |||
| 4996 | (message "Loading system routine info in idle time...done") | 4996 | (message "Loading system routine info in idle time...done") |
| 4997 | (aset arr 0 t) | 4997 | (aset arr 0 t) |
| 4998 | (throw 'exit t)) | 4998 | (throw 'exit t)) |
| 4999 | 4999 | ||
| 5000 | (when (not (aref arr 1)) | 5000 | (when (not (aref arr 1)) |
| 5001 | (message "Normalizing idlwave-system-routines in idle time...") | 5001 | (message "Normalizing idlwave-system-routines in idle time...") |
| 5002 | (idlwave-reset-sintern t) | 5002 | (idlwave-reset-sintern t) |
| @@ -5021,7 +5021,7 @@ Cache to disk for quick recovery." | |||
| 5021 | (progn | 5021 | (progn |
| 5022 | (setq idlwave-library-routines nil) | 5022 | (setq idlwave-library-routines nil) |
| 5023 | (ding) | 5023 | (ding) |
| 5024 | (message "Outdated user catalog: %s... recreate" | 5024 | (message "Outdated user catalog: %s... recreate" |
| 5025 | idlwave-user-catalog-file)) | 5025 | idlwave-user-catalog-file)) |
| 5026 | (message "Loading user catalog in idle time...done"))) | 5026 | (message "Loading user catalog in idle time...done"))) |
| 5027 | (aset arr 2 t) | 5027 | (aset arr 2 t) |
| @@ -5030,16 +5030,16 @@ Cache to disk for quick recovery." | |||
| 5030 | (when (not (aref arr 3)) | 5030 | (when (not (aref arr 3)) |
| 5031 | (when idlwave-user-catalog-routines | 5031 | (when idlwave-user-catalog-routines |
| 5032 | (message "Normalizing user catalog routines in idle time...") | 5032 | (message "Normalizing user catalog routines in idle time...") |
| 5033 | (setq idlwave-user-catalog-routines | 5033 | (setq idlwave-user-catalog-routines |
| 5034 | (idlwave-sintern-rinfo-list | 5034 | (idlwave-sintern-rinfo-list |
| 5035 | idlwave-user-catalog-routines 'sys)) | 5035 | idlwave-user-catalog-routines 'sys)) |
| 5036 | (message | 5036 | (message |
| 5037 | "Normalizing user catalog routines in idle time...done")) | 5037 | "Normalizing user catalog routines in idle time...done")) |
| 5038 | (aset arr 3 t) | 5038 | (aset arr 3 t) |
| 5039 | (throw 'exit t)) | 5039 | (throw 'exit t)) |
| 5040 | 5040 | ||
| 5041 | (when (not (aref arr 4)) | 5041 | (when (not (aref arr 4)) |
| 5042 | (idlwave-scan-library-catalogs | 5042 | (idlwave-scan-library-catalogs |
| 5043 | "Loading and normalizing library catalogs in idle time...") | 5043 | "Loading and normalizing library catalogs in idle time...") |
| 5044 | (aset arr 4 t) | 5044 | (aset arr 4 t) |
| 5045 | (throw 'exit t)) | 5045 | (throw 'exit t)) |
| @@ -5047,7 +5047,7 @@ Cache to disk for quick recovery." | |||
| 5047 | (message "Finishing initialization in idle time...") | 5047 | (message "Finishing initialization in idle time...") |
| 5048 | (idlwave-routines) | 5048 | (idlwave-routines) |
| 5049 | (message "Finishing initialization in idle time...done") | 5049 | (message "Finishing initialization in idle time...done") |
| 5050 | (aset arr 5 t) | 5050 | (aset arr 5 t) |
| 5051 | (throw 'exit nil))) | 5051 | (throw 'exit nil))) |
| 5052 | ;; restart the timer | 5052 | ;; restart the timer |
| 5053 | (if (sit-for 1) | 5053 | (if (sit-for 1) |
| @@ -5082,17 +5082,17 @@ Cache to disk for quick recovery." | |||
| 5082 | (when (or force (not (aref idlwave-load-rinfo-steps-done 2))) | 5082 | (when (or force (not (aref idlwave-load-rinfo-steps-done 2))) |
| 5083 | (load-file idlwave-user-catalog-file)) | 5083 | (load-file idlwave-user-catalog-file)) |
| 5084 | (error nil)) | 5084 | (error nil)) |
| 5085 | (when (and | 5085 | (when (and |
| 5086 | (boundp 'idlwave-library-routines) | 5086 | (boundp 'idlwave-library-routines) |
| 5087 | idlwave-library-routines) | 5087 | idlwave-library-routines) |
| 5088 | (setq idlwave-library-routines nil) | 5088 | (setq idlwave-library-routines nil) |
| 5089 | (error "Outdated user catalog: %s... recreate" | 5089 | (error "Outdated user catalog: %s... recreate" |
| 5090 | idlwave-user-catalog-file)) | 5090 | idlwave-user-catalog-file)) |
| 5091 | (setq idlwave-true-path-alist nil) | 5091 | (setq idlwave-true-path-alist nil) |
| 5092 | (when (or force (not (aref idlwave-load-rinfo-steps-done 3))) | 5092 | (when (or force (not (aref idlwave-load-rinfo-steps-done 3))) |
| 5093 | (message "Normalizing user catalog routines...") | 5093 | (message "Normalizing user catalog routines...") |
| 5094 | (setq idlwave-user-catalog-routines | 5094 | (setq idlwave-user-catalog-routines |
| 5095 | (idlwave-sintern-rinfo-list | 5095 | (idlwave-sintern-rinfo-list |
| 5096 | idlwave-user-catalog-routines 'sys)) | 5096 | idlwave-user-catalog-routines 'sys)) |
| 5097 | (message "Normalizing user catalog routines...done"))) | 5097 | (message "Normalizing user catalog routines...done"))) |
| 5098 | 5098 | ||
| @@ -5105,11 +5105,11 @@ Cache to disk for quick recovery." | |||
| 5105 | 5105 | ||
| 5106 | (defun idlwave-update-buffer-routine-info () | 5106 | (defun idlwave-update-buffer-routine-info () |
| 5107 | (let (res) | 5107 | (let (res) |
| 5108 | (cond | 5108 | (cond |
| 5109 | ((eq idlwave-scan-all-buffers-for-routine-info t) | 5109 | ((eq idlwave-scan-all-buffers-for-routine-info t) |
| 5110 | ;; Scan all buffers, current buffer last | 5110 | ;; Scan all buffers, current buffer last |
| 5111 | (message "Scanning all buffers...") | 5111 | (message "Scanning all buffers...") |
| 5112 | (setq res (idlwave-get-routine-info-from-buffers | 5112 | (setq res (idlwave-get-routine-info-from-buffers |
| 5113 | (reverse (buffer-list))))) | 5113 | (reverse (buffer-list))))) |
| 5114 | ((null idlwave-scan-all-buffers-for-routine-info) | 5114 | ((null idlwave-scan-all-buffers-for-routine-info) |
| 5115 | ;; Don't scan any buffers | 5115 | ;; Don't scan any buffers |
| @@ -5122,12 +5122,12 @@ Cache to disk for quick recovery." | |||
| 5122 | (setq res (idlwave-get-routine-info-from-buffers | 5122 | (setq res (idlwave-get-routine-info-from-buffers |
| 5123 | (list (current-buffer)))))))) | 5123 | (list (current-buffer)))))))) |
| 5124 | ;; Put the result into the correct variable | 5124 | ;; Put the result into the correct variable |
| 5125 | (setq idlwave-buffer-routines | 5125 | (setq idlwave-buffer-routines |
| 5126 | (idlwave-sintern-rinfo-list res 'set)))) | 5126 | (idlwave-sintern-rinfo-list res 'set)))) |
| 5127 | 5127 | ||
| 5128 | (defun idlwave-concatenate-rinfo-lists (&optional quiet run-hook) | 5128 | (defun idlwave-concatenate-rinfo-lists (&optional quiet run-hook) |
| 5129 | "Put the different sources for routine information together." | 5129 | "Put the different sources for routine information together." |
| 5130 | ;; The sequence here is important because earlier definitions shadow | 5130 | ;; The sequence here is important because earlier definitions shadow |
| 5131 | ;; later ones. We assume that if things in the buffers are newer | 5131 | ;; later ones. We assume that if things in the buffers are newer |
| 5132 | ;; then in the shell of the system, they are meant to be different. | 5132 | ;; then in the shell of the system, they are meant to be different. |
| 5133 | (setcdr idlwave-last-system-routine-info-cons-cell | 5133 | (setcdr idlwave-last-system-routine-info-cons-cell |
| @@ -5139,7 +5139,7 @@ Cache to disk for quick recovery." | |||
| 5139 | 5139 | ||
| 5140 | ;; Give a message with information about the number of routines we have. | 5140 | ;; Give a message with information about the number of routines we have. |
| 5141 | (unless quiet | 5141 | (unless quiet |
| 5142 | (message | 5142 | (message |
| 5143 | "Routines Found: buffer(%d) compiled(%d) library(%d) user(%d) system(%d)" | 5143 | "Routines Found: buffer(%d) compiled(%d) library(%d) user(%d) system(%d)" |
| 5144 | (length idlwave-buffer-routines) | 5144 | (length idlwave-buffer-routines) |
| 5145 | (length idlwave-compiled-routines) | 5145 | (length idlwave-compiled-routines) |
| @@ -5157,7 +5157,7 @@ Cache to disk for quick recovery." | |||
| 5157 | (when (and (setq class (nth 2 x)) | 5157 | (when (and (setq class (nth 2 x)) |
| 5158 | (not (assq class idlwave-class-alist))) | 5158 | (not (assq class idlwave-class-alist))) |
| 5159 | (push (list class) idlwave-class-alist))) | 5159 | (push (list class) idlwave-class-alist))) |
| 5160 | idlwave-class-alist))) | 5160 | idlwave-class-alist))) |
| 5161 | 5161 | ||
| 5162 | ;; Three functions for the hooks | 5162 | ;; Three functions for the hooks |
| 5163 | (defun idlwave-save-buffer-update () | 5163 | (defun idlwave-save-buffer-update () |
| @@ -5190,7 +5190,7 @@ Cache to disk for quick recovery." | |||
| 5190 | 5190 | ||
| 5191 | (defun idlwave-replace-buffer-routine-info (file new) | 5191 | (defun idlwave-replace-buffer-routine-info (file new) |
| 5192 | "Cut the part from FILE out of `idlwave-buffer-routines' and add NEW." | 5192 | "Cut the part from FILE out of `idlwave-buffer-routines' and add NEW." |
| 5193 | (let ((list idlwave-buffer-routines) | 5193 | (let ((list idlwave-buffer-routines) |
| 5194 | found) | 5194 | found) |
| 5195 | (while list | 5195 | (while list |
| 5196 | ;; The following test uses eq to make sure it works correctly | 5196 | ;; The following test uses eq to make sure it works correctly |
| @@ -5201,7 +5201,7 @@ Cache to disk for quick recovery." | |||
| 5201 | (setcar list nil) | 5201 | (setcar list nil) |
| 5202 | (setq found t)) | 5202 | (setq found t)) |
| 5203 | (if found | 5203 | (if found |
| 5204 | ;; End of that section reached. Jump. | 5204 | ;; End of that section reached. Jump. |
| 5205 | (setq list nil))) | 5205 | (setq list nil))) |
| 5206 | (setq list (cdr list))) | 5206 | (setq list (cdr list))) |
| 5207 | (setq idlwave-buffer-routines | 5207 | (setq idlwave-buffer-routines |
| @@ -5233,11 +5233,11 @@ Cache to disk for quick recovery." | |||
| 5233 | (save-restriction | 5233 | (save-restriction |
| 5234 | (widen) | 5234 | (widen) |
| 5235 | (goto-char (point-min)) | 5235 | (goto-char (point-min)) |
| 5236 | (while (re-search-forward | 5236 | (while (re-search-forward |
| 5237 | "^[ \t]*\\(pro\\|function\\)[ \t]" nil t) | 5237 | "^[ \t]*\\(pro\\|function\\)[ \t]" nil t) |
| 5238 | (setq string (buffer-substring-no-properties | 5238 | (setq string (buffer-substring-no-properties |
| 5239 | (match-beginning 0) | 5239 | (match-beginning 0) |
| 5240 | (progn | 5240 | (progn |
| 5241 | (idlwave-end-of-statement) | 5241 | (idlwave-end-of-statement) |
| 5242 | (point)))) | 5242 | (point)))) |
| 5243 | (setq entry (idlwave-parse-definition string)) | 5243 | (setq entry (idlwave-parse-definition string)) |
| @@ -5275,7 +5275,7 @@ Cache to disk for quick recovery." | |||
| 5275 | (push (match-string 1 string) args))) | 5275 | (push (match-string 1 string) args))) |
| 5276 | ;; Normalize and sort. | 5276 | ;; Normalize and sort. |
| 5277 | (setq args (nreverse args)) | 5277 | (setq args (nreverse args)) |
| 5278 | (setq keywords (sort keywords (lambda (a b) | 5278 | (setq keywords (sort keywords (lambda (a b) |
| 5279 | (string< (downcase a) (downcase b))))) | 5279 | (string< (downcase a) (downcase b))))) |
| 5280 | ;; Make and return the entry | 5280 | ;; Make and return the entry |
| 5281 | ;; We don't know which argument are optional, so this information | 5281 | ;; We don't know which argument are optional, so this information |
| @@ -5285,7 +5285,7 @@ Cache to disk for quick recovery." | |||
| 5285 | class | 5285 | class |
| 5286 | (cond ((not (boundp 'idlwave-scanning-lib)) | 5286 | (cond ((not (boundp 'idlwave-scanning-lib)) |
| 5287 | (list 'buffer (buffer-file-name))) | 5287 | (list 'buffer (buffer-file-name))) |
| 5288 | ; ((string= (downcase | 5288 | ; ((string= (downcase |
| 5289 | ; (file-name-sans-extension | 5289 | ; (file-name-sans-extension |
| 5290 | ; (file-name-nondirectory (buffer-file-name)))) | 5290 | ; (file-name-nondirectory (buffer-file-name)))) |
| 5291 | ; (downcase name)) | 5291 | ; (downcase name)) |
| @@ -5293,7 +5293,7 @@ Cache to disk for quick recovery." | |||
| 5293 | ; (t (cons 'lib (file-name-nondirectory (buffer-file-name)))) | 5293 | ; (t (cons 'lib (file-name-nondirectory (buffer-file-name)))) |
| 5294 | (t (list 'user (file-name-nondirectory (buffer-file-name)) | 5294 | (t (list 'user (file-name-nondirectory (buffer-file-name)) |
| 5295 | idlwave-scanning-lib-dir "UserLib"))) | 5295 | idlwave-scanning-lib-dir "UserLib"))) |
| 5296 | (concat | 5296 | (concat |
| 5297 | (if (string= type "function") "Result = " "") | 5297 | (if (string= type "function") "Result = " "") |
| 5298 | (if class "Obj ->[%s::]" "") | 5298 | (if class "Obj ->[%s::]" "") |
| 5299 | "%s" | 5299 | "%s" |
| @@ -5339,10 +5339,10 @@ time - so no widget will pop up." | |||
| 5339 | (> (length idlwave-user-catalog-file) 0) | 5339 | (> (length idlwave-user-catalog-file) 0) |
| 5340 | (file-accessible-directory-p | 5340 | (file-accessible-directory-p |
| 5341 | (file-name-directory idlwave-user-catalog-file)) | 5341 | (file-name-directory idlwave-user-catalog-file)) |
| 5342 | (not (string= "" (file-name-nondirectory | 5342 | (not (string= "" (file-name-nondirectory |
| 5343 | idlwave-user-catalog-file)))) | 5343 | idlwave-user-catalog-file)))) |
| 5344 | (error "`idlwave-user-catalog-file' does not point to a file in an accessible directory")) | 5344 | (error "`idlwave-user-catalog-file' does not point to a file in an accessible directory")) |
| 5345 | 5345 | ||
| 5346 | (cond | 5346 | (cond |
| 5347 | ;; Rescan the known directories | 5347 | ;; Rescan the known directories |
| 5348 | ((and arg idlwave-path-alist | 5348 | ((and arg idlwave-path-alist |
| @@ -5352,13 +5352,13 @@ time - so no widget will pop up." | |||
| 5352 | ;; Expand the directories from library-path and run the widget | 5352 | ;; Expand the directories from library-path and run the widget |
| 5353 | (idlwave-library-path | 5353 | (idlwave-library-path |
| 5354 | (idlwave-display-user-catalog-widget | 5354 | (idlwave-display-user-catalog-widget |
| 5355 | (if idlwave-true-path-alist | 5355 | (if idlwave-true-path-alist |
| 5356 | ;; Propagate any flags on the existing path-alist | 5356 | ;; Propagate any flags on the existing path-alist |
| 5357 | (mapcar (lambda (x) | 5357 | (mapcar (lambda (x) |
| 5358 | (let ((path-entry (assoc (file-truename x) | 5358 | (let ((path-entry (assoc (file-truename x) |
| 5359 | idlwave-true-path-alist))) | 5359 | idlwave-true-path-alist))) |
| 5360 | (if path-entry | 5360 | (if path-entry |
| 5361 | (cons x (cdr path-entry)) | 5361 | (cons x (cdr path-entry)) |
| 5362 | (list x)))) | 5362 | (list x)))) |
| 5363 | (idlwave-expand-path idlwave-library-path)) | 5363 | (idlwave-expand-path idlwave-library-path)) |
| 5364 | (mapcar 'list (idlwave-expand-path idlwave-library-path))))) | 5364 | (mapcar 'list (idlwave-expand-path idlwave-library-path))))) |
| @@ -5383,7 +5383,7 @@ time - so no widget will pop up." | |||
| 5383 | (idlwave-scan-library-catalogs "Locating library catalogs..." 'no-load) | 5383 | (idlwave-scan-library-catalogs "Locating library catalogs..." 'no-load) |
| 5384 | (idlwave-display-user-catalog-widget idlwave-path-alist))) | 5384 | (idlwave-display-user-catalog-widget idlwave-path-alist))) |
| 5385 | 5385 | ||
| 5386 | (defconst idlwave-user-catalog-widget-help-string | 5386 | (defconst idlwave-user-catalog-widget-help-string |
| 5387 | "This is the front-end to the creation of the IDLWAVE user catalog. | 5387 | "This is the front-end to the creation of the IDLWAVE user catalog. |
| 5388 | Please select the directories on IDL's search path from which you | 5388 | Please select the directories on IDL's search path from which you |
| 5389 | would like to extract routine information, to be stored in the file: | 5389 | would like to extract routine information, to be stored in the file: |
| @@ -5418,7 +5418,7 @@ directories and save the routine info. | |||
| 5418 | (make-local-variable 'idlwave-widget) | 5418 | (make-local-variable 'idlwave-widget) |
| 5419 | (widget-insert (format idlwave-user-catalog-widget-help-string | 5419 | (widget-insert (format idlwave-user-catalog-widget-help-string |
| 5420 | idlwave-user-catalog-file)) | 5420 | idlwave-user-catalog-file)) |
| 5421 | 5421 | ||
| 5422 | (widget-create 'push-button | 5422 | (widget-create 'push-button |
| 5423 | :notify 'idlwave-widget-scan-user-lib-files | 5423 | :notify 'idlwave-widget-scan-user-lib-files |
| 5424 | "Scan & Save") | 5424 | "Scan & Save") |
| @@ -5428,7 +5428,7 @@ directories and save the routine info. | |||
| 5428 | "Delete File") | 5428 | "Delete File") |
| 5429 | (widget-insert " ") | 5429 | (widget-insert " ") |
| 5430 | (widget-create 'push-button | 5430 | (widget-create 'push-button |
| 5431 | :notify | 5431 | :notify |
| 5432 | '(lambda (&rest ignore) | 5432 | '(lambda (&rest ignore) |
| 5433 | (let ((path-list (widget-get idlwave-widget :path-dirs))) | 5433 | (let ((path-list (widget-get idlwave-widget :path-dirs))) |
| 5434 | (mapcar (lambda (x) | 5434 | (mapcar (lambda (x) |
| @@ -5439,7 +5439,7 @@ directories and save the routine info. | |||
| 5439 | "Select All Non-Lib") | 5439 | "Select All Non-Lib") |
| 5440 | (widget-insert " ") | 5440 | (widget-insert " ") |
| 5441 | (widget-create 'push-button | 5441 | (widget-create 'push-button |
| 5442 | :notify | 5442 | :notify |
| 5443 | '(lambda (&rest ignore) | 5443 | '(lambda (&rest ignore) |
| 5444 | (let ((path-list (widget-get idlwave-widget :path-dirs))) | 5444 | (let ((path-list (widget-get idlwave-widget :path-dirs))) |
| 5445 | (mapcar (lambda (x) | 5445 | (mapcar (lambda (x) |
| @@ -5455,18 +5455,18 @@ directories and save the routine info. | |||
| 5455 | (widget-insert "\n\n") | 5455 | (widget-insert "\n\n") |
| 5456 | 5456 | ||
| 5457 | (widget-insert "Select Directories: \n") | 5457 | (widget-insert "Select Directories: \n") |
| 5458 | 5458 | ||
| 5459 | (setq idlwave-widget | 5459 | (setq idlwave-widget |
| 5460 | (apply 'widget-create | 5460 | (apply 'widget-create |
| 5461 | 'checklist | 5461 | 'checklist |
| 5462 | :value (delq nil (mapcar (lambda (x) | 5462 | :value (delq nil (mapcar (lambda (x) |
| 5463 | (if (memq 'user (cdr x)) | 5463 | (if (memq 'user (cdr x)) |
| 5464 | (car x))) | 5464 | (car x))) |
| 5465 | dirs-list)) | 5465 | dirs-list)) |
| 5466 | :greedy t | 5466 | :greedy t |
| 5467 | :tag "List of directories" | 5467 | :tag "List of directories" |
| 5468 | (mapcar (lambda (x) | 5468 | (mapcar (lambda (x) |
| 5469 | (list 'item | 5469 | (list 'item |
| 5470 | (if (memq 'lib (cdr x)) | 5470 | (if (memq 'lib (cdr x)) |
| 5471 | (concat "[LIB] " (car x) ) | 5471 | (concat "[LIB] " (car x) ) |
| 5472 | (car x)))) dirs-list))) | 5472 | (car x)))) dirs-list))) |
| @@ -5476,7 +5476,7 @@ directories and save the routine info. | |||
| 5476 | (widget-setup) | 5476 | (widget-setup) |
| 5477 | (goto-char (point-min)) | 5477 | (goto-char (point-min)) |
| 5478 | (delete-other-windows)) | 5478 | (delete-other-windows)) |
| 5479 | 5479 | ||
| 5480 | (defun idlwave-delete-user-catalog-file (&rest ignore) | 5480 | (defun idlwave-delete-user-catalog-file (&rest ignore) |
| 5481 | (if (yes-or-no-p | 5481 | (if (yes-or-no-p |
| 5482 | (format "Delete file %s " idlwave-user-catalog-file)) | 5482 | (format "Delete file %s " idlwave-user-catalog-file)) |
| @@ -5492,7 +5492,7 @@ directories and save the routine info. | |||
| 5492 | (this-path-alist path-alist) | 5492 | (this-path-alist path-alist) |
| 5493 | dir-entry) | 5493 | dir-entry) |
| 5494 | (while (setq dir-entry (pop this-path-alist)) | 5494 | (while (setq dir-entry (pop this-path-alist)) |
| 5495 | (if (member | 5495 | (if (member |
| 5496 | (if (memq 'lib (cdr dir-entry)) | 5496 | (if (memq 'lib (cdr dir-entry)) |
| 5497 | (concat "[LIB] " (car dir-entry)) | 5497 | (concat "[LIB] " (car dir-entry)) |
| 5498 | (car dir-entry)) | 5498 | (car dir-entry)) |
| @@ -5589,7 +5589,7 @@ directories and save the routine info. | |||
| 5589 | ;; Define the variable which knows the value of "!DIR" | 5589 | ;; Define the variable which knows the value of "!DIR" |
| 5590 | (insert (format "\n(setq idlwave-system-directory \"%s\")\n" | 5590 | (insert (format "\n(setq idlwave-system-directory \"%s\")\n" |
| 5591 | idlwave-system-directory)) | 5591 | idlwave-system-directory)) |
| 5592 | 5592 | ||
| 5593 | ;; Define the variable which contains a list of all scanned directories | 5593 | ;; Define the variable which contains a list of all scanned directories |
| 5594 | (insert "\n(setq idlwave-path-alist\n '(") | 5594 | (insert "\n(setq idlwave-path-alist\n '(") |
| 5595 | (let ((standard-output (current-buffer))) | 5595 | (let ((standard-output (current-buffer))) |
| @@ -5629,7 +5629,7 @@ directories and save the routine info. | |||
| 5629 | (when (file-directory-p dir) | 5629 | (when (file-directory-p dir) |
| 5630 | (setq files (nreverse (directory-files dir t "[^.]"))) | 5630 | (setq files (nreverse (directory-files dir t "[^.]"))) |
| 5631 | (while (setq file (pop files)) | 5631 | (while (setq file (pop files)) |
| 5632 | (if (file-directory-p file) | 5632 | (if (file-directory-p file) |
| 5633 | (push (file-name-as-directory file) path))) | 5633 | (push (file-name-as-directory file) path))) |
| 5634 | (push dir path1))) | 5634 | (push dir path1))) |
| 5635 | path1)) | 5635 | path1)) |
| @@ -5641,7 +5641,7 @@ directories and save the routine info. | |||
| 5641 | 5641 | ||
| 5642 | 5642 | ||
| 5643 | (defun idlwave-scan-library-catalogs (&optional message-base no-load) | 5643 | (defun idlwave-scan-library-catalogs (&optional message-base no-load) |
| 5644 | "Scan for library catalog files (.idlwave_catalog) and ingest. | 5644 | "Scan for library catalog files (.idlwave_catalog) and ingest. |
| 5645 | 5645 | ||
| 5646 | All directories on `idlwave-path-alist' (or `idlwave-library-path' | 5646 | All directories on `idlwave-path-alist' (or `idlwave-library-path' |
| 5647 | instead, if present) are searched. Print MESSAGE-BASE along with the | 5647 | instead, if present) are searched. Print MESSAGE-BASE along with the |
| @@ -5649,7 +5649,7 @@ libraries being loaded, if passed, and skip loading/normalizing if | |||
| 5649 | NO-LOAD is non-nil. The variable `idlwave-use-library-catalogs' can | 5649 | NO-LOAD is non-nil. The variable `idlwave-use-library-catalogs' can |
| 5650 | be set to nil to disable library catalog scanning." | 5650 | be set to nil to disable library catalog scanning." |
| 5651 | (when idlwave-use-library-catalogs | 5651 | (when idlwave-use-library-catalogs |
| 5652 | (let ((dirs | 5652 | (let ((dirs |
| 5653 | (if idlwave-library-path | 5653 | (if idlwave-library-path |
| 5654 | (idlwave-expand-path idlwave-library-path) | 5654 | (idlwave-expand-path idlwave-library-path) |
| 5655 | (mapcar 'car idlwave-path-alist))) | 5655 | (mapcar 'car idlwave-path-alist))) |
| @@ -5658,7 +5658,7 @@ be set to nil to disable library catalog scanning." | |||
| 5658 | (if message-base (message message-base)) | 5658 | (if message-base (message message-base)) |
| 5659 | (while (setq dir (pop dirs)) | 5659 | (while (setq dir (pop dirs)) |
| 5660 | (catch 'continue | 5660 | (catch 'continue |
| 5661 | (when (file-readable-p | 5661 | (when (file-readable-p |
| 5662 | (setq catalog (expand-file-name ".idlwave_catalog" dir))) | 5662 | (setq catalog (expand-file-name ".idlwave_catalog" dir))) |
| 5663 | (unless no-load | 5663 | (unless no-load |
| 5664 | (setq idlwave-library-catalog-routines nil) | 5664 | (setq idlwave-library-catalog-routines nil) |
| @@ -5666,20 +5666,20 @@ be set to nil to disable library catalog scanning." | |||
| 5666 | (condition-case nil | 5666 | (condition-case nil |
| 5667 | (load catalog t t t) | 5667 | (load catalog t t t) |
| 5668 | (error (throw 'continue t))) | 5668 | (error (throw 'continue t))) |
| 5669 | (when (and | 5669 | (when (and |
| 5670 | message-base | 5670 | message-base |
| 5671 | (not (string= idlwave-library-catalog-libname | 5671 | (not (string= idlwave-library-catalog-libname |
| 5672 | old-libname))) | 5672 | old-libname))) |
| 5673 | (message "%s" (concat message-base | 5673 | (message "%s" (concat message-base |
| 5674 | idlwave-library-catalog-libname)) | 5674 | idlwave-library-catalog-libname)) |
| 5675 | (setq old-libname idlwave-library-catalog-libname)) | 5675 | (setq old-libname idlwave-library-catalog-libname)) |
| 5676 | (when idlwave-library-catalog-routines | 5676 | (when idlwave-library-catalog-routines |
| 5677 | (setq all-routines | 5677 | (setq all-routines |
| 5678 | (append | 5678 | (append |
| 5679 | (idlwave-sintern-rinfo-list | 5679 | (idlwave-sintern-rinfo-list |
| 5680 | idlwave-library-catalog-routines 'sys dir) | 5680 | idlwave-library-catalog-routines 'sys dir) |
| 5681 | all-routines)))) | 5681 | all-routines)))) |
| 5682 | 5682 | ||
| 5683 | ;; Add a 'lib flag if on path-alist | 5683 | ;; Add a 'lib flag if on path-alist |
| 5684 | (when (and idlwave-path-alist | 5684 | (when (and idlwave-path-alist |
| 5685 | (setq dir-entry (assoc dir idlwave-path-alist))) | 5685 | (setq dir-entry (assoc dir idlwave-path-alist))) |
| @@ -5690,7 +5690,7 @@ be set to nil to disable library catalog scanning." | |||
| 5690 | ;;----- Communicating with the Shell ------------------- | 5690 | ;;----- Communicating with the Shell ------------------- |
| 5691 | 5691 | ||
| 5692 | ;; First, here is the idl program which can be used to query IDL for | 5692 | ;; First, here is the idl program which can be used to query IDL for |
| 5693 | ;; defined routines. | 5693 | ;; defined routines. |
| 5694 | (defconst idlwave-routine-info.pro | 5694 | (defconst idlwave-routine-info.pro |
| 5695 | " | 5695 | " |
| 5696 | ;; START OF IDLWAVE SUPPORT ROUTINES | 5696 | ;; START OF IDLWAVE SUPPORT ROUTINES |
| @@ -5708,10 +5708,10 @@ end | |||
| 5708 | pro idlwave_print_info_entry,name,func=func,separator=sep | 5708 | pro idlwave_print_info_entry,name,func=func,separator=sep |
| 5709 | ;; See if it's an object method | 5709 | ;; See if it's an object method |
| 5710 | if name eq '' then return | 5710 | if name eq '' then return |
| 5711 | func = keyword_set(func) | 5711 | func = keyword_set(func) |
| 5712 | methsep = strpos(name,'::') | 5712 | methsep = strpos(name,'::') |
| 5713 | meth = methsep ne -1 | 5713 | meth = methsep ne -1 |
| 5714 | 5714 | ||
| 5715 | ;; Get routine info | 5715 | ;; Get routine info |
| 5716 | pars = routine_info(name,/parameters,functions=func) | 5716 | pars = routine_info(name,/parameters,functions=func) |
| 5717 | source = routine_info(name,/source,functions=func) | 5717 | source = routine_info(name,/source,functions=func) |
| @@ -5719,12 +5719,12 @@ pro idlwave_print_info_entry,name,func=func,separator=sep | |||
| 5719 | nkw = pars.num_kw_args | 5719 | nkw = pars.num_kw_args |
| 5720 | if nargs gt 0 then args = pars.args | 5720 | if nargs gt 0 then args = pars.args |
| 5721 | if nkw gt 0 then kwargs = pars.kw_args | 5721 | if nkw gt 0 then kwargs = pars.kw_args |
| 5722 | 5722 | ||
| 5723 | ;; Trim the class, and make the name | 5723 | ;; Trim the class, and make the name |
| 5724 | if meth then begin | 5724 | if meth then begin |
| 5725 | class = strmid(name,0,methsep) | 5725 | class = strmid(name,0,methsep) |
| 5726 | name = strmid(name,methsep+2,strlen(name)-1) | 5726 | name = strmid(name,methsep+2,strlen(name)-1) |
| 5727 | if nargs gt 0 then begin | 5727 | if nargs gt 0 then begin |
| 5728 | ;; remove the self argument | 5728 | ;; remove the self argument |
| 5729 | wh = where(args ne 'SELF',nargs) | 5729 | wh = where(args ne 'SELF',nargs) |
| 5730 | if nargs gt 0 then args = args[wh] | 5730 | if nargs gt 0 then args = args[wh] |
| @@ -5733,7 +5733,7 @@ pro idlwave_print_info_entry,name,func=func,separator=sep | |||
| 5733 | ;; No class, just a normal routine. | 5733 | ;; No class, just a normal routine. |
| 5734 | class = \"\" | 5734 | class = \"\" |
| 5735 | endelse | 5735 | endelse |
| 5736 | 5736 | ||
| 5737 | ;; Calling sequence | 5737 | ;; Calling sequence |
| 5738 | cs = \"\" | 5738 | cs = \"\" |
| 5739 | if func then cs = 'Result = ' | 5739 | if func then cs = 'Result = ' |
| @@ -5754,9 +5754,9 @@ pro idlwave_print_info_entry,name,func=func,separator=sep | |||
| 5754 | kwstring = kwstring + ' ' + kwargs[j] | 5754 | kwstring = kwstring + ' ' + kwargs[j] |
| 5755 | endfor | 5755 | endfor |
| 5756 | endif | 5756 | endif |
| 5757 | 5757 | ||
| 5758 | ret=(['IDLWAVE-PRO','IDLWAVE-FUN'])[func] | 5758 | ret=(['IDLWAVE-PRO','IDLWAVE-FUN'])[func] |
| 5759 | 5759 | ||
| 5760 | print,ret + ': ' + name + sep + class + sep + source[0].path $ | 5760 | print,ret + ': ' + name + sep + class + sep + source[0].path $ |
| 5761 | + sep + cs + sep + kwstring | 5761 | + sep + cs + sep + kwstring |
| 5762 | end | 5762 | end |
| @@ -5768,19 +5768,19 @@ pro idlwave_routine_info,file | |||
| 5768 | all = routine_info() | 5768 | all = routine_info() |
| 5769 | fileQ=n_elements(file) ne 0 | 5769 | fileQ=n_elements(file) ne 0 |
| 5770 | if fileQ then file=strtrim(file,2) | 5770 | if fileQ then file=strtrim(file,2) |
| 5771 | for i=0L,n_elements(all)-1L do begin | 5771 | for i=0L,n_elements(all)-1L do begin |
| 5772 | if fileQ then begin | 5772 | if fileQ then begin |
| 5773 | if (routine_info(all[i],/SOURCE)).path eq file then $ | 5773 | if (routine_info(all[i],/SOURCE)).path eq file then $ |
| 5774 | idlwave_print_info_entry,all[i],separator=sep | 5774 | idlwave_print_info_entry,all[i],separator=sep |
| 5775 | endif else idlwave_print_info_entry,all[i],separator=sep | 5775 | endif else idlwave_print_info_entry,all[i],separator=sep |
| 5776 | endfor | 5776 | endfor |
| 5777 | all = routine_info(/functions) | 5777 | all = routine_info(/functions) |
| 5778 | for i=0L,n_elements(all)-1L do begin | 5778 | for i=0L,n_elements(all)-1L do begin |
| 5779 | if fileQ then begin | 5779 | if fileQ then begin |
| 5780 | if (routine_info(all[i],/FUNCTIONS,/SOURCE)).path eq file then $ | 5780 | if (routine_info(all[i],/FUNCTIONS,/SOURCE)).path eq file then $ |
| 5781 | idlwave_print_info_entry,all[i],separator=sep,/FUNC | 5781 | idlwave_print_info_entry,all[i],separator=sep,/FUNC |
| 5782 | endif else idlwave_print_info_entry,all[i],separator=sep,/FUNC | 5782 | endif else idlwave_print_info_entry,all[i],separator=sep,/FUNC |
| 5783 | endfor | 5783 | endfor |
| 5784 | print,'>>>END OF IDLWAVE ROUTINE INFO' | 5784 | print,'>>>END OF IDLWAVE ROUTINE INFO' |
| 5785 | end | 5785 | end |
| 5786 | 5786 | ||
| @@ -5806,7 +5806,7 @@ pro idlwave_get_class_tags, class | |||
| 5806 | if res then print,'IDLWAVE-CLASS-TAGS: '+class+' '+strjoin(tags,' ',/single) | 5806 | if res then print,'IDLWAVE-CLASS-TAGS: '+class+' '+strjoin(tags,' ',/single) |
| 5807 | end | 5807 | end |
| 5808 | ;; END OF IDLWAVE SUPPORT ROUTINES | 5808 | ;; END OF IDLWAVE SUPPORT ROUTINES |
| 5809 | " | 5809 | " |
| 5810 | "The idl programs to get info from the shell.") | 5810 | "The idl programs to get info from the shell.") |
| 5811 | 5811 | ||
| 5812 | (defvar idlwave-idlwave_routine_info-compiled nil | 5812 | (defvar idlwave-idlwave_routine_info-compiled nil |
| @@ -5824,11 +5824,11 @@ end | |||
| 5824 | (erase-buffer) | 5824 | (erase-buffer) |
| 5825 | (insert idlwave-routine-info.pro) | 5825 | (insert idlwave-routine-info.pro) |
| 5826 | (save-buffer 0)) | 5826 | (save-buffer 0)) |
| 5827 | (idlwave-shell-send-command | 5827 | (idlwave-shell-send-command |
| 5828 | (concat ".run \"" idlwave-shell-temp-pro-file "\"") | 5828 | (concat ".run \"" idlwave-shell-temp-pro-file "\"") |
| 5829 | nil 'hide wait) | 5829 | nil 'hide wait) |
| 5830 | (idlwave-shell-send-command | 5830 | (idlwave-shell-send-command |
| 5831 | (format "save,'idlwave_print_safe','idlwave_routine_info','idlwave_print_info_entry','idlwave_get_class_tags','idlwave_get_sysvars',FILE='%s',/ROUTINES" | 5831 | (format "save,'idlwave_print_safe','idlwave_routine_info','idlwave_print_info_entry','idlwave_get_class_tags','idlwave_get_sysvars',FILE='%s',/ROUTINES" |
| 5832 | (idlwave-shell-temp-file 'rinfo)) | 5832 | (idlwave-shell-temp-file 'rinfo)) |
| 5833 | nil 'hide) | 5833 | nil 'hide) |
| 5834 | (setq idlwave-idlwave_routine_info-compiled t)) | 5834 | (setq idlwave-idlwave_routine_info-compiled t)) |
| @@ -5929,7 +5929,7 @@ When we force a method or a method keyword, CLASS can specify the class." | |||
| 5929 | (completion-regexp-list | 5929 | (completion-regexp-list |
| 5930 | (if (equal arg '(16)) | 5930 | (if (equal arg '(16)) |
| 5931 | (list (read-string (concat "Completion Regexp: ")))))) | 5931 | (list (read-string (concat "Completion Regexp: ")))))) |
| 5932 | 5932 | ||
| 5933 | (if (and module (string-match "::" module)) | 5933 | (if (and module (string-match "::" module)) |
| 5934 | (setq class (substring module 0 (match-beginning 0)) | 5934 | (setq class (substring module 0 (match-beginning 0)) |
| 5935 | module (substring module (match-end 0)))) | 5935 | module (substring module (match-end 0)))) |
| @@ -5950,7 +5950,7 @@ When we force a method or a method keyword, CLASS can specify the class." | |||
| 5950 | ;; Check for any special completion functions | 5950 | ;; Check for any special completion functions |
| 5951 | ((and idlwave-complete-special | 5951 | ((and idlwave-complete-special |
| 5952 | (idlwave-call-special idlwave-complete-special))) | 5952 | (idlwave-call-special idlwave-complete-special))) |
| 5953 | 5953 | ||
| 5954 | ((null what) | 5954 | ((null what) |
| 5955 | (error "Nothing to complete here")) | 5955 | (error "Nothing to complete here")) |
| 5956 | 5956 | ||
| @@ -5967,7 +5967,7 @@ When we force a method or a method keyword, CLASS can specify the class." | |||
| 5967 | (idlwave-all-class-inherits class-selector))) | 5967 | (idlwave-all-class-inherits class-selector))) |
| 5968 | (isa (concat "procedure" (if class-selector "-method" ""))) | 5968 | (isa (concat "procedure" (if class-selector "-method" ""))) |
| 5969 | (type-selector 'pro)) | 5969 | (type-selector 'pro)) |
| 5970 | (setq idlwave-completion-help-info | 5970 | (setq idlwave-completion-help-info |
| 5971 | (list 'routine nil type-selector class-selector nil super-classes)) | 5971 | (list 'routine nil type-selector class-selector nil super-classes)) |
| 5972 | (idlwave-complete-in-buffer | 5972 | (idlwave-complete-in-buffer |
| 5973 | 'procedure (if class-selector 'method 'routine) | 5973 | 'procedure (if class-selector 'method 'routine) |
| @@ -5975,8 +5975,8 @@ When we force a method or a method keyword, CLASS can specify the class." | |||
| 5975 | (format "Select a %s name%s" | 5975 | (format "Select a %s name%s" |
| 5976 | isa | 5976 | isa |
| 5977 | (if class-selector | 5977 | (if class-selector |
| 5978 | (format " (class is %s)" | 5978 | (format " (class is %s)" |
| 5979 | (if (eq class-selector t) | 5979 | (if (eq class-selector t) |
| 5980 | "unknown" class-selector)) | 5980 | "unknown" class-selector)) |
| 5981 | "")) | 5981 | "")) |
| 5982 | isa | 5982 | isa |
| @@ -5990,7 +5990,7 @@ When we force a method or a method keyword, CLASS can specify the class." | |||
| 5990 | (idlwave-all-class-inherits class-selector))) | 5990 | (idlwave-all-class-inherits class-selector))) |
| 5991 | (isa (concat "function" (if class-selector "-method" ""))) | 5991 | (isa (concat "function" (if class-selector "-method" ""))) |
| 5992 | (type-selector 'fun)) | 5992 | (type-selector 'fun)) |
| 5993 | (setq idlwave-completion-help-info | 5993 | (setq idlwave-completion-help-info |
| 5994 | (list 'routine nil type-selector class-selector nil super-classes)) | 5994 | (list 'routine nil type-selector class-selector nil super-classes)) |
| 5995 | (idlwave-complete-in-buffer | 5995 | (idlwave-complete-in-buffer |
| 5996 | 'function (if class-selector 'method 'routine) | 5996 | 'function (if class-selector 'method 'routine) |
| @@ -5998,7 +5998,7 @@ When we force a method or a method keyword, CLASS can specify the class." | |||
| 5998 | (format "Select a %s name%s" | 5998 | (format "Select a %s name%s" |
| 5999 | isa | 5999 | isa |
| 6000 | (if class-selector | 6000 | (if class-selector |
| 6001 | (format " (class is %s)" | 6001 | (format " (class is %s)" |
| 6002 | (if (eq class-selector t) | 6002 | (if (eq class-selector t) |
| 6003 | "unknown" class-selector)) | 6003 | "unknown" class-selector)) |
| 6004 | "")) | 6004 | "")) |
| @@ -6026,18 +6026,18 @@ When we force a method or a method keyword, CLASS can specify the class." | |||
| 6026 | (unless (or entry (eq class t)) | 6026 | (unless (or entry (eq class t)) |
| 6027 | (error "Nothing known about procedure %s" | 6027 | (error "Nothing known about procedure %s" |
| 6028 | (idlwave-make-full-name class name))) | 6028 | (idlwave-make-full-name class name))) |
| 6029 | (setq list (idlwave-fix-keywords name 'pro class list | 6029 | (setq list (idlwave-fix-keywords name 'pro class list |
| 6030 | super-classes system)) | 6030 | super-classes system)) |
| 6031 | (unless list (error "No keywords available for procedure %s" | 6031 | (unless list (error "No keywords available for procedure %s" |
| 6032 | (idlwave-make-full-name class name))) | 6032 | (idlwave-make-full-name class name))) |
| 6033 | (setq idlwave-completion-help-info | 6033 | (setq idlwave-completion-help-info |
| 6034 | (list 'keyword name type-selector class-selector entry super-classes)) | 6034 | (list 'keyword name type-selector class-selector entry super-classes)) |
| 6035 | (idlwave-complete-in-buffer | 6035 | (idlwave-complete-in-buffer |
| 6036 | 'keyword 'keyword list nil | 6036 | 'keyword 'keyword list nil |
| 6037 | (format "Select keyword for procedure %s%s" | 6037 | (format "Select keyword for procedure %s%s" |
| 6038 | (idlwave-make-full-name class name) | 6038 | (idlwave-make-full-name class name) |
| 6039 | (if (or (member '("_EXTRA") list) | 6039 | (if (or (member '("_EXTRA") list) |
| 6040 | (member '("_REF_EXTRA") list)) | 6040 | (member '("_REF_EXTRA") list)) |
| 6041 | " (note _EXTRA)" "")) | 6041 | " (note _EXTRA)" "")) |
| 6042 | isa | 6042 | isa |
| 6043 | 'idlwave-attach-keyword-classes))) | 6043 | 'idlwave-attach-keyword-classes))) |
| @@ -6060,7 +6060,7 @@ When we force a method or a method keyword, CLASS can specify the class." | |||
| 6060 | (unless (or entry (eq class t)) | 6060 | (unless (or entry (eq class t)) |
| 6061 | (error "Nothing known about function %s" | 6061 | (error "Nothing known about function %s" |
| 6062 | (idlwave-make-full-name class name))) | 6062 | (idlwave-make-full-name class name))) |
| 6063 | (setq list (idlwave-fix-keywords name 'fun class list | 6063 | (setq list (idlwave-fix-keywords name 'fun class list |
| 6064 | super-classes system)) | 6064 | super-classes system)) |
| 6065 | ;; OBJ_NEW: Messages mention the proper Init method | 6065 | ;; OBJ_NEW: Messages mention the proper Init method |
| 6066 | (setq msg-name (if (and (null class) | 6066 | (setq msg-name (if (and (null class) |
| @@ -6070,13 +6070,13 @@ When we force a method or a method keyword, CLASS can specify the class." | |||
| 6070 | (idlwave-make-full-name class name))) | 6070 | (idlwave-make-full-name class name))) |
| 6071 | (unless list (error "No keywords available for function %s" | 6071 | (unless list (error "No keywords available for function %s" |
| 6072 | msg-name)) | 6072 | msg-name)) |
| 6073 | (setq idlwave-completion-help-info | 6073 | (setq idlwave-completion-help-info |
| 6074 | (list 'keyword name type-selector class-selector nil super-classes)) | 6074 | (list 'keyword name type-selector class-selector nil super-classes)) |
| 6075 | (idlwave-complete-in-buffer | 6075 | (idlwave-complete-in-buffer |
| 6076 | 'keyword 'keyword list nil | 6076 | 'keyword 'keyword list nil |
| 6077 | (format "Select keyword for function %s%s" msg-name | 6077 | (format "Select keyword for function %s%s" msg-name |
| 6078 | (if (or (member '("_EXTRA") list) | 6078 | (if (or (member '("_EXTRA") list) |
| 6079 | (member '("_REF_EXTRA") list)) | 6079 | (member '("_REF_EXTRA") list)) |
| 6080 | " (note _EXTRA)" "")) | 6080 | " (note _EXTRA)" "")) |
| 6081 | isa | 6081 | isa |
| 6082 | 'idlwave-attach-keyword-classes))) | 6082 | 'idlwave-attach-keyword-classes))) |
| @@ -6114,10 +6114,10 @@ other completions will be tried.") | |||
| 6114 | ("class"))) | 6114 | ("class"))) |
| 6115 | (module (idlwave-sintern-routine-or-method module class)) | 6115 | (module (idlwave-sintern-routine-or-method module class)) |
| 6116 | (class (idlwave-sintern-class class)) | 6116 | (class (idlwave-sintern-class class)) |
| 6117 | (what (cond | 6117 | (what (cond |
| 6118 | ((equal what 0) | 6118 | ((equal what 0) |
| 6119 | (setq what | 6119 | (setq what |
| 6120 | (intern (completing-read | 6120 | (intern (completing-read |
| 6121 | "Complete what? " what-list nil t)))) | 6121 | "Complete what? " what-list nil t)))) |
| 6122 | ((integerp what) | 6122 | ((integerp what) |
| 6123 | (setq what (intern (car (nth (1- what) what-list))))) | 6123 | (setq what (intern (car (nth (1- what) what-list))))) |
| @@ -6139,7 +6139,7 @@ other completions will be tried.") | |||
| 6139 | (super-classes nil) | 6139 | (super-classes nil) |
| 6140 | (type-selector 'pro) | 6140 | (type-selector 'pro) |
| 6141 | (pro (or module | 6141 | (pro (or module |
| 6142 | (idlwave-completing-read | 6142 | (idlwave-completing-read |
| 6143 | "Procedure: " (idlwave-routines) 'idlwave-selector)))) | 6143 | "Procedure: " (idlwave-routines) 'idlwave-selector)))) |
| 6144 | (setq pro (idlwave-sintern-routine pro)) | 6144 | (setq pro (idlwave-sintern-routine pro)) |
| 6145 | (list nil-list nil-list 'procedure-keyword | 6145 | (list nil-list nil-list 'procedure-keyword |
| @@ -6153,7 +6153,7 @@ other completions will be tried.") | |||
| 6153 | (super-classes nil) | 6153 | (super-classes nil) |
| 6154 | (type-selector 'fun) | 6154 | (type-selector 'fun) |
| 6155 | (func (or module | 6155 | (func (or module |
| 6156 | (idlwave-completing-read | 6156 | (idlwave-completing-read |
| 6157 | "Function: " (idlwave-routines) 'idlwave-selector)))) | 6157 | "Function: " (idlwave-routines) 'idlwave-selector)))) |
| 6158 | (setq func (idlwave-sintern-routine func)) | 6158 | (setq func (idlwave-sintern-routine func)) |
| 6159 | (list nil-list nil-list 'function-keyword | 6159 | (list nil-list nil-list 'function-keyword |
| @@ -6193,7 +6193,7 @@ other completions will be tried.") | |||
| 6193 | 6193 | ||
| 6194 | ((eq what 'class) | 6194 | ((eq what 'class) |
| 6195 | (list nil-list nil-list 'class nil-list nil)) | 6195 | (list nil-list nil-list 'class nil-list nil)) |
| 6196 | 6196 | ||
| 6197 | (t (error "Invalid value for WHAT"))))) | 6197 | (t (error "Invalid value for WHAT"))))) |
| 6198 | 6198 | ||
| 6199 | (defun idlwave-completing-read (&rest args) | 6199 | (defun idlwave-completing-read (&rest args) |
| @@ -6216,7 +6216,7 @@ other completions will be tried.") | |||
| 6216 | (stringp idlwave-shell-default-directory) | 6216 | (stringp idlwave-shell-default-directory) |
| 6217 | (file-directory-p idlwave-shell-default-directory)) | 6217 | (file-directory-p idlwave-shell-default-directory)) |
| 6218 | idlwave-shell-default-directory | 6218 | idlwave-shell-default-directory |
| 6219 | default-directory))) | 6219 | default-directory))) |
| 6220 | (comint-dynamic-complete-filename))) | 6220 | (comint-dynamic-complete-filename))) |
| 6221 | 6221 | ||
| 6222 | (defun idlwave-make-full-name (class name) | 6222 | (defun idlwave-make-full-name (class name) |
| @@ -6225,7 +6225,7 @@ other completions will be tried.") | |||
| 6225 | 6225 | ||
| 6226 | (defun idlwave-rinfo-assoc (name type class list) | 6226 | (defun idlwave-rinfo-assoc (name type class list) |
| 6227 | "Like `idlwave-rinfo-assq', but sintern strings first." | 6227 | "Like `idlwave-rinfo-assq', but sintern strings first." |
| 6228 | (idlwave-rinfo-assq | 6228 | (idlwave-rinfo-assq |
| 6229 | (idlwave-sintern-routine-or-method name class) | 6229 | (idlwave-sintern-routine-or-method name class) |
| 6230 | type (idlwave-sintern-class class) list)) | 6230 | type (idlwave-sintern-class class) list)) |
| 6231 | 6231 | ||
| @@ -6249,7 +6249,7 @@ other completions will be tried.") | |||
| 6249 | (setq classes nil))) | 6249 | (setq classes nil))) |
| 6250 | rtn)) | 6250 | rtn)) |
| 6251 | 6251 | ||
| 6252 | (defun idlwave-best-rinfo-assq (name type class list &optional with-file | 6252 | (defun idlwave-best-rinfo-assq (name type class list &optional with-file |
| 6253 | keep-system) | 6253 | keep-system) |
| 6254 | "Like `idlwave-rinfo-assq', but get all twins and sort, then return first. | 6254 | "Like `idlwave-rinfo-assq', but get all twins and sort, then return first. |
| 6255 | If WITH-FILE is passed, find the best rinfo entry with a file | 6255 | If WITH-FILE is passed, find the best rinfo entry with a file |
| @@ -6274,7 +6274,7 @@ syslib files." | |||
| 6274 | twins))))) | 6274 | twins))))) |
| 6275 | (car twins))) | 6275 | (car twins))) |
| 6276 | 6276 | ||
| 6277 | (defun idlwave-best-rinfo-assoc (name type class list &optional with-file | 6277 | (defun idlwave-best-rinfo-assoc (name type class list &optional with-file |
| 6278 | keep-system) | 6278 | keep-system) |
| 6279 | "Like `idlwave-best-rinfo-assq', but sintern strings first." | 6279 | "Like `idlwave-best-rinfo-assq', but sintern strings first." |
| 6280 | (idlwave-best-rinfo-assq | 6280 | (idlwave-best-rinfo-assq |
| @@ -6365,7 +6365,7 @@ INFO is as returned by idlwave-what-function or -procedure." | |||
| 6365 | Must accept two arguments: `apos' and `info'") | 6365 | Must accept two arguments: `apos' and `info'") |
| 6366 | 6366 | ||
| 6367 | (defun idlwave-determine-class (info type) | 6367 | (defun idlwave-determine-class (info type) |
| 6368 | ;; Determine the class of a routine call. | 6368 | ;; Determine the class of a routine call. |
| 6369 | ;; INFO is the `cw-list' structure as returned by idlwave-where. | 6369 | ;; INFO is the `cw-list' structure as returned by idlwave-where. |
| 6370 | ;; The second element in this structure is the class. When nil, we | 6370 | ;; The second element in this structure is the class. When nil, we |
| 6371 | ;; return nil. When t, try to get the class from text properties at | 6371 | ;; return nil. When t, try to get the class from text properties at |
| @@ -6385,7 +6385,7 @@ Must accept two arguments: `apos' and `info'") | |||
| 6385 | (dassoc (cdr dassoc)) | 6385 | (dassoc (cdr dassoc)) |
| 6386 | (t t))) | 6386 | (t t))) |
| 6387 | (arrow (and apos (string= (buffer-substring apos (+ 2 apos)) "->"))) | 6387 | (arrow (and apos (string= (buffer-substring apos (+ 2 apos)) "->"))) |
| 6388 | (is-self | 6388 | (is-self |
| 6389 | (and arrow | 6389 | (and arrow |
| 6390 | (save-excursion (goto-char apos) | 6390 | (save-excursion (goto-char apos) |
| 6391 | (forward-word -1) | 6391 | (forward-word -1) |
| @@ -6406,19 +6406,19 @@ Must accept two arguments: `apos' and `info'") | |||
| 6406 | (setq class (or (nth 2 (idlwave-current-routine)) class))) | 6406 | (setq class (or (nth 2 (idlwave-current-routine)) class))) |
| 6407 | 6407 | ||
| 6408 | ;; Before prompting, try any special class determination routines | 6408 | ;; Before prompting, try any special class determination routines |
| 6409 | (when (and (eq t class) | 6409 | (when (and (eq t class) |
| 6410 | idlwave-determine-class-special | 6410 | idlwave-determine-class-special |
| 6411 | (not force-query)) | 6411 | (not force-query)) |
| 6412 | (setq special-class | 6412 | (setq special-class |
| 6413 | (idlwave-call-special idlwave-determine-class-special apos)) | 6413 | (idlwave-call-special idlwave-determine-class-special apos)) |
| 6414 | (if special-class | 6414 | (if special-class |
| 6415 | (setq class (idlwave-sintern-class special-class) | 6415 | (setq class (idlwave-sintern-class special-class) |
| 6416 | store idlwave-store-inquired-class))) | 6416 | store idlwave-store-inquired-class))) |
| 6417 | 6417 | ||
| 6418 | ;; Prompt for a class, if we need to | 6418 | ;; Prompt for a class, if we need to |
| 6419 | (when (and (eq class t) | 6419 | (when (and (eq class t) |
| 6420 | (or force-query query)) | 6420 | (or force-query query)) |
| 6421 | (setq class-alist | 6421 | (setq class-alist |
| 6422 | (mapcar 'list (idlwave-all-method-classes (car info) type))) | 6422 | (mapcar 'list (idlwave-all-method-classes (car info) type))) |
| 6423 | (setq class | 6423 | (setq class |
| 6424 | (idlwave-sintern-class | 6424 | (idlwave-sintern-class |
| @@ -6427,9 +6427,9 @@ Must accept two arguments: `apos' and `info'") | |||
| 6427 | (error "No classes available with method %s" (car info))) | 6427 | (error "No classes available with method %s" (car info))) |
| 6428 | ((and (= (length class-alist) 1) (not force-query)) | 6428 | ((and (= (length class-alist) 1) (not force-query)) |
| 6429 | (car (car class-alist))) | 6429 | (car (car class-alist))) |
| 6430 | (t | 6430 | (t |
| 6431 | (setq store idlwave-store-inquired-class) | 6431 | (setq store idlwave-store-inquired-class) |
| 6432 | (idlwave-completing-read | 6432 | (idlwave-completing-read |
| 6433 | (format "Class%s: " (if (stringp (car info)) | 6433 | (format "Class%s: " (if (stringp (car info)) |
| 6434 | (format " for %s method %s" | 6434 | (format " for %s method %s" |
| 6435 | type (car info)) | 6435 | type (car info)) |
| @@ -6441,9 +6441,9 @@ Must accept two arguments: `apos' and `info'") | |||
| 6441 | ;; We have a real class here | 6441 | ;; We have a real class here |
| 6442 | (when (and store arrow) | 6442 | (when (and store arrow) |
| 6443 | (condition-case () | 6443 | (condition-case () |
| 6444 | (add-text-properties | 6444 | (add-text-properties |
| 6445 | apos (+ apos 2) | 6445 | apos (+ apos 2) |
| 6446 | `(idlwave-class ,class face ,idlwave-class-arrow-face | 6446 | `(idlwave-class ,class face ,idlwave-class-arrow-face |
| 6447 | rear-nonsticky t)) | 6447 | rear-nonsticky t)) |
| 6448 | (error nil))) | 6448 | (error nil))) |
| 6449 | (setf (nth 2 info) class)) | 6449 | (setf (nth 2 info) class)) |
| @@ -6471,14 +6471,14 @@ Must accept two arguments: `apos' and `info'") | |||
| 6471 | 6471 | ||
| 6472 | 6472 | ||
| 6473 | (defun idlwave-where () | 6473 | (defun idlwave-where () |
| 6474 | "Find out where we are. | 6474 | "Find out where we are. |
| 6475 | The return value is a list with the following stuff: | 6475 | The return value is a list with the following stuff: |
| 6476 | \(PRO-LIST FUNC-LIST COMPLETE-WHAT CW-LIST LAST-CHAR) | 6476 | \(PRO-LIST FUNC-LIST COMPLETE-WHAT CW-LIST LAST-CHAR) |
| 6477 | 6477 | ||
| 6478 | PRO-LIST (PRO POINT CLASS ARROW) | 6478 | PRO-LIST (PRO POINT CLASS ARROW) |
| 6479 | FUNC-LIST (FUNC POINT CLASS ARROW) | 6479 | FUNC-LIST (FUNC POINT CLASS ARROW) |
| 6480 | COMPLETE-WHAT a symbol indicating what kind of completion makes sense here | 6480 | COMPLETE-WHAT a symbol indicating what kind of completion makes sense here |
| 6481 | CW-LIST (PRO-OR-FUNC POINT CLASS ARROW) Like PRO-LIST, for what can | 6481 | CW-LIST (PRO-OR-FUNC POINT CLASS ARROW) Like PRO-LIST, for what can |
| 6482 | be completed here. | 6482 | be completed here. |
| 6483 | LAST-CHAR last relevant character before point (non-white non-comment, | 6483 | LAST-CHAR last relevant character before point (non-white non-comment, |
| 6484 | not part of current identifier or leading slash). | 6484 | not part of current identifier or leading slash). |
| @@ -6490,7 +6490,7 @@ POINT: Where is this | |||
| 6490 | CLASS: What class has the routine (nil=no, t=is method, but class unknown) | 6490 | CLASS: What class has the routine (nil=no, t=is method, but class unknown) |
| 6491 | ARROW: Location of the arrow" | 6491 | ARROW: Location of the arrow" |
| 6492 | (idlwave-routines) | 6492 | (idlwave-routines) |
| 6493 | (let* (;(bos (save-excursion (idlwave-beginning-of-statement) (point))) | 6493 | (let* (;(bos (save-excursion (idlwave-beginning-of-statement) (point))) |
| 6494 | (bos (save-excursion (idlwave-start-of-substatement 'pre) (point))) | 6494 | (bos (save-excursion (idlwave-start-of-substatement 'pre) (point))) |
| 6495 | (func-entry (idlwave-what-function bos)) | 6495 | (func-entry (idlwave-what-function bos)) |
| 6496 | (func (car func-entry)) | 6496 | (func (car func-entry)) |
| @@ -6512,8 +6512,8 @@ ARROW: Location of the arrow" | |||
| 6512 | ((string-match "\\`[ \t]*\\(pro\\|function\\)[ \t]+[a-zA-Z0-9_]*\\'" | 6512 | ((string-match "\\`[ \t]*\\(pro\\|function\\)[ \t]+[a-zA-Z0-9_]*\\'" |
| 6513 | match-string) | 6513 | match-string) |
| 6514 | (setq cw 'class)) | 6514 | (setq cw 'class)) |
| 6515 | ((string-match | 6515 | ((string-match |
| 6516 | "\\`[ \t]*\\([a-zA-Z][a-zA-Z0-9$_]*\\)?\\'" | 6516 | "\\`[ \t]*\\([a-zA-Z][a-zA-Z0-9$_]*\\)?\\'" |
| 6517 | (if (> pro-point 0) | 6517 | (if (> pro-point 0) |
| 6518 | (buffer-substring pro-point (point)) | 6518 | (buffer-substring pro-point (point)) |
| 6519 | match-string)) | 6519 | match-string)) |
| @@ -6524,11 +6524,11 @@ ARROW: Location of the arrow" | |||
| 6524 | nil) | 6524 | nil) |
| 6525 | ((string-match "OBJ_NEW([ \t]*['\"]\\([a-zA-Z0-9$_]*\\)?\\'" | 6525 | ((string-match "OBJ_NEW([ \t]*['\"]\\([a-zA-Z0-9$_]*\\)?\\'" |
| 6526 | match-string) | 6526 | match-string) |
| 6527 | (setq cw 'class)) | 6527 | (setq cw 'class)) |
| 6528 | ((string-match "\\<inherits\\s-+\\([a-zA-Z0-9$_]*\\)?\\'" | 6528 | ((string-match "\\<inherits\\s-+\\([a-zA-Z0-9$_]*\\)?\\'" |
| 6529 | match-string) | 6529 | match-string) |
| 6530 | (setq cw 'class)) | 6530 | (setq cw 'class)) |
| 6531 | ((and func | 6531 | ((and func |
| 6532 | (> func-point pro-point) | 6532 | (> func-point pro-point) |
| 6533 | (= func-level 1) | 6533 | (= func-level 1) |
| 6534 | (memq last-char '(?\( ?,))) | 6534 | (memq last-char '(?\( ?,))) |
| @@ -6574,7 +6574,7 @@ ARROW: Location of the arrow" | |||
| 6574 | ;; searches to this point. | 6574 | ;; searches to this point. |
| 6575 | 6575 | ||
| 6576 | (catch 'exit | 6576 | (catch 'exit |
| 6577 | (let (pos | 6577 | (let (pos |
| 6578 | func-point | 6578 | func-point |
| 6579 | (cnt 0) | 6579 | (cnt 0) |
| 6580 | func arrow-start class) | 6580 | func arrow-start class) |
| @@ -6589,18 +6589,18 @@ ARROW: Location of the arrow" | |||
| 6589 | (setq pos (point)) | 6589 | (setq pos (point)) |
| 6590 | (incf cnt) | 6590 | (incf cnt) |
| 6591 | (when (and (= (following-char) ?\() | 6591 | (when (and (= (following-char) ?\() |
| 6592 | (re-search-backward | 6592 | (re-search-backward |
| 6593 | "\\(::\\|\\<\\)\\([a-zA-Z][a-zA-Z0-9$_]*\\)[ \t]*\\=" | 6593 | "\\(::\\|\\<\\)\\([a-zA-Z][a-zA-Z0-9$_]*\\)[ \t]*\\=" |
| 6594 | bound t)) | 6594 | bound t)) |
| 6595 | (setq func (match-string 2) | 6595 | (setq func (match-string 2) |
| 6596 | func-point (goto-char (match-beginning 2)) | 6596 | func-point (goto-char (match-beginning 2)) |
| 6597 | pos func-point) | 6597 | pos func-point) |
| 6598 | (if (re-search-backward | 6598 | (if (re-search-backward |
| 6599 | "->[ \t]*\\(\\([a-zA-Z][a-zA-Z0-9$_]*\\)::\\)?\\=" bound t) | 6599 | "->[ \t]*\\(\\([a-zA-Z][a-zA-Z0-9$_]*\\)::\\)?\\=" bound t) |
| 6600 | (setq arrow-start (copy-marker (match-beginning 0)) | 6600 | (setq arrow-start (copy-marker (match-beginning 0)) |
| 6601 | class (or (match-string 2) t))) | 6601 | class (or (match-string 2) t))) |
| 6602 | (throw | 6602 | (throw |
| 6603 | 'exit | 6603 | 'exit |
| 6604 | (list | 6604 | (list |
| 6605 | (idlwave-sintern-routine-or-method func class) | 6605 | (idlwave-sintern-routine-or-method func class) |
| 6606 | (idlwave-sintern-class class) | 6606 | (idlwave-sintern-class class) |
| @@ -6616,18 +6616,18 @@ ARROW: Location of the arrow" | |||
| 6616 | ;; searches to this point. | 6616 | ;; searches to this point. |
| 6617 | (let ((pos (point)) pro-point | 6617 | (let ((pos (point)) pro-point |
| 6618 | pro class arrow-start string) | 6618 | pro class arrow-start string) |
| 6619 | (save-excursion | 6619 | (save-excursion |
| 6620 | ;;(idlwave-beginning-of-statement) | 6620 | ;;(idlwave-beginning-of-statement) |
| 6621 | (idlwave-start-of-substatement 'pre) | 6621 | (idlwave-start-of-substatement 'pre) |
| 6622 | (setq string (buffer-substring (point) pos)) | 6622 | (setq string (buffer-substring (point) pos)) |
| 6623 | (if (string-match | 6623 | (if (string-match |
| 6624 | "\\`[ \t]*\\([a-zA-Z][a-zA-Z0-9$_]*\\)[ \t]*\\(,\\|\\'\\)" string) | 6624 | "\\`[ \t]*\\([a-zA-Z][a-zA-Z0-9$_]*\\)[ \t]*\\(,\\|\\'\\)" string) |
| 6625 | (setq pro (match-string 1 string) | 6625 | (setq pro (match-string 1 string) |
| 6626 | pro-point (+ (point) (match-beginning 1))) | 6626 | pro-point (+ (point) (match-beginning 1))) |
| 6627 | (if (and (idlwave-skip-object) | 6627 | (if (and (idlwave-skip-object) |
| 6628 | (setq string (buffer-substring (point) pos)) | 6628 | (setq string (buffer-substring (point) pos)) |
| 6629 | (string-match | 6629 | (string-match |
| 6630 | "\\`[ \t]*\\(->\\)[ \t]*\\(\\([a-zA-Z][a-zA-Z0-9$_]*\\)::\\)?\\([a-zA-Z][a-zA-Z0-9$_]*\\)?[ \t]*\\(,\\|\\(\\$\\s *\\(;.*\\)?\\)?$\\)" | 6630 | "\\`[ \t]*\\(->\\)[ \t]*\\(\\([a-zA-Z][a-zA-Z0-9$_]*\\)::\\)?\\([a-zA-Z][a-zA-Z0-9$_]*\\)?[ \t]*\\(,\\|\\(\\$\\s *\\(;.*\\)?\\)?$\\)" |
| 6631 | string)) | 6631 | string)) |
| 6632 | (setq pro (if (match-beginning 4) | 6632 | (setq pro (if (match-beginning 4) |
| 6633 | (match-string 4 string)) | 6633 | (match-string 4 string)) |
| @@ -6671,7 +6671,7 @@ ARROW: Location of the arrow" | |||
| 6671 | (throw 'exit nil)))) | 6671 | (throw 'exit nil)))) |
| 6672 | (goto-char pos) | 6672 | (goto-char pos) |
| 6673 | nil))) | 6673 | nil))) |
| 6674 | 6674 | ||
| 6675 | (defun idlwave-last-valid-char () | 6675 | (defun idlwave-last-valid-char () |
| 6676 | "Return the last character before point which is not white or a comment | 6676 | "Return the last character before point which is not white or a comment |
| 6677 | and also not part of the current identifier. Since we do this in | 6677 | and also not part of the current identifier. Since we do this in |
| @@ -6761,23 +6761,23 @@ accumulate information on matching completions." | |||
| 6761 | ((or (eq completion t) | 6761 | ((or (eq completion t) |
| 6762 | (and (= 1 (length (setq all-completions | 6762 | (and (= 1 (length (setq all-completions |
| 6763 | (idlwave-uniquify | 6763 | (idlwave-uniquify |
| 6764 | (all-completions part list | 6764 | (all-completions part list |
| 6765 | (or special-selector | 6765 | (or special-selector |
| 6766 | selector)))))) | 6766 | selector)))))) |
| 6767 | (equal dpart dcompletion))) | 6767 | (equal dpart dcompletion))) |
| 6768 | ;; This is already complete | 6768 | ;; This is already complete |
| 6769 | (idlwave-after-successful-completion type slash beg) | 6769 | (idlwave-after-successful-completion type slash beg) |
| 6770 | (message "%s is already the complete %s" part isa) | 6770 | (message "%s is already the complete %s" part isa) |
| 6771 | nil) | 6771 | nil) |
| 6772 | (t | 6772 | (t |
| 6773 | ;; We cannot add something - offer a list. | 6773 | ;; We cannot add something - offer a list. |
| 6774 | (message "Making completion list...") | 6774 | (message "Making completion list...") |
| 6775 | 6775 | ||
| 6776 | (unless idlwave-completion-help-links ; already set somewhere? | 6776 | (unless idlwave-completion-help-links ; already set somewhere? |
| 6777 | (mapcar (lambda (x) ; Pass link prop through to highlight-linked | 6777 | (mapcar (lambda (x) ; Pass link prop through to highlight-linked |
| 6778 | (let ((link (get-text-property 0 'link (car x)))) | 6778 | (let ((link (get-text-property 0 'link (car x)))) |
| 6779 | (if link | 6779 | (if link |
| 6780 | (push (cons (car x) link) | 6780 | (push (cons (car x) link) |
| 6781 | idlwave-completion-help-links)))) | 6781 | idlwave-completion-help-links)))) |
| 6782 | list)) | 6782 | list)) |
| 6783 | (let* ((list all-completions) | 6783 | (let* ((list all-completions) |
| @@ -6787,7 +6787,7 @@ accumulate information on matching completions." | |||
| 6787 | ; (completion-fixup-function ; Emacs | 6787 | ; (completion-fixup-function ; Emacs |
| 6788 | ; (lambda () (and (eq (preceding-char) ?>) | 6788 | ; (lambda () (and (eq (preceding-char) ?>) |
| 6789 | ; (re-search-backward " <" beg t))))) | 6789 | ; (re-search-backward " <" beg t))))) |
| 6790 | 6790 | ||
| 6791 | (setq list (sort list (lambda (a b) | 6791 | (setq list (sort list (lambda (a b) |
| 6792 | (string< (downcase a) (downcase b))))) | 6792 | (string< (downcase a) (downcase b))))) |
| 6793 | (if prepare-display-function | 6793 | (if prepare-display-function |
| @@ -6797,7 +6797,7 @@ accumulate information on matching completions." | |||
| 6797 | idlwave-complete-empty-string-as-lower-case) | 6797 | idlwave-complete-empty-string-as-lower-case) |
| 6798 | (not idlwave-completion-force-default-case)) | 6798 | (not idlwave-completion-force-default-case)) |
| 6799 | (setq list (mapcar (lambda (x) | 6799 | (setq list (mapcar (lambda (x) |
| 6800 | (if (listp x) | 6800 | (if (listp x) |
| 6801 | (setcar x (downcase (car x))) | 6801 | (setcar x (downcase (car x))) |
| 6802 | (setq x (downcase x))) | 6802 | (setq x (downcase x))) |
| 6803 | x) | 6803 | x) |
| @@ -6817,19 +6817,19 @@ accumulate information on matching completions." | |||
| 6817 | (re-search-backward "\\<\\(pro\\|function\\)[ \t]+\\=" | 6817 | (re-search-backward "\\<\\(pro\\|function\\)[ \t]+\\=" |
| 6818 | (- (point) 15) t) | 6818 | (- (point) 15) t) |
| 6819 | (goto-char (point-min)) | 6819 | (goto-char (point-min)) |
| 6820 | (re-search-forward | 6820 | (re-search-forward |
| 6821 | "^[ \t]*\\(pro\\|function\\)[ \t]+\\([a-zA-Z0-9_]+::\\)" nil t)))) | 6821 | "^[ \t]*\\(pro\\|function\\)[ \t]+\\([a-zA-Z0-9_]+::\\)" nil t)))) |
| 6822 | ;; Yank the full class specification | 6822 | ;; Yank the full class specification |
| 6823 | (insert (match-string 2)) | 6823 | (insert (match-string 2)) |
| 6824 | ;; Do the completion, using list gathered from `idlwave-routines' | 6824 | ;; Do the completion, using list gathered from `idlwave-routines' |
| 6825 | (idlwave-complete-in-buffer | 6825 | (idlwave-complete-in-buffer |
| 6826 | 'class 'class (idlwave-class-alist) nil | 6826 | 'class 'class (idlwave-class-alist) nil |
| 6827 | "Select a class" "class" | 6827 | "Select a class" "class" |
| 6828 | '(lambda (list) ;; Push it to help-links if system help available | 6828 | '(lambda (list) ;; Push it to help-links if system help available |
| 6829 | (mapcar (lambda (x) | 6829 | (mapcar (lambda (x) |
| 6830 | (let* ((entry (idlwave-class-info x)) | 6830 | (let* ((entry (idlwave-class-info x)) |
| 6831 | (link (nth 1 (assq 'link entry)))) | 6831 | (link (nth 1 (assq 'link entry)))) |
| 6832 | (if link (push (cons x link) | 6832 | (if link (push (cons x link) |
| 6833 | idlwave-completion-help-links)) | 6833 | idlwave-completion-help-links)) |
| 6834 | x)) | 6834 | x)) |
| 6835 | list))))) | 6835 | list))))) |
| @@ -6841,7 +6841,7 @@ accumulate information on matching completions." | |||
| 6841 | ;; SHOW-CLASSES is the value of `idlwave-completion-show-classes'. | 6841 | ;; SHOW-CLASSES is the value of `idlwave-completion-show-classes'. |
| 6842 | (if (or (null show-classes) ; don't want to see classes | 6842 | (if (or (null show-classes) ; don't want to see classes |
| 6843 | (null class-selector) ; not a method call | 6843 | (null class-selector) ; not a method call |
| 6844 | (and | 6844 | (and |
| 6845 | (stringp class-selector) ; the class is already known | 6845 | (stringp class-selector) ; the class is already known |
| 6846 | (not super-classes))) ; no possibilities for inheritance | 6846 | (not super-classes))) ; no possibilities for inheritance |
| 6847 | ;; In these cases, we do not have to do anything | 6847 | ;; In these cases, we do not have to do anything |
| @@ -6856,13 +6856,13 @@ accumulate information on matching completions." | |||
| 6856 | (max (abs show-classes)) | 6856 | (max (abs show-classes)) |
| 6857 | (lmax (if do-dots (apply 'max (mapcar 'length list)))) | 6857 | (lmax (if do-dots (apply 'max (mapcar 'length list)))) |
| 6858 | classes nclasses class-info space) | 6858 | classes nclasses class-info space) |
| 6859 | (mapcar | 6859 | (mapcar |
| 6860 | (lambda (x) | 6860 | (lambda (x) |
| 6861 | ;; get the classes | 6861 | ;; get the classes |
| 6862 | (if (eq type 'class-tag) | 6862 | (if (eq type 'class-tag) |
| 6863 | ;; Just one class for tags | 6863 | ;; Just one class for tags |
| 6864 | (setq classes | 6864 | (setq classes |
| 6865 | (list | 6865 | (list |
| 6866 | (idlwave-class-or-superclass-with-tag class-selector x))) | 6866 | (idlwave-class-or-superclass-with-tag class-selector x))) |
| 6867 | ;; Multiple classes for method or method-keyword | 6867 | ;; Multiple classes for method or method-keyword |
| 6868 | (setq classes | 6868 | (setq classes |
| @@ -6871,7 +6871,7 @@ accumulate information on matching completions." | |||
| 6871 | method-selector x type-selector) | 6871 | method-selector x type-selector) |
| 6872 | (idlwave-all-method-classes x type-selector))) | 6872 | (idlwave-all-method-classes x type-selector))) |
| 6873 | (if inherit | 6873 | (if inherit |
| 6874 | (setq classes | 6874 | (setq classes |
| 6875 | (delq nil | 6875 | (delq nil |
| 6876 | (mapcar (lambda (x) (if (memq x inherit) x nil)) | 6876 | (mapcar (lambda (x) (if (memq x inherit) x nil)) |
| 6877 | classes))))) | 6877 | classes))))) |
| @@ -6908,7 +6908,7 @@ accumulate information on matching completions." | |||
| 6908 | (defun idlwave-attach-class-tag-classes (list) | 6908 | (defun idlwave-attach-class-tag-classes (list) |
| 6909 | ;; Call idlwave-attach-classes with class structure tags | 6909 | ;; Call idlwave-attach-classes with class structure tags |
| 6910 | (idlwave-attach-classes list 'class-tag idlwave-completion-show-classes)) | 6910 | (idlwave-attach-classes list 'class-tag idlwave-completion-show-classes)) |
| 6911 | 6911 | ||
| 6912 | 6912 | ||
| 6913 | ;;---------------------------------------------------------------------- | 6913 | ;;---------------------------------------------------------------------- |
| 6914 | ;;---------------------------------------------------------------------- | 6914 | ;;---------------------------------------------------------------------- |
| @@ -6929,7 +6929,7 @@ sort the list before displaying" | |||
| 6929 | ((= 1 (length list)) | 6929 | ((= 1 (length list)) |
| 6930 | (setq rtn (car list))) | 6930 | (setq rtn (car list))) |
| 6931 | ((featurep 'xemacs) | 6931 | ((featurep 'xemacs) |
| 6932 | (if sort (setq list (sort list (lambda (a b) | 6932 | (if sort (setq list (sort list (lambda (a b) |
| 6933 | (string< (upcase a) (upcase b)))))) | 6933 | (string< (upcase a) (upcase b)))))) |
| 6934 | (setq menu | 6934 | (setq menu |
| 6935 | (append (list title) | 6935 | (append (list title) |
| @@ -6940,7 +6940,7 @@ sort the list before displaying" | |||
| 6940 | (setq resp (get-popup-menu-response menu)) | 6940 | (setq resp (get-popup-menu-response menu)) |
| 6941 | (funcall (event-function resp) (event-object resp))) | 6941 | (funcall (event-function resp) (event-object resp))) |
| 6942 | (t | 6942 | (t |
| 6943 | (if sort (setq list (sort list (lambda (a b) | 6943 | (if sort (setq list (sort list (lambda (a b) |
| 6944 | (string< (upcase a) (upcase b)))))) | 6944 | (string< (upcase a) (upcase b)))))) |
| 6945 | (setq menu (cons title | 6945 | (setq menu (cons title |
| 6946 | (list | 6946 | (list |
| @@ -7031,7 +7031,7 @@ sort the list before displaying" | |||
| 7031 | (setq idlwave-before-completion-wconf (current-window-configuration))) | 7031 | (setq idlwave-before-completion-wconf (current-window-configuration))) |
| 7032 | 7032 | ||
| 7033 | (if (featurep 'xemacs) | 7033 | (if (featurep 'xemacs) |
| 7034 | (idlwave-display-completion-list-xemacs | 7034 | (idlwave-display-completion-list-xemacs |
| 7035 | list) | 7035 | list) |
| 7036 | (idlwave-display-completion-list-emacs list)) | 7036 | (idlwave-display-completion-list-emacs list)) |
| 7037 | 7037 | ||
| @@ -7112,7 +7112,7 @@ If these don't exist, a letter in the string is automatically selected." | |||
| 7112 | (mapcar (lambda(x) | 7112 | (mapcar (lambda(x) |
| 7113 | (princ (nth 1 x)) | 7113 | (princ (nth 1 x)) |
| 7114 | (princ "\n")) | 7114 | (princ "\n")) |
| 7115 | keys-alist)) | 7115 | keys-alist)) |
| 7116 | (setq char (read-char))) | 7116 | (setq char (read-char))) |
| 7117 | (setq char (read-char))) | 7117 | (setq char (read-char))) |
| 7118 | (message nil) | 7118 | (message nil) |
| @@ -7232,7 +7232,7 @@ If these don't exist, a letter in the string is automatically selected." | |||
| 7232 | (defun idlwave-make-modified-completion-map-emacs (old-map) | 7232 | (defun idlwave-make-modified-completion-map-emacs (old-map) |
| 7233 | "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP." | 7233 | "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP." |
| 7234 | (let ((new-map (copy-keymap old-map))) | 7234 | (let ((new-map (copy-keymap old-map))) |
| 7235 | (substitute-key-definition | 7235 | (substitute-key-definition |
| 7236 | 'choose-completion 'idlwave-choose-completion new-map) | 7236 | 'choose-completion 'idlwave-choose-completion new-map) |
| 7237 | (substitute-key-definition | 7237 | (substitute-key-definition |
| 7238 | 'mouse-choose-completion 'idlwave-mouse-choose-completion new-map) | 7238 | 'mouse-choose-completion 'idlwave-mouse-choose-completion new-map) |
| @@ -7258,8 +7258,8 @@ If these don't exist, a letter in the string is automatically selected." | |||
| 7258 | ;; | 7258 | ;; |
| 7259 | ;; - Go again over the documentation how to write a completion | 7259 | ;; - Go again over the documentation how to write a completion |
| 7260 | ;; plugin. It is in self.el, but currently still very bad. | 7260 | ;; plugin. It is in self.el, but currently still very bad. |
| 7261 | ;; This could be in a separate file in the distribution, or | 7261 | ;; This could be in a separate file in the distribution, or |
| 7262 | ;; in an appendix for the manual. | 7262 | ;; in an appendix for the manual. |
| 7263 | 7263 | ||
| 7264 | (defvar idlwave-struct-skip | 7264 | (defvar idlwave-struct-skip |
| 7265 | "[ \t]*\\(\\$.*\n\\(^[ \t]*\\(\\$[ \t]*\\)?\\(;.*\\)?\n\\)*\\)?[ \t]*" | 7265 | "[ \t]*\\(\\$.*\n\\(^[ \t]*\\(\\$[ \t]*\\)?\\(;.*\\)?\n\\)*\\)?[ \t]*" |
| @@ -7298,7 +7298,7 @@ Point is expected just before the opening `{' of the struct definition." | |||
| 7298 | (beg (car borders)) | 7298 | (beg (car borders)) |
| 7299 | (end (cdr borders)) | 7299 | (end (cdr borders)) |
| 7300 | (case-fold-search t)) | 7300 | (case-fold-search t)) |
| 7301 | (re-search-forward (concat "\\(^[ \t]*\\|[,{][ \t]*\\)" tag "[ \t]*:") | 7301 | (re-search-forward (concat "\\(^[ \t]*\\|[,{][ \t]*\\)" tag "[ \t]*:") |
| 7302 | end t))) | 7302 | end t))) |
| 7303 | 7303 | ||
| 7304 | (defun idlwave-struct-inherits () | 7304 | (defun idlwave-struct-inherits () |
| @@ -7313,7 +7313,7 @@ Point is expected just before the opening `{' of the struct definition." | |||
| 7313 | (goto-char beg) | 7313 | (goto-char beg) |
| 7314 | (save-restriction | 7314 | (save-restriction |
| 7315 | (narrow-to-region beg end) | 7315 | (narrow-to-region beg end) |
| 7316 | (while (re-search-forward | 7316 | (while (re-search-forward |
| 7317 | (concat "[{,]" ;leading comma/brace | 7317 | (concat "[{,]" ;leading comma/brace |
| 7318 | idlwave-struct-skip ; 4 groups | 7318 | idlwave-struct-skip ; 4 groups |
| 7319 | "inherits" ; The INHERITS tag | 7319 | "inherits" ; The INHERITS tag |
| @@ -7363,9 +7363,9 @@ backward." | |||
| 7363 | (concat "\\<" (regexp-quote (downcase var)) "\\>" ws) | 7363 | (concat "\\<" (regexp-quote (downcase var)) "\\>" ws) |
| 7364 | "\\(\\)") | 7364 | "\\(\\)") |
| 7365 | "=" ws "\\({\\)" | 7365 | "=" ws "\\({\\)" |
| 7366 | (if name | 7366 | (if name |
| 7367 | (if (stringp name) | 7367 | (if (stringp name) |
| 7368 | (concat ws "\\(\\<" (downcase name) "\\)[^a-zA-Z0-9_$]") | 7368 | (concat ws "\\(\\<" (downcase name) "\\)[^a-zA-Z0-9_$]") |
| 7369 | ;; Just a generic name | 7369 | ;; Just a generic name |
| 7370 | (concat ws "\\<\\([a-zA-Z_0-9$]+\\)" ws ",")) | 7370 | (concat ws "\\<\\([a-zA-Z_0-9$]+\\)" ws ",")) |
| 7371 | "")))) | 7371 | "")))) |
| @@ -7376,7 +7376,7 @@ backward." | |||
| 7376 | (goto-char (match-beginning 3)) | 7376 | (goto-char (match-beginning 3)) |
| 7377 | (match-string-no-properties 5))))) | 7377 | (match-string-no-properties 5))))) |
| 7378 | 7378 | ||
| 7379 | (defvar idlwave-class-info nil) | 7379 | (defvar idlwave-class-info nil) |
| 7380 | (defvar idlwave-class-reset nil) ; to reset buffer-local classes | 7380 | (defvar idlwave-class-reset nil) ; to reset buffer-local classes |
| 7381 | 7381 | ||
| 7382 | (add-hook 'idlwave-update-rinfo-hook | 7382 | (add-hook 'idlwave-update-rinfo-hook |
| @@ -7388,13 +7388,13 @@ backward." | |||
| 7388 | (let (list entry) | 7388 | (let (list entry) |
| 7389 | (if idlwave-class-info | 7389 | (if idlwave-class-info |
| 7390 | (if idlwave-class-reset | 7390 | (if idlwave-class-reset |
| 7391 | (setq | 7391 | (setq |
| 7392 | idlwave-class-reset nil | 7392 | idlwave-class-reset nil |
| 7393 | idlwave-class-info ; Remove any visited in a buffer | 7393 | idlwave-class-info ; Remove any visited in a buffer |
| 7394 | (delq nil (mapcar | 7394 | (delq nil (mapcar |
| 7395 | (lambda (x) | 7395 | (lambda (x) |
| 7396 | (let ((filebuf | 7396 | (let ((filebuf |
| 7397 | (idlwave-class-file-or-buffer | 7397 | (idlwave-class-file-or-buffer |
| 7398 | (or (cdr (assq 'found-in x)) (car x))))) | 7398 | (or (cdr (assq 'found-in x)) (car x))))) |
| 7399 | (if (cdr filebuf) | 7399 | (if (cdr filebuf) |
| 7400 | nil | 7400 | nil |
| @@ -7432,7 +7432,7 @@ class/struct definition" | |||
| 7432 | (progn | 7432 | (progn |
| 7433 | ;; For everything there | 7433 | ;; For everything there |
| 7434 | (setq end-lim (save-excursion (idlwave-end-of-subprogram) (point))) | 7434 | (setq end-lim (save-excursion (idlwave-end-of-subprogram) (point))) |
| 7435 | (while (setq name | 7435 | (while (setq name |
| 7436 | (idlwave-find-structure-definition nil t end-lim)) | 7436 | (idlwave-find-structure-definition nil t end-lim)) |
| 7437 | (funcall all-hook name))) | 7437 | (funcall all-hook name))) |
| 7438 | (idlwave-find-structure-definition nil (or alt-class class)))))) | 7438 | (idlwave-find-structure-definition nil (or alt-class class)))))) |
| @@ -7470,11 +7470,11 @@ class/struct definition" | |||
| 7470 | (insert-file-contents file)) | 7470 | (insert-file-contents file)) |
| 7471 | (save-excursion | 7471 | (save-excursion |
| 7472 | (goto-char 1) | 7472 | (goto-char 1) |
| 7473 | (idlwave-find-class-definition class | 7473 | (idlwave-find-class-definition class |
| 7474 | ;; Scan all of the structures found there | 7474 | ;; Scan all of the structures found there |
| 7475 | (lambda (name) | 7475 | (lambda (name) |
| 7476 | (let* ((this-class (idlwave-sintern-class name)) | 7476 | (let* ((this-class (idlwave-sintern-class name)) |
| 7477 | (entry | 7477 | (entry |
| 7478 | (list this-class | 7478 | (list this-class |
| 7479 | (cons 'tags (idlwave-struct-tags)) | 7479 | (cons 'tags (idlwave-struct-tags)) |
| 7480 | (cons 'inherits (idlwave-struct-inherits))))) | 7480 | (cons 'inherits (idlwave-struct-inherits))))) |
| @@ -7499,7 +7499,7 @@ class/struct definition" | |||
| 7499 | (condition-case err | 7499 | (condition-case err |
| 7500 | (apply 'append (mapcar 'idlwave-class-tags | 7500 | (apply 'append (mapcar 'idlwave-class-tags |
| 7501 | (cons class (idlwave-all-class-inherits class)))) | 7501 | (cons class (idlwave-all-class-inherits class)))) |
| 7502 | (error | 7502 | (error |
| 7503 | (idlwave-class-tag-reset) | 7503 | (idlwave-class-tag-reset) |
| 7504 | (error "%s" (error-message-string err))))) | 7504 | (error "%s" (error-message-string err))))) |
| 7505 | 7505 | ||
| @@ -7536,24 +7536,24 @@ The list is cached in `idlwave-class-info' for faster access." | |||
| 7536 | all-inherits)))))) | 7536 | all-inherits)))))) |
| 7537 | 7537 | ||
| 7538 | (defun idlwave-entry-keywords (entry &optional record-link) | 7538 | (defun idlwave-entry-keywords (entry &optional record-link) |
| 7539 | "Return the flat entry keywords alist from routine-info entry. | 7539 | "Return the flat entry keywords alist from routine-info entry. |
| 7540 | If RECORD-LINK is non-nil, the keyword text is copied and a text | 7540 | If RECORD-LINK is non-nil, the keyword text is copied and a text |
| 7541 | property indicating the link is added." | 7541 | property indicating the link is added." |
| 7542 | (let (kwds) | 7542 | (let (kwds) |
| 7543 | (mapcar | 7543 | (mapcar |
| 7544 | (lambda (key-list) | 7544 | (lambda (key-list) |
| 7545 | (let ((file (car key-list))) | 7545 | (let ((file (car key-list))) |
| 7546 | (mapcar (lambda (key-cons) | 7546 | (mapcar (lambda (key-cons) |
| 7547 | (let ((key (car key-cons)) | 7547 | (let ((key (car key-cons)) |
| 7548 | (link (cdr key-cons))) | 7548 | (link (cdr key-cons))) |
| 7549 | (when (and record-link file) | 7549 | (when (and record-link file) |
| 7550 | (setq key (copy-sequence key)) | 7550 | (setq key (copy-sequence key)) |
| 7551 | (put-text-property | 7551 | (put-text-property |
| 7552 | 0 (length key) | 7552 | 0 (length key) |
| 7553 | 'link | 7553 | 'link |
| 7554 | (concat | 7554 | (concat |
| 7555 | file | 7555 | file |
| 7556 | (if link | 7556 | (if link |
| 7557 | (concat idlwave-html-link-sep | 7557 | (concat idlwave-html-link-sep |
| 7558 | (number-to-string link)))) | 7558 | (number-to-string link)))) |
| 7559 | key)) | 7559 | key)) |
| @@ -7566,13 +7566,13 @@ property indicating the link is added." | |||
| 7566 | "Find keyword KEYWORD in entry ENTRY, and return (with link) if set" | 7566 | "Find keyword KEYWORD in entry ENTRY, and return (with link) if set" |
| 7567 | (catch 'exit | 7567 | (catch 'exit |
| 7568 | (mapc | 7568 | (mapc |
| 7569 | (lambda (key-list) | 7569 | (lambda (key-list) |
| 7570 | (let ((file (car key-list)) | 7570 | (let ((file (car key-list)) |
| 7571 | (kwd (assoc keyword (cdr key-list)))) | 7571 | (kwd (assoc keyword (cdr key-list)))) |
| 7572 | (when kwd | 7572 | (when kwd |
| 7573 | (setq kwd (cons (car kwd) | 7573 | (setq kwd (cons (car kwd) |
| 7574 | (if (and file (cdr kwd)) | 7574 | (if (and file (cdr kwd)) |
| 7575 | (concat file | 7575 | (concat file |
| 7576 | idlwave-html-link-sep | 7576 | idlwave-html-link-sep |
| 7577 | (number-to-string (cdr kwd))) | 7577 | (number-to-string (cdr kwd))) |
| 7578 | (cdr kwd)))) | 7578 | (cdr kwd)))) |
| @@ -7610,14 +7610,14 @@ property indicating the link is added." | |||
| 7610 | ;; Check if we need to update the "current" class | 7610 | ;; Check if we need to update the "current" class |
| 7611 | (if (not (equal class-selector idlwave-current-tags-class)) | 7611 | (if (not (equal class-selector idlwave-current-tags-class)) |
| 7612 | (idlwave-prepare-class-tag-completion class-selector)) | 7612 | (idlwave-prepare-class-tag-completion class-selector)) |
| 7613 | (setq idlwave-completion-help-info | 7613 | (setq idlwave-completion-help-info |
| 7614 | (list 'idlwave-complete-class-structure-tag-help | 7614 | (list 'idlwave-complete-class-structure-tag-help |
| 7615 | (idlwave-sintern-routine | 7615 | (idlwave-sintern-routine |
| 7616 | (concat class-selector "__define")) | 7616 | (concat class-selector "__define")) |
| 7617 | nil)) | 7617 | nil)) |
| 7618 | (let ((idlwave-cpl-bold idlwave-current-native-class-tags)) | 7618 | (let ((idlwave-cpl-bold idlwave-current-native-class-tags)) |
| 7619 | (idlwave-complete-in-buffer | 7619 | (idlwave-complete-in-buffer |
| 7620 | 'class-tag 'class-tag | 7620 | 'class-tag 'class-tag |
| 7621 | idlwave-current-class-tags nil | 7621 | idlwave-current-class-tags nil |
| 7622 | (format "Select a tag of class %s" class-selector) | 7622 | (format "Select a tag of class %s" class-selector) |
| 7623 | "class tag" | 7623 | "class tag" |
| @@ -7663,7 +7663,7 @@ property indicating the link is added." | |||
| 7663 | (skip-chars-backward "[a-zA-Z0-9_$]") | 7663 | (skip-chars-backward "[a-zA-Z0-9_$]") |
| 7664 | (equal (char-before) ?!)) | 7664 | (equal (char-before) ?!)) |
| 7665 | (setq idlwave-completion-help-info '(idlwave-complete-sysvar-help)) | 7665 | (setq idlwave-completion-help-info '(idlwave-complete-sysvar-help)) |
| 7666 | (idlwave-complete-in-buffer 'sysvar 'sysvar | 7666 | (idlwave-complete-in-buffer 'sysvar 'sysvar |
| 7667 | idlwave-system-variables-alist nil | 7667 | idlwave-system-variables-alist nil |
| 7668 | "Select a system variable" | 7668 | "Select a system variable" |
| 7669 | "system variable") | 7669 | "system variable") |
| @@ -7682,7 +7682,7 @@ property indicating the link is added." | |||
| 7682 | (or tags (error "System variable !%s is not a structure" var)) | 7682 | (or tags (error "System variable !%s is not a structure" var)) |
| 7683 | (setq idlwave-completion-help-info | 7683 | (setq idlwave-completion-help-info |
| 7684 | (list 'idlwave-complete-sysvar-tag-help var)) | 7684 | (list 'idlwave-complete-sysvar-tag-help var)) |
| 7685 | (idlwave-complete-in-buffer 'sysvartag 'sysvartag | 7685 | (idlwave-complete-in-buffer 'sysvartag 'sysvartag |
| 7686 | tags nil | 7686 | tags nil |
| 7687 | "Select a system variable tag" | 7687 | "Select a system variable tag" |
| 7688 | "system variable tag") | 7688 | "system variable tag") |
| @@ -7711,8 +7711,8 @@ property indicating the link is added." | |||
| 7711 | ((eq mode 'test) ; we can at least link the main | 7711 | ((eq mode 'test) ; we can at least link the main |
| 7712 | (and (stringp word) entry main)) | 7712 | (and (stringp word) entry main)) |
| 7713 | ((eq mode 'set) | 7713 | ((eq mode 'set) |
| 7714 | (if entry | 7714 | (if entry |
| 7715 | (setq link | 7715 | (setq link |
| 7716 | (if (setq target (cdr (assoc word tags))) | 7716 | (if (setq target (cdr (assoc word tags))) |
| 7717 | (idlwave-substitute-link-target main target) | 7717 | (idlwave-substitute-link-target main target) |
| 7718 | main)))) ;; setting dynamic!!! | 7718 | main)))) ;; setting dynamic!!! |
| @@ -7736,7 +7736,7 @@ property indicating the link is added." | |||
| 7736 | 7736 | ||
| 7737 | ;; Fake help in the source buffer for class structure tags. | 7737 | ;; Fake help in the source buffer for class structure tags. |
| 7738 | ;; KWD AND NAME ARE GLOBAL-VARIABLES HERE. | 7738 | ;; KWD AND NAME ARE GLOBAL-VARIABLES HERE. |
| 7739 | (defvar name) | 7739 | (defvar name) |
| 7740 | (defvar kwd) | 7740 | (defvar kwd) |
| 7741 | (defvar idlwave-help-do-class-struct-tag nil) | 7741 | (defvar idlwave-help-do-class-struct-tag nil) |
| 7742 | (defun idlwave-complete-class-structure-tag-help (mode word) | 7742 | (defun idlwave-complete-class-structure-tag-help (mode word) |
| @@ -7745,11 +7745,11 @@ property indicating the link is added." | |||
| 7745 | nil) | 7745 | nil) |
| 7746 | ((eq mode 'set) | 7746 | ((eq mode 'set) |
| 7747 | (let (class-with found-in) | 7747 | (let (class-with found-in) |
| 7748 | (when (setq class-with | 7748 | (when (setq class-with |
| 7749 | (idlwave-class-or-superclass-with-tag | 7749 | (idlwave-class-or-superclass-with-tag |
| 7750 | idlwave-current-tags-class | 7750 | idlwave-current-tags-class |
| 7751 | word)) | 7751 | word)) |
| 7752 | (if (assq (idlwave-sintern-class class-with) | 7752 | (if (assq (idlwave-sintern-class class-with) |
| 7753 | idlwave-system-class-info) | 7753 | idlwave-system-class-info) |
| 7754 | (error "No help available for system class tags")) | 7754 | (error "No help available for system class tags")) |
| 7755 | (if (setq found-in (idlwave-class-found-in class-with)) | 7755 | (if (setq found-in (idlwave-class-found-in class-with)) |
| @@ -7762,7 +7762,7 @@ property indicating the link is added." | |||
| 7762 | (defun idlwave-class-or-superclass-with-tag (class tag) | 7762 | (defun idlwave-class-or-superclass-with-tag (class tag) |
| 7763 | "Find and return the CLASS or one of its superclass with the | 7763 | "Find and return the CLASS or one of its superclass with the |
| 7764 | associated TAG, if any." | 7764 | associated TAG, if any." |
| 7765 | (let ((sclasses (cons class (cdr (assq 'all-inherits | 7765 | (let ((sclasses (cons class (cdr (assq 'all-inherits |
| 7766 | (idlwave-class-info class))))) | 7766 | (idlwave-class-info class))))) |
| 7767 | cl) | 7767 | cl) |
| 7768 | (catch 'exit | 7768 | (catch 'exit |
| @@ -7771,7 +7771,7 @@ associated TAG, if any." | |||
| 7771 | (let ((tags (idlwave-class-tags cl))) | 7771 | (let ((tags (idlwave-class-tags cl))) |
| 7772 | (while tags | 7772 | (while tags |
| 7773 | (if (eq t (compare-strings tag 0 nil (car tags) 0 nil t)) | 7773 | (if (eq t (compare-strings tag 0 nil (car tags) 0 nil t)) |
| 7774 | (throw 'exit cl)) | 7774 | (throw 'exit cl)) |
| 7775 | (setq tags (cdr tags)))))))) | 7775 | (setq tags (cdr tags)))))))) |
| 7776 | 7776 | ||
| 7777 | 7777 | ||
| @@ -7794,8 +7794,8 @@ associated TAG, if any." | |||
| 7794 | (setcar entry (idlwave-sintern-sysvar (car entry) 'set)) | 7794 | (setcar entry (idlwave-sintern-sysvar (car entry) 'set)) |
| 7795 | (setq tags (assq 'tags entry)) | 7795 | (setq tags (assq 'tags entry)) |
| 7796 | (if tags | 7796 | (if tags |
| 7797 | (setcdr tags | 7797 | (setcdr tags |
| 7798 | (mapcar (lambda (x) | 7798 | (mapcar (lambda (x) |
| 7799 | (cons (idlwave-sintern-sysvartag (car x) 'set) | 7799 | (cons (idlwave-sintern-sysvartag (car x) 'set) |
| 7800 | (cdr x))) | 7800 | (cdr x))) |
| 7801 | (cdr tags))))))) | 7801 | (cdr tags))))))) |
| @@ -7812,19 +7812,19 @@ associated TAG, if any." | |||
| 7812 | text start) | 7812 | text start) |
| 7813 | (setq start (match-end 0) | 7813 | (setq start (match-end 0) |
| 7814 | var (match-string 1 text) | 7814 | var (match-string 1 text) |
| 7815 | tags (if (match-end 3) | 7815 | tags (if (match-end 3) |
| 7816 | (idlwave-split-string (match-string 3 text)))) | 7816 | (idlwave-split-string (match-string 3 text)))) |
| 7817 | ;; Maintain old links, if present | 7817 | ;; Maintain old links, if present |
| 7818 | (setq old-entry (assq (idlwave-sintern-sysvar var) old)) | 7818 | (setq old-entry (assq (idlwave-sintern-sysvar var) old)) |
| 7819 | (setq link (assq 'link old-entry)) | 7819 | (setq link (assq 'link old-entry)) |
| 7820 | (setq idlwave-system-variables-alist | 7820 | (setq idlwave-system-variables-alist |
| 7821 | (cons (list var | 7821 | (cons (list var |
| 7822 | (cons | 7822 | (cons |
| 7823 | 'tags | 7823 | 'tags |
| 7824 | (mapcar (lambda (x) | 7824 | (mapcar (lambda (x) |
| 7825 | (cons x | 7825 | (cons x |
| 7826 | (cdr (assq | 7826 | (cdr (assq |
| 7827 | (idlwave-sintern-sysvartag x) | 7827 | (idlwave-sintern-sysvartag x) |
| 7828 | (cdr (assq 'tags old-entry)))))) | 7828 | (cdr (assq 'tags old-entry)))))) |
| 7829 | tags)) link) | 7829 | tags)) link) |
| 7830 | idlwave-system-variables-alist))) | 7830 | idlwave-system-variables-alist))) |
| @@ -7846,9 +7846,9 @@ associated TAG, if any." | |||
| 7846 | 7846 | ||
| 7847 | (defun idlwave-uniquify (list) | 7847 | (defun idlwave-uniquify (list) |
| 7848 | (let ((ht (make-hash-table :size (length list) :test 'equal))) | 7848 | (let ((ht (make-hash-table :size (length list) :test 'equal))) |
| 7849 | (delq nil | 7849 | (delq nil |
| 7850 | (mapcar (lambda (x) | 7850 | (mapcar (lambda (x) |
| 7851 | (unless (gethash x ht) | 7851 | (unless (gethash x ht) |
| 7852 | (puthash x t ht) | 7852 | (puthash x t ht) |
| 7853 | x)) | 7853 | x)) |
| 7854 | list)))) | 7854 | list)))) |
| @@ -7876,11 +7876,11 @@ Restore the pre-completion window configuration if possible." | |||
| 7876 | nil))) | 7876 | nil))) |
| 7877 | 7877 | ||
| 7878 | ;; Restore the pre-completion window configuration if this is safe. | 7878 | ;; Restore the pre-completion window configuration if this is safe. |
| 7879 | 7879 | ||
| 7880 | (if (or (eq verify 'force) ; force | 7880 | (if (or (eq verify 'force) ; force |
| 7881 | (and | 7881 | (and |
| 7882 | (get-buffer-window "*Completions*") ; visible | 7882 | (get-buffer-window "*Completions*") ; visible |
| 7883 | (idlwave-local-value 'idlwave-completion-p | 7883 | (idlwave-local-value 'idlwave-completion-p |
| 7884 | "*Completions*") ; cib-buffer | 7884 | "*Completions*") ; cib-buffer |
| 7885 | (eq (marker-buffer idlwave-completion-mark) | 7885 | (eq (marker-buffer idlwave-completion-mark) |
| 7886 | (current-buffer)) ; buffer OK | 7886 | (current-buffer)) ; buffer OK |
| @@ -7978,7 +7978,7 @@ With ARG, enforce query for the class of object methods." | |||
| 7978 | (if (string-match "\\(pro\\|function\\)[ \t]+\\(\\(.*\\)::\\)?\\(.*\\)" | 7978 | (if (string-match "\\(pro\\|function\\)[ \t]+\\(\\(.*\\)::\\)?\\(.*\\)" |
| 7979 | resolve) | 7979 | resolve) |
| 7980 | (setq type (match-string 1 resolve) | 7980 | (setq type (match-string 1 resolve) |
| 7981 | class (if (match-beginning 2) | 7981 | class (if (match-beginning 2) |
| 7982 | (match-string 3 resolve) | 7982 | (match-string 3 resolve) |
| 7983 | nil) | 7983 | nil) |
| 7984 | name (match-string 4 resolve))) | 7984 | name (match-string 4 resolve))) |
| @@ -7987,15 +7987,15 @@ With ARG, enforce query for the class of object methods." | |||
| 7987 | 7987 | ||
| 7988 | (cond | 7988 | (cond |
| 7989 | ((null class) | 7989 | ((null class) |
| 7990 | (idlwave-shell-send-command | 7990 | (idlwave-shell-send-command |
| 7991 | (format "resolve_routine,'%s'%s" (downcase name) kwd) | 7991 | (format "resolve_routine,'%s'%s" (downcase name) kwd) |
| 7992 | 'idlwave-update-routine-info | 7992 | 'idlwave-update-routine-info |
| 7993 | nil t)) | 7993 | nil t)) |
| 7994 | (t | 7994 | (t |
| 7995 | (idlwave-shell-send-command | 7995 | (idlwave-shell-send-command |
| 7996 | (format "resolve_routine,'%s__define'%s" (downcase class) kwd) | 7996 | (format "resolve_routine,'%s__define'%s" (downcase class) kwd) |
| 7997 | (list 'idlwave-shell-send-command | 7997 | (list 'idlwave-shell-send-command |
| 7998 | (format "resolve_routine,'%s__%s'%s" | 7998 | (format "resolve_routine,'%s__%s'%s" |
| 7999 | (downcase class) (downcase name) kwd) | 7999 | (downcase class) (downcase name) kwd) |
| 8000 | '(idlwave-update-routine-info) | 8000 | '(idlwave-update-routine-info) |
| 8001 | nil t)))))) | 8001 | nil t)))))) |
| @@ -8016,19 +8016,19 @@ force class query for object methods." | |||
| 8016 | (this-buffer (equal arg '(4))) | 8016 | (this-buffer (equal arg '(4))) |
| 8017 | (module (idlwave-fix-module-if-obj_new (idlwave-what-module))) | 8017 | (module (idlwave-fix-module-if-obj_new (idlwave-what-module))) |
| 8018 | (default (if module | 8018 | (default (if module |
| 8019 | (concat (idlwave-make-full-name | 8019 | (concat (idlwave-make-full-name |
| 8020 | (nth 2 module) (car module)) | 8020 | (nth 2 module) (car module)) |
| 8021 | (if (eq (nth 1 module) 'pro) "<p>" "<f>")) | 8021 | (if (eq (nth 1 module) 'pro) "<p>" "<f>")) |
| 8022 | "none")) | 8022 | "none")) |
| 8023 | (list | 8023 | (list |
| 8024 | (idlwave-uniquify | 8024 | (idlwave-uniquify |
| 8025 | (delq nil | 8025 | (delq nil |
| 8026 | (mapcar (lambda (x) | 8026 | (mapcar (lambda (x) |
| 8027 | (if (eq 'system (car-safe (nth 3 x))) | 8027 | (if (eq 'system (car-safe (nth 3 x))) |
| 8028 | ;; Take out system routines with no source. | 8028 | ;; Take out system routines with no source. |
| 8029 | nil | 8029 | nil |
| 8030 | (list | 8030 | (list |
| 8031 | (concat (idlwave-make-full-name | 8031 | (concat (idlwave-make-full-name |
| 8032 | (nth 2 x) (car x)) | 8032 | (nth 2 x) (car x)) |
| 8033 | (if (eq (nth 1 x) 'pro) "<p>" "<f>"))))) | 8033 | (if (eq (nth 1 x) 'pro) "<p>" "<f>"))))) |
| 8034 | (if this-buffer | 8034 | (if this-buffer |
| @@ -8057,10 +8057,10 @@ force class query for object methods." | |||
| 8057 | (t t))) | 8057 | (t t))) |
| 8058 | (idlwave-do-find-module name type class nil this-buffer))) | 8058 | (idlwave-do-find-module name type class nil this-buffer))) |
| 8059 | 8059 | ||
| 8060 | (defun idlwave-do-find-module (name type class | 8060 | (defun idlwave-do-find-module (name type class |
| 8061 | &optional force-source this-buffer) | 8061 | &optional force-source this-buffer) |
| 8062 | (let ((name1 (idlwave-make-full-name class name)) | 8062 | (let ((name1 (idlwave-make-full-name class name)) |
| 8063 | source buf1 entry | 8063 | source buf1 entry |
| 8064 | (buf (current-buffer)) | 8064 | (buf (current-buffer)) |
| 8065 | (pos (point)) | 8065 | (pos (point)) |
| 8066 | file name2) | 8066 | file name2) |
| @@ -8070,11 +8070,11 @@ force class query for object methods." | |||
| 8070 | name2 (if (nth 2 entry) | 8070 | name2 (if (nth 2 entry) |
| 8071 | (idlwave-make-full-name (nth 2 entry) name) | 8071 | (idlwave-make-full-name (nth 2 entry) name) |
| 8072 | name1)) | 8072 | name1)) |
| 8073 | (if source | 8073 | (if source |
| 8074 | (setq file (idlwave-routine-source-file source))) | 8074 | (setq file (idlwave-routine-source-file source))) |
| 8075 | (unless file ; Try to find it on the path. | 8075 | (unless file ; Try to find it on the path. |
| 8076 | (setq file | 8076 | (setq file |
| 8077 | (idlwave-expand-lib-file-name | 8077 | (idlwave-expand-lib-file-name |
| 8078 | (if class | 8078 | (if class |
| 8079 | (format "%s__define.pro" (downcase class)) | 8079 | (format "%s__define.pro" (downcase class)) |
| 8080 | (format "%s.pro" (downcase name)))))) | 8080 | (format "%s.pro" (downcase name)))))) |
| @@ -8082,14 +8082,14 @@ force class query for object methods." | |||
| 8082 | ((or (null name) (equal name "")) | 8082 | ((or (null name) (equal name "")) |
| 8083 | (error "Abort")) | 8083 | (error "Abort")) |
| 8084 | ((eq (car source) 'system) | 8084 | ((eq (car source) 'system) |
| 8085 | (error "Source code for system routine %s is not available" | 8085 | (error "Source code for system routine %s is not available" |
| 8086 | name2)) | 8086 | name2)) |
| 8087 | ((or (not file) (not (file-regular-p file))) | 8087 | ((or (not file) (not (file-regular-p file))) |
| 8088 | (error "Source code for routine %s is not available" | 8088 | (error "Source code for routine %s is not available" |
| 8089 | name2)) | 8089 | name2)) |
| 8090 | (t | 8090 | (t |
| 8091 | (when (not this-buffer) | 8091 | (when (not this-buffer) |
| 8092 | (setq buf1 | 8092 | (setq buf1 |
| 8093 | (idlwave-find-file-noselect file 'find)) | 8093 | (idlwave-find-file-noselect file 'find)) |
| 8094 | (pop-to-buffer buf1 t)) | 8094 | (pop-to-buffer buf1 t)) |
| 8095 | (goto-char (point-max)) | 8095 | (goto-char (point-max)) |
| @@ -8099,7 +8099,7 @@ force class query for object methods." | |||
| 8099 | (cond ((eq type 'fun) "function") | 8099 | (cond ((eq type 'fun) "function") |
| 8100 | ((eq type 'pro) "pro") | 8100 | ((eq type 'pro) "pro") |
| 8101 | (t "\\(pro\\|function\\)")) | 8101 | (t "\\(pro\\|function\\)")) |
| 8102 | "\\>[ \t]+" | 8102 | "\\>[ \t]+" |
| 8103 | (regexp-quote (downcase name2)) | 8103 | (regexp-quote (downcase name2)) |
| 8104 | "[^a-zA-Z0-9_$]") | 8104 | "[^a-zA-Z0-9_$]") |
| 8105 | nil t) | 8105 | nil t) |
| @@ -8136,17 +8136,17 @@ Used by `idlwave-routine-info' and `idlwave-find-module'." | |||
| 8136 | (cond | 8136 | (cond |
| 8137 | ((and (eq cw 'procedure) | 8137 | ((and (eq cw 'procedure) |
| 8138 | (not (equal this-word ""))) | 8138 | (not (equal this-word ""))) |
| 8139 | (setq this-word (idlwave-sintern-routine-or-method | 8139 | (setq this-word (idlwave-sintern-routine-or-method |
| 8140 | this-word (nth 2 (nth 3 where)))) | 8140 | this-word (nth 2 (nth 3 where)))) |
| 8141 | (list this-word 'pro | 8141 | (list this-word 'pro |
| 8142 | (idlwave-determine-class | 8142 | (idlwave-determine-class |
| 8143 | (cons this-word (cdr (nth 3 where))) | 8143 | (cons this-word (cdr (nth 3 where))) |
| 8144 | 'pro))) | 8144 | 'pro))) |
| 8145 | ((and (eq cw 'function) | 8145 | ((and (eq cw 'function) |
| 8146 | (not (equal this-word "")) | 8146 | (not (equal this-word "")) |
| 8147 | (or (eq next-char ?\() ; exclude arrays, vars. | 8147 | (or (eq next-char ?\() ; exclude arrays, vars. |
| 8148 | (looking-at "[a-zA-Z0-9_]*[ \t]*("))) | 8148 | (looking-at "[a-zA-Z0-9_]*[ \t]*("))) |
| 8149 | (setq this-word (idlwave-sintern-routine-or-method | 8149 | (setq this-word (idlwave-sintern-routine-or-method |
| 8150 | this-word (nth 2 (nth 3 where)))) | 8150 | this-word (nth 2 (nth 3 where)))) |
| 8151 | (list this-word 'fun | 8151 | (list this-word 'fun |
| 8152 | (idlwave-determine-class | 8152 | (idlwave-determine-class |
| @@ -8183,7 +8183,7 @@ Used by `idlwave-routine-info' and `idlwave-find-module'." | |||
| 8183 | class))) | 8183 | class))) |
| 8184 | 8184 | ||
| 8185 | (defun idlwave-fix-module-if-obj_new (module) | 8185 | (defun idlwave-fix-module-if-obj_new (module) |
| 8186 | "Check if MODULE points to obj_new. | 8186 | "Check if MODULE points to obj_new. |
| 8187 | If yes, and if the cursor is in the keyword region, change to the | 8187 | If yes, and if the cursor is in the keyword region, change to the |
| 8188 | appropriate Init method." | 8188 | appropriate Init method." |
| 8189 | (let* ((name (car module)) | 8189 | (let* ((name (car module)) |
| @@ -8204,7 +8204,7 @@ appropriate Init method." | |||
| 8204 | (idlwave-sintern-class class))))) | 8204 | (idlwave-sintern-class class))))) |
| 8205 | module)) | 8205 | module)) |
| 8206 | 8206 | ||
| 8207 | (defun idlwave-fix-keywords (name type class keywords | 8207 | (defun idlwave-fix-keywords (name type class keywords |
| 8208 | &optional super-classes system) | 8208 | &optional super-classes system) |
| 8209 | "Update a list of keywords. | 8209 | "Update a list of keywords. |
| 8210 | Translate OBJ_NEW, adding all super-class keywords, or all keywords | 8210 | Translate OBJ_NEW, adding all super-class keywords, or all keywords |
| @@ -8225,34 +8225,34 @@ demand _EXTRA in the keyword list." | |||
| 8225 | string) | 8225 | string) |
| 8226 | (setq class (idlwave-sintern-class (match-string 1 string))) | 8226 | (setq class (idlwave-sintern-class (match-string 1 string))) |
| 8227 | (setq idlwave-current-obj_new-class class) | 8227 | (setq idlwave-current-obj_new-class class) |
| 8228 | (setq keywords | 8228 | (setq keywords |
| 8229 | (append keywords | 8229 | (append keywords |
| 8230 | (idlwave-entry-keywords | 8230 | (idlwave-entry-keywords |
| 8231 | (idlwave-rinfo-assq | 8231 | (idlwave-rinfo-assq |
| 8232 | (idlwave-sintern-method "INIT") | 8232 | (idlwave-sintern-method "INIT") |
| 8233 | 'fun | 8233 | 'fun |
| 8234 | class | 8234 | class |
| 8235 | (idlwave-routines)) 'do-link)))))) | 8235 | (idlwave-routines)) 'do-link)))))) |
| 8236 | 8236 | ||
| 8237 | ;; If the class is `t', combine all keywords of all methods NAME | 8237 | ;; If the class is `t', combine all keywords of all methods NAME |
| 8238 | (when (eq class t) | 8238 | (when (eq class t) |
| 8239 | (mapc (lambda (entry) | 8239 | (mapc (lambda (entry) |
| 8240 | (and | 8240 | (and |
| 8241 | (nth 2 entry) ; non-nil class | 8241 | (nth 2 entry) ; non-nil class |
| 8242 | (eq (nth 1 entry) type) ; correct type | 8242 | (eq (nth 1 entry) type) ; correct type |
| 8243 | (setq keywords | 8243 | (setq keywords |
| 8244 | (append keywords | 8244 | (append keywords |
| 8245 | (idlwave-entry-keywords entry 'do-link))))) | 8245 | (idlwave-entry-keywords entry 'do-link))))) |
| 8246 | (idlwave-all-assq name (idlwave-routines))) | 8246 | (idlwave-all-assq name (idlwave-routines))) |
| 8247 | (setq keywords (idlwave-uniquify keywords))) | 8247 | (setq keywords (idlwave-uniquify keywords))) |
| 8248 | 8248 | ||
| 8249 | ;; If we have inheritance, add all keywords from superclasses, if | 8249 | ;; If we have inheritance, add all keywords from superclasses, if |
| 8250 | ;; the user indicated that method in `idlwave-keyword-class-inheritance' | 8250 | ;; the user indicated that method in `idlwave-keyword-class-inheritance' |
| 8251 | (when (and | 8251 | (when (and |
| 8252 | super-classes | 8252 | super-classes |
| 8253 | idlwave-keyword-class-inheritance | 8253 | idlwave-keyword-class-inheritance |
| 8254 | (stringp class) | 8254 | (stringp class) |
| 8255 | (or | 8255 | (or |
| 8256 | system | 8256 | system |
| 8257 | (assq (idlwave-sintern-keyword "_extra") keywords) | 8257 | (assq (idlwave-sintern-keyword "_extra") keywords) |
| 8258 | (assq (idlwave-sintern-keyword "_ref_extra") keywords)) | 8258 | (assq (idlwave-sintern-keyword "_ref_extra") keywords)) |
| @@ -8270,7 +8270,7 @@ demand _EXTRA in the keyword list." | |||
| 8270 | (mapcar (lambda (k) (add-to-list 'keywords k)) | 8270 | (mapcar (lambda (k) (add-to-list 'keywords k)) |
| 8271 | (idlwave-entry-keywords entry 'do-link)))) | 8271 | (idlwave-entry-keywords entry 'do-link)))) |
| 8272 | (setq keywords (idlwave-uniquify keywords))) | 8272 | (setq keywords (idlwave-uniquify keywords))) |
| 8273 | 8273 | ||
| 8274 | ;; Return the final list | 8274 | ;; Return the final list |
| 8275 | keywords)) | 8275 | keywords)) |
| 8276 | 8276 | ||
| @@ -8295,14 +8295,14 @@ If we do not know about MODULE, just return KEYWORD literally." | |||
| 8295 | (assq (idlwave-sintern-keyword "_REF_EXTRA") kwd-alist))) | 8295 | (assq (idlwave-sintern-keyword "_REF_EXTRA") kwd-alist))) |
| 8296 | (completion-ignore-case t) | 8296 | (completion-ignore-case t) |
| 8297 | candidates) | 8297 | candidates) |
| 8298 | (cond ((assq kwd kwd-alist) | 8298 | (cond ((assq kwd kwd-alist) |
| 8299 | kwd) | 8299 | kwd) |
| 8300 | ((setq candidates (all-completions kwd kwd-alist)) | 8300 | ((setq candidates (all-completions kwd kwd-alist)) |
| 8301 | (if (= (length candidates) 1) | 8301 | (if (= (length candidates) 1) |
| 8302 | (car candidates) | 8302 | (car candidates) |
| 8303 | candidates)) | 8303 | candidates)) |
| 8304 | ((and entry extra) | 8304 | ((and entry extra) |
| 8305 | ;; Inheritance may cause this keyword to be correct | 8305 | ;; Inheritance may cause this keyword to be correct |
| 8306 | keyword) | 8306 | keyword) |
| 8307 | (entry | 8307 | (entry |
| 8308 | ;; We do know the function, which does not have the keyword. | 8308 | ;; We do know the function, which does not have the keyword. |
| @@ -8314,13 +8314,13 @@ If we do not know about MODULE, just return KEYWORD literally." | |||
| 8314 | 8314 | ||
| 8315 | (defvar idlwave-rinfo-mouse-map (make-sparse-keymap)) | 8315 | (defvar idlwave-rinfo-mouse-map (make-sparse-keymap)) |
| 8316 | (defvar idlwave-rinfo-map (make-sparse-keymap)) | 8316 | (defvar idlwave-rinfo-map (make-sparse-keymap)) |
| 8317 | (define-key idlwave-rinfo-mouse-map | 8317 | (define-key idlwave-rinfo-mouse-map |
| 8318 | (if (featurep 'xemacs) [button2] [mouse-2]) | 8318 | (if (featurep 'xemacs) [button2] [mouse-2]) |
| 8319 | 'idlwave-mouse-active-rinfo) | 8319 | 'idlwave-mouse-active-rinfo) |
| 8320 | (define-key idlwave-rinfo-mouse-map | 8320 | (define-key idlwave-rinfo-mouse-map |
| 8321 | (if (featurep 'xemacs) [(shift button2)] [(shift mouse-2)]) | 8321 | (if (featurep 'xemacs) [(shift button2)] [(shift mouse-2)]) |
| 8322 | 'idlwave-mouse-active-rinfo-shift) | 8322 | 'idlwave-mouse-active-rinfo-shift) |
| 8323 | (define-key idlwave-rinfo-mouse-map | 8323 | (define-key idlwave-rinfo-mouse-map |
| 8324 | (if (featurep 'xemacs) [button3] [mouse-3]) | 8324 | (if (featurep 'xemacs) [button3] [mouse-3]) |
| 8325 | 'idlwave-mouse-active-rinfo-right) | 8325 | 'idlwave-mouse-active-rinfo-right) |
| 8326 | (define-key idlwave-rinfo-mouse-map " " 'idlwave-active-rinfo-space) | 8326 | (define-key idlwave-rinfo-mouse-map " " 'idlwave-active-rinfo-space) |
| @@ -8346,7 +8346,7 @@ If we do not know about MODULE, just return KEYWORD literally." | |||
| 8346 | (let* ((initial-class (or initial-class class)) | 8346 | (let* ((initial-class (or initial-class class)) |
| 8347 | (entry (or (idlwave-best-rinfo-assq name type class | 8347 | (entry (or (idlwave-best-rinfo-assq name type class |
| 8348 | (idlwave-routines)) | 8348 | (idlwave-routines)) |
| 8349 | (idlwave-rinfo-assq name type class | 8349 | (idlwave-rinfo-assq name type class |
| 8350 | idlwave-unresolved-routines))) | 8350 | idlwave-unresolved-routines))) |
| 8351 | (name (or (car entry) name)) | 8351 | (name (or (car entry) name)) |
| 8352 | (class (or (nth 2 entry) class)) | 8352 | (class (or (nth 2 entry) class)) |
| @@ -8371,7 +8371,7 @@ If we do not know about MODULE, just return KEYWORD literally." | |||
| 8371 | (km-prop (if (featurep 'xemacs) 'keymap 'local-map)) | 8371 | (km-prop (if (featurep 'xemacs) 'keymap 'local-map)) |
| 8372 | (face 'idlwave-help-link) | 8372 | (face 'idlwave-help-link) |
| 8373 | beg props win cnt total) | 8373 | beg props win cnt total) |
| 8374 | ;; Fix keywords, but don't add chained super-classes, since these | 8374 | ;; Fix keywords, but don't add chained super-classes, since these |
| 8375 | ;; are shown separately for that super-class | 8375 | ;; are shown separately for that super-class |
| 8376 | (setq keywords (idlwave-fix-keywords name type class keywords)) | 8376 | (setq keywords (idlwave-fix-keywords name type class keywords)) |
| 8377 | (cond | 8377 | (cond |
| @@ -8413,7 +8413,7 @@ If we do not know about MODULE, just return KEYWORD literally." | |||
| 8413 | km-prop idlwave-rinfo-mouse-map | 8413 | km-prop idlwave-rinfo-mouse-map |
| 8414 | 'help-echo help-echo-use | 8414 | 'help-echo help-echo-use |
| 8415 | 'data (cons 'usage data))) | 8415 | 'data (cons 'usage data))) |
| 8416 | (if html-file (setq props (append (list 'face face 'link html-file) | 8416 | (if html-file (setq props (append (list 'face face 'link html-file) |
| 8417 | props))) | 8417 | props))) |
| 8418 | (insert "Usage: ") | 8418 | (insert "Usage: ") |
| 8419 | (setq beg (point)) | 8419 | (setq beg (point)) |
| @@ -8422,14 +8422,14 @@ If we do not know about MODULE, just return KEYWORD literally." | |||
| 8422 | (format calling-seq name name name name)) | 8422 | (format calling-seq name name name name)) |
| 8423 | "\n") | 8423 | "\n") |
| 8424 | (add-text-properties beg (point) props) | 8424 | (add-text-properties beg (point) props) |
| 8425 | 8425 | ||
| 8426 | (insert "Keywords:") | 8426 | (insert "Keywords:") |
| 8427 | (if (null keywords) | 8427 | (if (null keywords) |
| 8428 | (insert " No keywords accepted.") | 8428 | (insert " No keywords accepted.") |
| 8429 | (setq col 9) | 8429 | (setq col 9) |
| 8430 | (mapcar | 8430 | (mapcar |
| 8431 | (lambda (x) | 8431 | (lambda (x) |
| 8432 | (if (>= (+ col 1 (length (car x))) | 8432 | (if (>= (+ col 1 (length (car x))) |
| 8433 | (window-width)) | 8433 | (window-width)) |
| 8434 | (progn | 8434 | (progn |
| 8435 | (insert "\n ") | 8435 | (insert "\n ") |
| @@ -8447,7 +8447,7 @@ If we do not know about MODULE, just return KEYWORD literally." | |||
| 8447 | (add-text-properties beg (point) props) | 8447 | (add-text-properties beg (point) props) |
| 8448 | (setq col (+ col 1 (length (car x))))) | 8448 | (setq col (+ col 1 (length (car x))))) |
| 8449 | keywords)) | 8449 | keywords)) |
| 8450 | 8450 | ||
| 8451 | (setq cnt 1 total (length all)) | 8451 | (setq cnt 1 total (length all)) |
| 8452 | ;; Here entry is (key file (list of type-conses)) | 8452 | ;; Here entry is (key file (list of type-conses)) |
| 8453 | (while (setq entry (pop all)) | 8453 | (while (setq entry (pop all)) |
| @@ -8460,7 +8460,7 @@ If we do not know about MODULE, just return KEYWORD literally." | |||
| 8460 | (cdr (car (nth 2 entry)))) | 8460 | (cdr (car (nth 2 entry)))) |
| 8461 | 'data (cons 'source data))) | 8461 | 'data (cons 'source data))) |
| 8462 | (idlwave-insert-source-location | 8462 | (idlwave-insert-source-location |
| 8463 | (format "\n%-8s %s" | 8463 | (format "\n%-8s %s" |
| 8464 | (if (equal cnt 1) | 8464 | (if (equal cnt 1) |
| 8465 | (if (> total 1) "Sources:" "Source:") | 8465 | (if (> total 1) "Sources:" "Source:") |
| 8466 | "") | 8466 | "") |
| @@ -8469,7 +8469,7 @@ If we do not know about MODULE, just return KEYWORD literally." | |||
| 8469 | (incf cnt) | 8469 | (incf cnt) |
| 8470 | (when (and all (> cnt idlwave-rinfo-max-source-lines)) | 8470 | (when (and all (> cnt idlwave-rinfo-max-source-lines)) |
| 8471 | ;; No more source lines, please | 8471 | ;; No more source lines, please |
| 8472 | (insert (format | 8472 | (insert (format |
| 8473 | "\n Source information truncated to %d entries." | 8473 | "\n Source information truncated to %d entries." |
| 8474 | idlwave-rinfo-max-source-lines)) | 8474 | idlwave-rinfo-max-source-lines)) |
| 8475 | (setq all nil))) | 8475 | (setq all nil))) |
| @@ -8483,7 +8483,7 @@ If we do not know about MODULE, just return KEYWORD literally." | |||
| 8483 | (unwind-protect | 8483 | (unwind-protect |
| 8484 | (progn | 8484 | (progn |
| 8485 | (select-window win) | 8485 | (select-window win) |
| 8486 | (enlarge-window (- (/ (frame-height) 2) | 8486 | (enlarge-window (- (/ (frame-height) 2) |
| 8487 | (window-height))) | 8487 | (window-height))) |
| 8488 | (shrink-window-if-larger-than-buffer)) | 8488 | (shrink-window-if-larger-than-buffer)) |
| 8489 | (select-window ww))))))))) | 8489 | (select-window ww))))))))) |
| @@ -8520,9 +8520,9 @@ it." | |||
| 8520 | ((and (not file) shell-flag) | 8520 | ((and (not file) shell-flag) |
| 8521 | (insert "Unresolved")) | 8521 | (insert "Unresolved")) |
| 8522 | 8522 | ||
| 8523 | ((null file) | 8523 | ((null file) |
| 8524 | (insert "ERROR")) | 8524 | (insert "ERROR")) |
| 8525 | 8525 | ||
| 8526 | ((idlwave-syslib-p file) | 8526 | ((idlwave-syslib-p file) |
| 8527 | (if (string-match "obsolete" (file-name-directory file)) | 8527 | (if (string-match "obsolete" (file-name-directory file)) |
| 8528 | (insert "Obsolete ") | 8528 | (insert "Obsolete ") |
| @@ -8536,7 +8536,7 @@ it." | |||
| 8536 | ;; Old special syntax: a matching regexp | 8536 | ;; Old special syntax: a matching regexp |
| 8537 | ((setq special (idlwave-special-lib-test file)) | 8537 | ((setq special (idlwave-special-lib-test file)) |
| 8538 | (insert (format "%-10s" special))) | 8538 | (insert (format "%-10s" special))) |
| 8539 | 8539 | ||
| 8540 | ;; Catch-all with file | 8540 | ;; Catch-all with file |
| 8541 | ((idlwave-lib-p file) (insert "Library ")) | 8541 | ((idlwave-lib-p file) (insert "Library ")) |
| 8542 | 8542 | ||
| @@ -8551,7 +8551,7 @@ it." | |||
| 8551 | (if shell-flag "S" "-") | 8551 | (if shell-flag "S" "-") |
| 8552 | (if buffer-flag "B" "-") | 8552 | (if buffer-flag "B" "-") |
| 8553 | "] "))) | 8553 | "] "))) |
| 8554 | (when (> ndupl 1) | 8554 | (when (> ndupl 1) |
| 8555 | (setq beg (point)) | 8555 | (setq beg (point)) |
| 8556 | (insert (format "(%dx) " ndupl)) | 8556 | (insert (format "(%dx) " ndupl)) |
| 8557 | (add-text-properties beg (point) (list 'face 'bold))) | 8557 | (add-text-properties beg (point) (list 'face 'bold))) |
| @@ -8575,7 +8575,7 @@ Return the name of the special lib if there is a match." | |||
| 8575 | alist nil))) | 8575 | alist nil))) |
| 8576 | rtn) | 8576 | rtn) |
| 8577 | (t nil)))) | 8577 | (t nil)))) |
| 8578 | 8578 | ||
| 8579 | (defun idlwave-mouse-active-rinfo-right (ev) | 8579 | (defun idlwave-mouse-active-rinfo-right (ev) |
| 8580 | (interactive "e") | 8580 | (interactive "e") |
| 8581 | (idlwave-mouse-active-rinfo ev 'right)) | 8581 | (idlwave-mouse-active-rinfo ev 'right)) |
| @@ -8594,7 +8594,7 @@ Optional args RIGHT and SHIFT indicate, if mouse-3 was used, and if SHIFT | |||
| 8594 | was pressed." | 8594 | was pressed." |
| 8595 | (interactive "e") | 8595 | (interactive "e") |
| 8596 | (if ev (mouse-set-point ev)) | 8596 | (if ev (mouse-set-point ev)) |
| 8597 | (let (data id name type class buf bufwin source link keyword | 8597 | (let (data id name type class buf bufwin source link keyword |
| 8598 | word initial-class) | 8598 | word initial-class) |
| 8599 | (setq data (get-text-property (point) 'data) | 8599 | (setq data (get-text-property (point) 'data) |
| 8600 | source (get-text-property (point) 'source) | 8600 | source (get-text-property (point) 'source) |
| @@ -8609,9 +8609,9 @@ was pressed." | |||
| 8609 | 8609 | ||
| 8610 | (cond ((eq id 'class) ; Switch class being displayed | 8610 | (cond ((eq id 'class) ; Switch class being displayed |
| 8611 | (if (window-live-p bufwin) (select-window bufwin)) | 8611 | (if (window-live-p bufwin) (select-window bufwin)) |
| 8612 | (idlwave-display-calling-sequence | 8612 | (idlwave-display-calling-sequence |
| 8613 | (idlwave-sintern-method name) | 8613 | (idlwave-sintern-method name) |
| 8614 | type (idlwave-sintern-class word) | 8614 | type (idlwave-sintern-class word) |
| 8615 | initial-class)) | 8615 | initial-class)) |
| 8616 | ((eq id 'usage) ; Online help on this routine | 8616 | ((eq id 'usage) ; Online help on this routine |
| 8617 | (idlwave-online-help link name type class)) | 8617 | (idlwave-online-help link name type class)) |
| @@ -8652,9 +8652,9 @@ was pressed." | |||
| 8652 | (setq bwin (get-buffer-window buffer))) | 8652 | (setq bwin (get-buffer-window buffer))) |
| 8653 | (if (eq (preceding-char) ?/) | 8653 | (if (eq (preceding-char) ?/) |
| 8654 | (insert keyword) | 8654 | (insert keyword) |
| 8655 | (unless (save-excursion | 8655 | (unless (save-excursion |
| 8656 | (re-search-backward | 8656 | (re-search-backward |
| 8657 | "[(,][ \t]*\\(\\$[ \t]*\\(;.*\\)?\n\\)?[ \t]*\\=" | 8657 | "[(,][ \t]*\\(\\$[ \t]*\\(;.*\\)?\n\\)?[ \t]*\\=" |
| 8658 | (min (- (point) 100) (point-min)) t)) | 8658 | (min (- (point) 100) (point-min)) t)) |
| 8659 | (insert ", ")) | 8659 | (insert ", ")) |
| 8660 | (if shift (insert "/")) | 8660 | (if shift (insert "/")) |
| @@ -8706,7 +8706,7 @@ the load path in order to find a definition. The output of this | |||
| 8706 | command can be used to detect possible name clashes during this process." | 8706 | command can be used to detect possible name clashes during this process." |
| 8707 | (idlwave-routines) ; Make sure everything is loaded. | 8707 | (idlwave-routines) ; Make sure everything is loaded. |
| 8708 | (unless (or idlwave-user-catalog-routines idlwave-library-catalog-routines) | 8708 | (unless (or idlwave-user-catalog-routines idlwave-library-catalog-routines) |
| 8709 | (or (y-or-n-p | 8709 | (or (y-or-n-p |
| 8710 | "You don't have any user or library catalogs. Continue anyway? ") | 8710 | "You don't have any user or library catalogs. Continue anyway? ") |
| 8711 | (error "Abort"))) | 8711 | (error "Abort"))) |
| 8712 | (let* ((routines (append idlwave-system-routines | 8712 | (let* ((routines (append idlwave-system-routines |
| @@ -8719,7 +8719,7 @@ command can be used to detect possible name clashes during this process." | |||
| 8719 | (keymap (make-sparse-keymap)) | 8719 | (keymap (make-sparse-keymap)) |
| 8720 | (props (list 'mouse-face 'highlight | 8720 | (props (list 'mouse-face 'highlight |
| 8721 | km-prop keymap | 8721 | km-prop keymap |
| 8722 | 'help-echo "Mouse2: Find source")) | 8722 | 'help-echo "Mouse2: Find source")) |
| 8723 | (nroutines (length (or special-routines routines))) | 8723 | (nroutines (length (or special-routines routines))) |
| 8724 | (step (/ nroutines 100)) | 8724 | (step (/ nroutines 100)) |
| 8725 | (n 0) | 8725 | (n 0) |
| @@ -8742,13 +8742,13 @@ command can be used to detect possible name clashes during this process." | |||
| 8742 | (message "Sorting routines...done") | 8742 | (message "Sorting routines...done") |
| 8743 | 8743 | ||
| 8744 | (define-key keymap (if (featurep 'xemacs) [(button2)] [(mouse-2)]) | 8744 | (define-key keymap (if (featurep 'xemacs) [(button2)] [(mouse-2)]) |
| 8745 | (lambda (ev) | 8745 | (lambda (ev) |
| 8746 | (interactive "e") | 8746 | (interactive "e") |
| 8747 | (mouse-set-point ev) | 8747 | (mouse-set-point ev) |
| 8748 | (apply 'idlwave-do-find-module | 8748 | (apply 'idlwave-do-find-module |
| 8749 | (get-text-property (point) 'find-args)))) | 8749 | (get-text-property (point) 'find-args)))) |
| 8750 | (define-key keymap [(return)] | 8750 | (define-key keymap [(return)] |
| 8751 | (lambda () | 8751 | (lambda () |
| 8752 | (interactive) | 8752 | (interactive) |
| 8753 | (apply 'idlwave-do-find-module | 8753 | (apply 'idlwave-do-find-module |
| 8754 | (get-text-property (point) 'find-args)))) | 8754 | (get-text-property (point) 'find-args)))) |
| @@ -8774,13 +8774,13 @@ command can be used to detect possible name clashes during this process." | |||
| 8774 | (> (idlwave-count-memq 'buffer (nth 2 (car dtwins))) 1)) | 8774 | (> (idlwave-count-memq 'buffer (nth 2 (car dtwins))) 1)) |
| 8775 | (incf cnt) | 8775 | (incf cnt) |
| 8776 | (insert (format "\n%s%s" | 8776 | (insert (format "\n%s%s" |
| 8777 | (idlwave-make-full-name (nth 2 routine) | 8777 | (idlwave-make-full-name (nth 2 routine) |
| 8778 | (car routine)) | 8778 | (car routine)) |
| 8779 | (if (eq (nth 1 routine) 'fun) "()" ""))) | 8779 | (if (eq (nth 1 routine) 'fun) "()" ""))) |
| 8780 | (while (setq twin (pop dtwins)) | 8780 | (while (setq twin (pop dtwins)) |
| 8781 | (setq props1 (append (list 'find-args | 8781 | (setq props1 (append (list 'find-args |
| 8782 | (list (nth 0 routine) | 8782 | (list (nth 0 routine) |
| 8783 | (nth 1 routine) | 8783 | (nth 1 routine) |
| 8784 | (nth 2 routine))) | 8784 | (nth 2 routine))) |
| 8785 | props)) | 8785 | props)) |
| 8786 | (idlwave-insert-source-location "\n - " twin props1)))) | 8786 | (idlwave-insert-source-location "\n - " twin props1)))) |
| @@ -8803,7 +8803,7 @@ command can be used to detect possible name clashes during this process." | |||
| 8803 | (or (not (stringp sfile)) | 8803 | (or (not (stringp sfile)) |
| 8804 | (not (string-match "\\S-" sfile)))) | 8804 | (not (string-match "\\S-" sfile)))) |
| 8805 | (setq stype 'unresolved)) | 8805 | (setq stype 'unresolved)) |
| 8806 | (princ (format " %-10s %s\n" | 8806 | (princ (format " %-10s %s\n" |
| 8807 | stype | 8807 | stype |
| 8808 | (if sfile sfile "No source code available"))))) | 8808 | (if sfile sfile "No source code available"))))) |
| 8809 | 8809 | ||
| @@ -8822,20 +8822,20 @@ ENTRY will also be returned, as the first item of this list." | |||
| 8822 | (eq type (nth 1 candidate)) | 8822 | (eq type (nth 1 candidate)) |
| 8823 | (eq class (nth 2 candidate))) | 8823 | (eq class (nth 2 candidate))) |
| 8824 | (push candidate twins))) | 8824 | (push candidate twins))) |
| 8825 | (if (setq candidate (idlwave-rinfo-assq name type class | 8825 | (if (setq candidate (idlwave-rinfo-assq name type class |
| 8826 | idlwave-unresolved-routines)) | 8826 | idlwave-unresolved-routines)) |
| 8827 | (push candidate twins)) | 8827 | (push candidate twins)) |
| 8828 | (cons entry (nreverse twins)))) | 8828 | (cons entry (nreverse twins)))) |
| 8829 | 8829 | ||
| 8830 | (defun idlwave-study-twins (entries) | 8830 | (defun idlwave-study-twins (entries) |
| 8831 | "Return dangerous twins of first entry in ENTRIES. | 8831 | "Return dangerous twins of first entry in ENTRIES. |
| 8832 | Dangerous twins are routines with same name, but in different files on | 8832 | Dangerous twins are routines with same name, but in different files on |
| 8833 | the load path. If a file is in the system library and has an entry in | 8833 | the load path. If a file is in the system library and has an entry in |
| 8834 | the `idlwave-system-routines' list, we omit the latter as | 8834 | the `idlwave-system-routines' list, we omit the latter as |
| 8835 | non-dangerous because many IDL routines are implemented as library | 8835 | non-dangerous because many IDL routines are implemented as library |
| 8836 | routines, and may have been scanned." | 8836 | routines, and may have been scanned." |
| 8837 | (let* ((entry (car entries)) | 8837 | (let* ((entry (car entries)) |
| 8838 | (name (car entry)) ; | 8838 | (name (car entry)) ; |
| 8839 | (type (nth 1 entry)) ; Must be bound for | 8839 | (type (nth 1 entry)) ; Must be bound for |
| 8840 | (class (nth 2 entry)) ; idlwave-routine-twin-compare | 8840 | (class (nth 2 entry)) ; idlwave-routine-twin-compare |
| 8841 | (cnt 0) | 8841 | (cnt 0) |
| @@ -8853,23 +8853,23 @@ routines, and may have been scanned." | |||
| 8853 | (t 'unresolved))) | 8853 | (t 'unresolved))) |
| 8854 | 8854 | ||
| 8855 | ;; Check for an entry in the system library | 8855 | ;; Check for an entry in the system library |
| 8856 | (if (and file | 8856 | (if (and file |
| 8857 | (not syslibp) | 8857 | (not syslibp) |
| 8858 | (idlwave-syslib-p file)) | 8858 | (idlwave-syslib-p file)) |
| 8859 | (setq syslibp t)) | 8859 | (setq syslibp t)) |
| 8860 | 8860 | ||
| 8861 | ;; If there's more than one matching entry for the same file, just | 8861 | ;; If there's more than one matching entry for the same file, just |
| 8862 | ;; append the type-cons to the type list. | 8862 | ;; append the type-cons to the type list. |
| 8863 | (if (setq entry (assoc key alist)) | 8863 | (if (setq entry (assoc key alist)) |
| 8864 | (push type-cons (nth 2 entry)) | 8864 | (push type-cons (nth 2 entry)) |
| 8865 | (push (list key file (list type-cons)) alist))) | 8865 | (push (list key file (list type-cons)) alist))) |
| 8866 | 8866 | ||
| 8867 | (setq alist (nreverse alist)) | 8867 | (setq alist (nreverse alist)) |
| 8868 | 8868 | ||
| 8869 | (when syslibp | 8869 | (when syslibp |
| 8870 | ;; File is in system *library* - remove any 'system entry | 8870 | ;; File is in system *library* - remove any 'system entry |
| 8871 | (setq alist (delq (assq 'system alist) alist))) | 8871 | (setq alist (delq (assq 'system alist) alist))) |
| 8872 | 8872 | ||
| 8873 | ;; If 'system remains and we've scanned the syslib, it's a builtin | 8873 | ;; If 'system remains and we've scanned the syslib, it's a builtin |
| 8874 | ;; (rather than a !DIR/lib/.pro file bundled as source). | 8874 | ;; (rather than a !DIR/lib/.pro file bundled as source). |
| 8875 | (when (and (idlwave-syslib-scanned-p) | 8875 | (when (and (idlwave-syslib-scanned-p) |
| @@ -8905,7 +8905,7 @@ compares twins on the basis of their file names and path locations." | |||
| 8905 | ((not (eq type (nth 1 b))) | 8905 | ((not (eq type (nth 1 b))) |
| 8906 | ;; Type decides | 8906 | ;; Type decides |
| 8907 | (< (if (eq type 'fun) 1 0) (if (eq (nth 1 b) 'fun) 1 0))) | 8907 | (< (if (eq type 'fun) 1 0) (if (eq (nth 1 b) 'fun) 1 0))) |
| 8908 | (t | 8908 | (t |
| 8909 | ;; A and B are twins - so the decision is more complicated. | 8909 | ;; A and B are twins - so the decision is more complicated. |
| 8910 | ;; Call twin-compare with the proper arguments. | 8910 | ;; Call twin-compare with the proper arguments. |
| 8911 | (idlwave-routine-entry-compare-twins a b))))) | 8911 | (idlwave-routine-entry-compare-twins a b))))) |
| @@ -8957,7 +8957,7 @@ This expects NAME TYPE CLASS to be bound to the right values." | |||
| 8957 | (tpath-alist (idlwave-true-path-alist)) | 8957 | (tpath-alist (idlwave-true-path-alist)) |
| 8958 | (apathp (and (stringp akey) | 8958 | (apathp (and (stringp akey) |
| 8959 | (assoc (file-name-directory akey) tpath-alist))) | 8959 | (assoc (file-name-directory akey) tpath-alist))) |
| 8960 | (bpathp (and (stringp bkey) | 8960 | (bpathp (and (stringp bkey) |
| 8961 | (assoc (file-name-directory bkey) tpath-alist))) | 8961 | (assoc (file-name-directory bkey) tpath-alist))) |
| 8962 | ;; How early on search path? High number means early since we | 8962 | ;; How early on search path? High number means early since we |
| 8963 | ;; measure the tail of the path list | 8963 | ;; measure the tail of the path list |
| @@ -8993,7 +8993,7 @@ This expects NAME TYPE CLASS to be bound to the right values." | |||
| 8993 | (t nil)))) ; Default | 8993 | (t nil)))) ; Default |
| 8994 | 8994 | ||
| 8995 | (defun idlwave-routine-source-file (source) | 8995 | (defun idlwave-routine-source-file (source) |
| 8996 | (if (nth 2 source) | 8996 | (if (nth 2 source) |
| 8997 | (expand-file-name (nth 1 source) (nth 2 source)) | 8997 | (expand-file-name (nth 1 source) (nth 2 source)) |
| 8998 | (nth 1 source))) | 8998 | (nth 1 source))) |
| 8999 | 8999 | ||
| @@ -9083,7 +9083,7 @@ Assumes that point is at the beginning of the unit as found by | |||
| 9083 | (forward-sexp 2) | 9083 | (forward-sexp 2) |
| 9084 | (forward-sexp -1) | 9084 | (forward-sexp -1) |
| 9085 | (let ((begin (point))) | 9085 | (let ((begin (point))) |
| 9086 | (re-search-forward | 9086 | (re-search-forward |
| 9087 | "[a-zA-Z_][a-zA-Z0-9$_]+\\(::[a-zA-Z_][a-zA-Z0-9$_]+\\)?") | 9087 | "[a-zA-Z_][a-zA-Z0-9$_]+\\(::[a-zA-Z_][a-zA-Z0-9$_]+\\)?") |
| 9088 | (if (fboundp 'buffer-substring-no-properties) | 9088 | (if (fboundp 'buffer-substring-no-properties) |
| 9089 | (buffer-substring-no-properties begin (point)) | 9089 | (buffer-substring-no-properties begin (point)) |
| @@ -9123,7 +9123,7 @@ Assumes that point is at the beginning of the unit as found by | |||
| 9123 | (start-process "idldeclient" nil | 9123 | (start-process "idldeclient" nil |
| 9124 | idlwave-shell-explicit-file-name "-c" "-e" | 9124 | idlwave-shell-explicit-file-name "-c" "-e" |
| 9125 | (buffer-file-name))) | 9125 | (buffer-file-name))) |
| 9126 | 9126 | ||
| 9127 | (defvar idlwave-help-use-assistant) | 9127 | (defvar idlwave-help-use-assistant) |
| 9128 | (defun idlwave-launch-idlhelp () | 9128 | (defun idlwave-launch-idlhelp () |
| 9129 | "Start the IDLhelp application." | 9129 | "Start the IDLhelp application." |
| @@ -9131,7 +9131,7 @@ Assumes that point is at the beginning of the unit as found by | |||
| 9131 | (if idlwave-help-use-assistant | 9131 | (if idlwave-help-use-assistant |
| 9132 | (idlwave-help-assistant-raise) | 9132 | (idlwave-help-assistant-raise) |
| 9133 | (start-process "idlhelp" nil idlwave-help-application))) | 9133 | (start-process "idlhelp" nil idlwave-help-application))) |
| 9134 | 9134 | ||
| 9135 | ;; Menus - using easymenu.el | 9135 | ;; Menus - using easymenu.el |
| 9136 | (defvar idlwave-mode-menu-def | 9136 | (defvar idlwave-mode-menu-def |
| 9137 | `("IDLWAVE" | 9137 | `("IDLWAVE" |
| @@ -9150,7 +9150,7 @@ Assumes that point is at the beginning of the unit as found by | |||
| 9150 | ["Block" idlwave-mark-block t] | 9150 | ["Block" idlwave-mark-block t] |
| 9151 | ["Header" idlwave-mark-doclib t]) | 9151 | ["Header" idlwave-mark-doclib t]) |
| 9152 | ("Format" | 9152 | ("Format" |
| 9153 | ["Indent Entire Statement" idlwave-indent-statement | 9153 | ["Indent Entire Statement" idlwave-indent-statement |
| 9154 | :active t :keys "C-u \\[indent-for-tab-command]" ] | 9154 | :active t :keys "C-u \\[indent-for-tab-command]" ] |
| 9155 | ["Indent Subprogram" idlwave-indent-subprogram t] | 9155 | ["Indent Subprogram" idlwave-indent-subprogram t] |
| 9156 | ["(Un)Comment Region" idlwave-toggle-comment-region t] | 9156 | ["(Un)Comment Region" idlwave-toggle-comment-region t] |
| @@ -9220,7 +9220,7 @@ Assumes that point is at the beginning of the unit as found by | |||
| 9220 | ("Customize" | 9220 | ("Customize" |
| 9221 | ["Browse IDLWAVE Group" idlwave-customize t] | 9221 | ["Browse IDLWAVE Group" idlwave-customize t] |
| 9222 | "--" | 9222 | "--" |
| 9223 | ["Build Full Customize Menu" idlwave-create-customize-menu | 9223 | ["Build Full Customize Menu" idlwave-create-customize-menu |
| 9224 | (fboundp 'customize-menu-create)]) | 9224 | (fboundp 'customize-menu-create)]) |
| 9225 | ("Documentation" | 9225 | ("Documentation" |
| 9226 | ["Describe Mode" describe-mode t] | 9226 | ["Describe Mode" describe-mode t] |
| @@ -9237,22 +9237,22 @@ Assumes that point is at the beginning of the unit as found by | |||
| 9237 | '("Debug" | 9237 | '("Debug" |
| 9238 | ["Start IDL shell" idlwave-shell t] | 9238 | ["Start IDL shell" idlwave-shell t] |
| 9239 | ["Save and .RUN buffer" idlwave-shell-save-and-run | 9239 | ["Save and .RUN buffer" idlwave-shell-save-and-run |
| 9240 | (and (boundp 'idlwave-shell-automatic-start) | 9240 | (and (boundp 'idlwave-shell-automatic-start) |
| 9241 | idlwave-shell-automatic-start)])) | 9241 | idlwave-shell-automatic-start)])) |
| 9242 | 9242 | ||
| 9243 | (if (or (featurep 'easymenu) (load "easymenu" t)) | 9243 | (if (or (featurep 'easymenu) (load "easymenu" t)) |
| 9244 | (progn | 9244 | (progn |
| 9245 | (easy-menu-define idlwave-mode-menu idlwave-mode-map | 9245 | (easy-menu-define idlwave-mode-menu idlwave-mode-map |
| 9246 | "IDL and WAVE CL editing menu" | 9246 | "IDL and WAVE CL editing menu" |
| 9247 | idlwave-mode-menu-def) | 9247 | idlwave-mode-menu-def) |
| 9248 | (easy-menu-define idlwave-mode-debug-menu idlwave-mode-map | 9248 | (easy-menu-define idlwave-mode-debug-menu idlwave-mode-map |
| 9249 | "IDL and WAVE CL editing menu" | 9249 | "IDL and WAVE CL editing menu" |
| 9250 | idlwave-mode-debug-menu-def))) | 9250 | idlwave-mode-debug-menu-def))) |
| 9251 | 9251 | ||
| 9252 | (defun idlwave-customize () | 9252 | (defun idlwave-customize () |
| 9253 | "Call the customize function with idlwave as argument." | 9253 | "Call the customize function with idlwave as argument." |
| 9254 | (interactive) | 9254 | (interactive) |
| 9255 | ;; Try to load the code for the shell, so that we can customize it | 9255 | ;; Try to load the code for the shell, so that we can customize it |
| 9256 | ;; as well. | 9256 | ;; as well. |
| 9257 | (or (featurep 'idlw-shell) | 9257 | (or (featurep 'idlw-shell) |
| 9258 | (load "idlw-shell" t)) | 9258 | (load "idlw-shell" t)) |
| @@ -9263,11 +9263,11 @@ Assumes that point is at the beginning of the unit as found by | |||
| 9263 | (interactive) | 9263 | (interactive) |
| 9264 | (if (fboundp 'customize-menu-create) | 9264 | (if (fboundp 'customize-menu-create) |
| 9265 | (progn | 9265 | (progn |
| 9266 | ;; Try to load the code for the shell, so that we can customize it | 9266 | ;; Try to load the code for the shell, so that we can customize it |
| 9267 | ;; as well. | 9267 | ;; as well. |
| 9268 | (or (featurep 'idlw-shell) | 9268 | (or (featurep 'idlw-shell) |
| 9269 | (load "idlw-shell" t)) | 9269 | (load "idlw-shell" t)) |
| 9270 | (easy-menu-change | 9270 | (easy-menu-change |
| 9271 | '("IDLWAVE") "Customize" | 9271 | '("IDLWAVE") "Customize" |
| 9272 | `(["Browse IDLWAVE group" idlwave-customize t] | 9272 | `(["Browse IDLWAVE group" idlwave-customize t] |
| 9273 | "--" | 9273 | "--" |
| @@ -9315,7 +9315,7 @@ This function was written since `list-abbrevs' looks terrible for IDLWAVE mode." | |||
| 9315 | (let ((table (symbol-value 'idlwave-mode-abbrev-table)) | 9315 | (let ((table (symbol-value 'idlwave-mode-abbrev-table)) |
| 9316 | abbrevs | 9316 | abbrevs |
| 9317 | str rpl func fmt (len-str 0) (len-rpl 0)) | 9317 | str rpl func fmt (len-str 0) (len-rpl 0)) |
| 9318 | (mapatoms | 9318 | (mapatoms |
| 9319 | (lambda (sym) | 9319 | (lambda (sym) |
| 9320 | (if (symbol-value sym) | 9320 | (if (symbol-value sym) |
| 9321 | (progn | 9321 | (progn |
| @@ -9341,7 +9341,7 @@ This function was written since `list-abbrevs' looks terrible for IDLWAVE mode." | |||
| 9341 | (with-output-to-temp-buffer "*Help*" | 9341 | (with-output-to-temp-buffer "*Help*" |
| 9342 | (if arg | 9342 | (if arg |
| 9343 | (progn | 9343 | (progn |
| 9344 | (princ "Abbreviations and Actions in IDLWAVE-Mode\n") | 9344 | (princ "Abbreviations and Actions in IDLWAVE-Mode\n") |
| 9345 | (princ "=========================================\n\n") | 9345 | (princ "=========================================\n\n") |
| 9346 | (princ (format fmt "KEY" "REPLACE" "HOOK")) | 9346 | (princ (format fmt "KEY" "REPLACE" "HOOK")) |
| 9347 | (princ (format fmt "---" "-------" "----"))) | 9347 | (princ (format fmt "---" "-------" "----"))) |