diff options
| author | Stefan Monnier | 2009-12-03 02:57:16 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-12-03 02:57:16 +0000 |
| commit | 8d2221483a384a61971b7742a73edfff4c230063 (patch) | |
| tree | 05dbe8b43eca2b59a5a87e6eaddc3bef5eafb141 | |
| parent | 3bb8691bce175b32e289beaa57bf0ed05f0ab0e4 (diff) | |
| download | emacs-8d2221483a384a61971b7742a73edfff4c230063.tar.gz emacs-8d2221483a384a61971b7742a73edfff4c230063.zip | |
Misc cleanup.
* progmodes/idlwave.el (idlwave-comment-hook): Simplify with `or'.
(idlwave-code-abbrev, idlwave-display-user-catalog-widget)
(idlwave-complete-class): Don't quote lambda.
(idlwave-find-symbol-syntax-table, idlwave-mode-syntax-table)
(idlwave-mode-map): Move initialization into declaration.
(idlwave-action-and-binding): Use backquotes.
(idlwave-in-quote, idlwave-reset-sintern, idlwave-complete-in-buffer):
Simplify.
(idlwave-is-pointer-dereference): Remove unused var `pos'.
(idlwave-xml-create-rinfo-list): Remove unused var `entry'.
(idlwave-convert-xml-clean-sysvar-aliases): Remove unused vars `new',
`parts', and `all-parts'.
(idlwave-xml-create-sysvar-alist): Remove unused var `fields'.
(idlwave-convert-xml-system-routine-info): Remove unused string
`version-string'.
(idlwave-display-user-catalog-widget): Use dolist.
(idlwave-scanning-lib): Declare dynamically-scoped var.
(idlwave-scan-library-catalogs): Remove unused var `flags'.
(completion-highlight-first-word-only): Declare to silence bytecomp.
(idlwave-popup-select): Tighten scope of `resp'.
(idlwave-find-struct-tag): Remove unused var `beg'.
(idlwave-after-load-rinfo-hook): Declare.
(idlwave-sintern-class-info): Remove unused var `taglist'.
(idlwave-find-class-definition): Remove unused var `list'.
(idlwave-complete-sysvar-tag-help): Remove unused var `main-base'.
(idlwave-what-module-find-class): Remove unused var `classes'.
| -rw-r--r-- | lisp/ChangeLog | 30 | ||||
| -rw-r--r-- | lisp/progmodes/idlwave.el | 467 |
2 files changed, 261 insertions, 236 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 99b30853b7b..8cc536e6fb5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,33 @@ | |||
| 1 | 2009-12-03 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | Misc cleanup. | ||
| 4 | * progmodes/idlwave.el (idlwave-comment-hook): Simplify with `or'. | ||
| 5 | (idlwave-code-abbrev, idlwave-display-user-catalog-widget) | ||
| 6 | (idlwave-complete-class): Don't quote lambda. | ||
| 7 | (idlwave-find-symbol-syntax-table, idlwave-mode-syntax-table) | ||
| 8 | (idlwave-mode-map): Move initialization into declaration. | ||
| 9 | (idlwave-action-and-binding): Use backquotes. | ||
| 10 | (idlwave-in-quote, idlwave-reset-sintern, idlwave-complete-in-buffer): | ||
| 11 | Simplify. | ||
| 12 | (idlwave-is-pointer-dereference): Remove unused var `pos'. | ||
| 13 | (idlwave-xml-create-rinfo-list): Remove unused var `entry'. | ||
| 14 | (idlwave-convert-xml-clean-sysvar-aliases): Remove unused vars `new', | ||
| 15 | `parts', and `all-parts'. | ||
| 16 | (idlwave-xml-create-sysvar-alist): Remove unused var `fields'. | ||
| 17 | (idlwave-convert-xml-system-routine-info): Remove unused string | ||
| 18 | `version-string'. | ||
| 19 | (idlwave-display-user-catalog-widget): Use dolist. | ||
| 20 | (idlwave-scanning-lib): Declare dynamically-scoped var. | ||
| 21 | (idlwave-scan-library-catalogs): Remove unused var `flags'. | ||
| 22 | (completion-highlight-first-word-only): Declare to silence bytecomp. | ||
| 23 | (idlwave-popup-select): Tighten scope of `resp'. | ||
| 24 | (idlwave-find-struct-tag): Remove unused var `beg'. | ||
| 25 | (idlwave-after-load-rinfo-hook): Declare. | ||
| 26 | (idlwave-sintern-class-info): Remove unused var `taglist'. | ||
| 27 | (idlwave-find-class-definition): Remove unused var `list'. | ||
| 28 | (idlwave-complete-sysvar-tag-help): Remove unused var `main-base'. | ||
| 29 | (idlwave-what-module-find-class): Remove unused var `classes'. | ||
| 30 | |||
| 1 | 2009-12-03 Juanma Barranquero <lekktu@gmail.com> | 31 | 2009-12-03 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 32 | ||
| 3 | * progmodes/pascal.el: Require CL when compiling (for lexical-let). | 33 | * progmodes/pascal.el: Require CL when compiling (for lexical-let). |
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 8e80bc552e8..83fb8fcdcd9 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el | |||
| @@ -1211,12 +1211,12 @@ As a user, you should not set this to t.") | |||
| 1211 | (1 font-lock-variable-name-face))) | 1211 | (1 font-lock-variable-name-face))) |
| 1212 | 1212 | ||
| 1213 | ;; Special and unusual operators (not used because too noisy) | 1213 | ;; Special and unusual operators (not used because too noisy) |
| 1214 | (special-operators | 1214 | ;; (special-operators |
| 1215 | '("[<>#]" (0 font-lock-keyword-face))) | 1215 | ;; '("[<>#]" (0 font-lock-keyword-face))) |
| 1216 | 1216 | ||
| 1217 | ;; All operators (not used because too noisy) | 1217 | ;; All operators (not used because too noisy) |
| 1218 | (all-operators | 1218 | ;; (all-operators |
| 1219 | '("[-*^#+<>/]" (0 font-lock-keyword-face))) | 1219 | ;; '("[-*^#+<>/]" (0 font-lock-keyword-face))) |
| 1220 | 1220 | ||
| 1221 | ;; Arrows with text property `idlwave-class' | 1221 | ;; Arrows with text property `idlwave-class' |
| 1222 | (class-arrows | 1222 | (class-arrows |
| @@ -1404,49 +1404,141 @@ Normally a space.") | |||
| 1404 | "Creates a function for abbrev hooks that ensures abbrevs are not quoted. | 1404 | "Creates a function for abbrev hooks that ensures abbrevs are not quoted. |
| 1405 | Specifically, if the abbrev is in a comment or string it is unexpanded. | 1405 | Specifically, if the abbrev is in a comment or string it is unexpanded. |
| 1406 | Otherwise ARGS forms a list that is evaluated." | 1406 | Otherwise ARGS forms a list that is evaluated." |
| 1407 | `(quote (lambda () | 1407 | ;; FIXME: it would probably be better to rely on the new :enable-function |
| 1408 | ,(prin1-to-string args) ;; Puts the code in the doc string | 1408 | ;; to enforce the "don't expand in comments or strings". |
| 1409 | (if (idlwave-quoted) | 1409 | `(lambda () |
| 1410 | (progn (unexpand-abbrev) nil) | 1410 | ,(prin1-to-string args) ;; Puts the code in the doc string |
| 1411 | ,(append args))))) | 1411 | (if (idlwave-quoted) |
| 1412 | (progn (unexpand-abbrev) nil) | ||
| 1413 | ,(append args)))) | ||
| 1414 | |||
| 1415 | (autoload 'idlwave-shell "idlw-shell" | ||
| 1416 | "Run an inferior IDL, with I/O through buffer `(idlwave-shell-buffer)'." t) | ||
| 1417 | (autoload 'idlwave-shell-send-command "idlw-shell") | ||
| 1418 | (autoload 'idlwave-shell-recenter-shell-window "idlw-shell" | ||
| 1419 | "Run `idlwave-shell' and switch back to current window" t) | ||
| 1420 | (autoload 'idlwave-shell-save-and-run "idlw-shell" | ||
| 1421 | "Save and run buffer under the shell." t) | ||
| 1422 | (autoload 'idlwave-shell-break-here "idlw-shell" | ||
| 1423 | "Set breakpoint in current line." t) | ||
| 1424 | (autoload 'idlwave-shell-run-region "idlw-shell" | ||
| 1425 | "Compile and run the region." t) | ||
| 1412 | 1426 | ||
| 1413 | (defvar idlwave-mode-map (make-sparse-keymap) | 1427 | (fset 'idlwave-debug-map (make-sparse-keymap)) |
| 1428 | |||
| 1429 | (defvar idlwave-mode-map | ||
| 1430 | (let ((map (make-sparse-keymap))) | ||
| 1431 | (define-key map "\C-c " 'idlwave-hard-tab) | ||
| 1432 | (define-key map [(control tab)] 'idlwave-hard-tab) | ||
| 1433 | ;;(define-key map "\C-c\C- " 'idlwave-hard-tab) | ||
| 1434 | (define-key map "'" 'idlwave-show-matching-quote) | ||
| 1435 | (define-key map "\"" 'idlwave-show-matching-quote) | ||
| 1436 | (define-key map "\C-g" 'idlwave-keyboard-quit) | ||
| 1437 | (define-key map "\C-c;" 'idlwave-toggle-comment-region) | ||
| 1438 | (define-key map "\C-\M-a" 'idlwave-beginning-of-subprogram) | ||
| 1439 | (define-key map "\C-\M-e" 'idlwave-end-of-subprogram) | ||
| 1440 | (define-key map "\C-c{" 'idlwave-beginning-of-block) | ||
| 1441 | (define-key map "\C-c}" 'idlwave-end-of-block) | ||
| 1442 | (define-key map "\C-c]" 'idlwave-close-block) | ||
| 1443 | (define-key map [(meta control h)] 'idlwave-mark-subprogram) | ||
| 1444 | (define-key map "\M-\C-n" 'idlwave-forward-block) | ||
| 1445 | (define-key map "\M-\C-p" 'idlwave-backward-block) | ||
| 1446 | (define-key map "\M-\C-d" 'idlwave-down-block) | ||
| 1447 | (define-key map "\M-\C-u" 'idlwave-backward-up-block) | ||
| 1448 | (define-key map "\M-\r" 'idlwave-split-line) | ||
| 1449 | (define-key map "\M-\C-q" 'idlwave-indent-subprogram) | ||
| 1450 | (define-key map "\C-c\C-p" 'idlwave-previous-statement) | ||
| 1451 | (define-key map "\C-c\C-n" 'idlwave-next-statement) | ||
| 1452 | ;; (define-key map "\r" 'idlwave-newline) | ||
| 1453 | ;; (define-key map "\t" 'idlwave-indent-line) | ||
| 1454 | (define-key map [(shift iso-lefttab)] 'idlwave-indent-statement) | ||
| 1455 | (define-key map "\C-c\C-a" 'idlwave-auto-fill-mode) | ||
| 1456 | (define-key map "\M-q" 'idlwave-fill-paragraph) | ||
| 1457 | (define-key map "\M-s" 'idlwave-edit-in-idlde) | ||
| 1458 | (define-key map "\C-c\C-h" 'idlwave-doc-header) | ||
| 1459 | (define-key map "\C-c\C-m" 'idlwave-doc-modification) | ||
| 1460 | (define-key map "\C-c\C-c" 'idlwave-case) | ||
| 1461 | (define-key map "\C-c\C-d" 'idlwave-debug-map) | ||
| 1462 | (when (and (listp idlwave-shell-debug-modifiers) | ||
| 1463 | (not (equal idlwave-shell-debug-modifiers '()))) | ||
| 1464 | ;; Bind the debug commands also with the special modifiers. | ||
| 1465 | (let ((shift (memq 'shift idlwave-shell-debug-modifiers)) | ||
| 1466 | (mods-noshift | ||
| 1467 | (delq 'shift (copy-sequence idlwave-shell-debug-modifiers)))) | ||
| 1468 | (define-key map | ||
| 1469 | (vector (append mods-noshift (list (if shift ?C ?c)))) | ||
| 1470 | 'idlwave-shell-save-and-run) | ||
| 1471 | (define-key map | ||
| 1472 | (vector (append mods-noshift (list (if shift ?B ?b)))) | ||
| 1473 | 'idlwave-shell-break-here) | ||
| 1474 | (define-key map | ||
| 1475 | (vector (append mods-noshift (list (if shift ?E ?e)))) | ||
| 1476 | 'idlwave-shell-run-region))) | ||
| 1477 | (define-key map "\C-c\C-d\C-c" 'idlwave-shell-save-and-run) | ||
| 1478 | (define-key map "\C-c\C-d\C-b" 'idlwave-shell-break-here) | ||
| 1479 | (define-key map "\C-c\C-d\C-e" 'idlwave-shell-run-region) | ||
| 1480 | (define-key map "\C-c\C-f" 'idlwave-for) | ||
| 1481 | ;; (define-key map "\C-c\C-f" 'idlwave-function) | ||
| 1482 | ;; (define-key map "\C-c\C-p" 'idlwave-procedure) | ||
| 1483 | (define-key map "\C-c\C-r" 'idlwave-repeat) | ||
| 1484 | (define-key map "\C-c\C-w" 'idlwave-while) | ||
| 1485 | (define-key map "\C-c\C-k" 'idlwave-kill-autoloaded-buffers) | ||
| 1486 | (define-key map "\C-c\C-s" 'idlwave-shell) | ||
| 1487 | (define-key map "\C-c\C-l" 'idlwave-shell-recenter-shell-window) | ||
| 1488 | (define-key map "\C-c\C-b" 'idlwave-list-buffer-load-path-shadows) | ||
| 1489 | (define-key map "\C-c\C-v" 'idlwave-find-module) | ||
| 1490 | (define-key map "\C-c\C-t" 'idlwave-find-module-this-file) | ||
| 1491 | (define-key map "\C-c?" 'idlwave-routine-info) | ||
| 1492 | (define-key map "\M-?" 'idlwave-context-help) | ||
| 1493 | (define-key map [(control meta ?\?)] | ||
| 1494 | 'idlwave-help-assistant-help-with-topic) | ||
| 1495 | ;; Pickup both forms of Esc/Meta binding | ||
| 1496 | (define-key map [(meta tab)] 'idlwave-complete) | ||
| 1497 | (define-key map [?\e?\t] 'idlwave-complete) | ||
| 1498 | (define-key map "\M-\C-i" 'idlwave-complete) | ||
| 1499 | (define-key map "\C-c\C-i" 'idlwave-update-routine-info) | ||
| 1500 | (define-key map "\C-c=" 'idlwave-resolve) | ||
| 1501 | (define-key map | ||
| 1502 | (if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)]) | ||
| 1503 | 'idlwave-mouse-context-help) | ||
| 1504 | map) | ||
| 1414 | "Keymap used in IDL mode.") | 1505 | "Keymap used in IDL mode.") |
| 1415 | 1506 | ||
| 1416 | (defvar idlwave-mode-syntax-table (make-syntax-table) | 1507 | (defvar idlwave-mode-syntax-table |
| 1508 | (let ((st (make-syntax-table))) | ||
| 1509 | (modify-syntax-entry ?+ "." st) | ||
| 1510 | (modify-syntax-entry ?- "." st) | ||
| 1511 | (modify-syntax-entry ?* "." st) | ||
| 1512 | (modify-syntax-entry ?/ "." st) | ||
| 1513 | (modify-syntax-entry ?^ "." st) | ||
| 1514 | (modify-syntax-entry ?# "." st) | ||
| 1515 | (modify-syntax-entry ?= "." st) | ||
| 1516 | (modify-syntax-entry ?% "." st) | ||
| 1517 | (modify-syntax-entry ?< "." st) | ||
| 1518 | (modify-syntax-entry ?> "." st) | ||
| 1519 | (modify-syntax-entry ?\' "\"" st) | ||
| 1520 | (modify-syntax-entry ?\" "\"" st) | ||
| 1521 | (modify-syntax-entry ?\\ "." st) | ||
| 1522 | (modify-syntax-entry ?_ "_" st) | ||
| 1523 | (modify-syntax-entry ?{ "(}" st) | ||
| 1524 | (modify-syntax-entry ?} "){" st) | ||
| 1525 | (modify-syntax-entry ?$ "_" st) | ||
| 1526 | (modify-syntax-entry ?. "." st) | ||
| 1527 | (modify-syntax-entry ?\; "<" st) | ||
| 1528 | (modify-syntax-entry ?\n ">" st) | ||
| 1529 | (modify-syntax-entry ?\f ">" st) | ||
| 1530 | st) | ||
| 1417 | "Syntax table in use in `idlwave-mode' buffers.") | 1531 | "Syntax table in use in `idlwave-mode' buffers.") |
| 1418 | 1532 | ||
| 1419 | (modify-syntax-entry ?+ "." idlwave-mode-syntax-table) | ||
| 1420 | (modify-syntax-entry ?- "." idlwave-mode-syntax-table) | ||
| 1421 | (modify-syntax-entry ?* "." idlwave-mode-syntax-table) | ||
| 1422 | (modify-syntax-entry ?/ "." idlwave-mode-syntax-table) | ||
| 1423 | (modify-syntax-entry ?^ "." idlwave-mode-syntax-table) | ||
| 1424 | (modify-syntax-entry ?# "." idlwave-mode-syntax-table) | ||
| 1425 | (modify-syntax-entry ?= "." idlwave-mode-syntax-table) | ||
| 1426 | (modify-syntax-entry ?% "." idlwave-mode-syntax-table) | ||
| 1427 | (modify-syntax-entry ?< "." idlwave-mode-syntax-table) | ||
| 1428 | (modify-syntax-entry ?> "." idlwave-mode-syntax-table) | ||
| 1429 | (modify-syntax-entry ?\' "\"" idlwave-mode-syntax-table) | ||
| 1430 | (modify-syntax-entry ?\" "\"" idlwave-mode-syntax-table) | ||
| 1431 | (modify-syntax-entry ?\\ "." idlwave-mode-syntax-table) | ||
| 1432 | (modify-syntax-entry ?_ "_" idlwave-mode-syntax-table) | ||
| 1433 | (modify-syntax-entry ?{ "(}" idlwave-mode-syntax-table) | ||
| 1434 | (modify-syntax-entry ?} "){" idlwave-mode-syntax-table) | ||
| 1435 | (modify-syntax-entry ?$ "_" idlwave-mode-syntax-table) | ||
| 1436 | (modify-syntax-entry ?. "." idlwave-mode-syntax-table) | ||
| 1437 | (modify-syntax-entry ?\; "<" idlwave-mode-syntax-table) | ||
| 1438 | (modify-syntax-entry ?\n ">" idlwave-mode-syntax-table) | ||
| 1439 | (modify-syntax-entry ?\f ">" idlwave-mode-syntax-table) | ||
| 1440 | |||
| 1441 | (defvar idlwave-find-symbol-syntax-table | 1533 | (defvar idlwave-find-symbol-syntax-table |
| 1442 | (copy-syntax-table idlwave-mode-syntax-table) | 1534 | (let ((st (copy-syntax-table idlwave-mode-syntax-table))) |
| 1535 | (modify-syntax-entry ?$ "w" st) | ||
| 1536 | (modify-syntax-entry ?_ "w" st) | ||
| 1537 | (modify-syntax-entry ?! "w" st) | ||
| 1538 | (modify-syntax-entry ?. "w" st) | ||
| 1539 | st) | ||
| 1443 | "Syntax table that treats symbol characters as word characters.") | 1540 | "Syntax table that treats symbol characters as word characters.") |
| 1444 | 1541 | ||
| 1445 | (modify-syntax-entry ?$ "w" idlwave-find-symbol-syntax-table) | ||
| 1446 | (modify-syntax-entry ?_ "w" idlwave-find-symbol-syntax-table) | ||
| 1447 | (modify-syntax-entry ?! "w" idlwave-find-symbol-syntax-table) | ||
| 1448 | (modify-syntax-entry ?. "w" idlwave-find-symbol-syntax-table) | ||
| 1449 | |||
| 1450 | (defmacro idlwave-with-special-syntax (&rest body) | 1542 | (defmacro idlwave-with-special-syntax (&rest body) |
| 1451 | "Execute BODY with a different syntax table." | 1543 | "Execute BODY with a different syntax table." |
| 1452 | `(let ((saved-syntax (syntax-table))) | 1544 | `(let ((saved-syntax (syntax-table))) |
| @@ -1506,100 +1598,10 @@ Capitalize system variables - action only | |||
| 1506 | (equal select 'noaction) | 1598 | (equal select 'noaction) |
| 1507 | (equal select 'both)) | 1599 | (equal select 'both)) |
| 1508 | (define-key idlwave-mode-map key | 1600 | (define-key idlwave-mode-map key |
| 1509 | (append '(lambda () | 1601 | `(lambda () |
| 1510 | (interactive) | 1602 | (interactive) |
| 1511 | (self-insert-command 1)) | 1603 | (self-insert-command 1) |
| 1512 | (list (if (listp cmd) | 1604 | ,@(if (listp cmd) cmd (list cmd)))))) |
| 1513 | cmd | ||
| 1514 | (list cmd))))))) | ||
| 1515 | |||
| 1516 | (fset 'idlwave-debug-map (make-sparse-keymap)) | ||
| 1517 | |||
| 1518 | (define-key idlwave-mode-map "\C-c " 'idlwave-hard-tab) | ||
| 1519 | (define-key idlwave-mode-map [(control tab)] 'idlwave-hard-tab) | ||
| 1520 | ;(define-key idlwave-mode-map "\C-c\C- " 'idlwave-hard-tab) | ||
| 1521 | (define-key idlwave-mode-map "'" 'idlwave-show-matching-quote) | ||
| 1522 | (define-key idlwave-mode-map "\"" 'idlwave-show-matching-quote) | ||
| 1523 | (define-key idlwave-mode-map "\C-g" 'idlwave-keyboard-quit) | ||
| 1524 | (define-key idlwave-mode-map "\C-c;" 'idlwave-toggle-comment-region) | ||
| 1525 | (define-key idlwave-mode-map "\C-\M-a" 'idlwave-beginning-of-subprogram) | ||
| 1526 | (define-key idlwave-mode-map "\C-\M-e" 'idlwave-end-of-subprogram) | ||
| 1527 | (define-key idlwave-mode-map "\C-c{" 'idlwave-beginning-of-block) | ||
| 1528 | (define-key idlwave-mode-map "\C-c}" 'idlwave-end-of-block) | ||
| 1529 | (define-key idlwave-mode-map "\C-c]" 'idlwave-close-block) | ||
| 1530 | (define-key idlwave-mode-map [(meta control h)] 'idlwave-mark-subprogram) | ||
| 1531 | (define-key idlwave-mode-map "\M-\C-n" 'idlwave-forward-block) | ||
| 1532 | (define-key idlwave-mode-map "\M-\C-p" 'idlwave-backward-block) | ||
| 1533 | (define-key idlwave-mode-map "\M-\C-d" 'idlwave-down-block) | ||
| 1534 | (define-key idlwave-mode-map "\M-\C-u" 'idlwave-backward-up-block) | ||
| 1535 | (define-key idlwave-mode-map "\M-\r" 'idlwave-split-line) | ||
| 1536 | (define-key idlwave-mode-map "\M-\C-q" 'idlwave-indent-subprogram) | ||
| 1537 | (define-key idlwave-mode-map "\C-c\C-p" 'idlwave-previous-statement) | ||
| 1538 | (define-key idlwave-mode-map "\C-c\C-n" 'idlwave-next-statement) | ||
| 1539 | ;; (define-key idlwave-mode-map "\r" 'idlwave-newline) | ||
| 1540 | ;; (define-key idlwave-mode-map "\t" 'idlwave-indent-line) | ||
| 1541 | (define-key idlwave-mode-map [(shift iso-lefttab)] 'idlwave-indent-statement) | ||
| 1542 | (define-key idlwave-mode-map "\C-c\C-a" 'idlwave-auto-fill-mode) | ||
| 1543 | (define-key idlwave-mode-map "\M-q" 'idlwave-fill-paragraph) | ||
| 1544 | (define-key idlwave-mode-map "\M-s" 'idlwave-edit-in-idlde) | ||
| 1545 | (define-key idlwave-mode-map "\C-c\C-h" 'idlwave-doc-header) | ||
| 1546 | (define-key idlwave-mode-map "\C-c\C-m" 'idlwave-doc-modification) | ||
| 1547 | (define-key idlwave-mode-map "\C-c\C-c" 'idlwave-case) | ||
| 1548 | (define-key idlwave-mode-map "\C-c\C-d" 'idlwave-debug-map) | ||
| 1549 | (when (and (boundp 'idlwave-shell-debug-modifiers) | ||
| 1550 | (listp idlwave-shell-debug-modifiers) | ||
| 1551 | (not (equal idlwave-shell-debug-modifiers '()))) | ||
| 1552 | ;; Bind the debug commands also with the special modifiers. | ||
| 1553 | (let ((shift (memq 'shift idlwave-shell-debug-modifiers)) | ||
| 1554 | (mods-noshift (delq 'shift | ||
| 1555 | (copy-sequence idlwave-shell-debug-modifiers)))) | ||
| 1556 | (define-key idlwave-mode-map | ||
| 1557 | (vector (append mods-noshift (list (if shift ?C ?c)))) | ||
| 1558 | 'idlwave-shell-save-and-run) | ||
| 1559 | (define-key idlwave-mode-map | ||
| 1560 | (vector (append mods-noshift (list (if shift ?B ?b)))) | ||
| 1561 | 'idlwave-shell-break-here) | ||
| 1562 | (define-key idlwave-mode-map | ||
| 1563 | (vector (append mods-noshift (list (if shift ?E ?e)))) | ||
| 1564 | 'idlwave-shell-run-region))) | ||
| 1565 | (define-key idlwave-mode-map "\C-c\C-d\C-c" 'idlwave-shell-save-and-run) | ||
| 1566 | (define-key idlwave-mode-map "\C-c\C-d\C-b" 'idlwave-shell-break-here) | ||
| 1567 | (define-key idlwave-mode-map "\C-c\C-d\C-e" 'idlwave-shell-run-region) | ||
| 1568 | (define-key idlwave-mode-map "\C-c\C-f" 'idlwave-for) | ||
| 1569 | ;; (define-key idlwave-mode-map "\C-c\C-f" 'idlwave-function) | ||
| 1570 | ;; (define-key idlwave-mode-map "\C-c\C-p" 'idlwave-procedure) | ||
| 1571 | (define-key idlwave-mode-map "\C-c\C-r" 'idlwave-repeat) | ||
| 1572 | (define-key idlwave-mode-map "\C-c\C-w" 'idlwave-while) | ||
| 1573 | (define-key idlwave-mode-map "\C-c\C-k" 'idlwave-kill-autoloaded-buffers) | ||
| 1574 | (define-key idlwave-mode-map "\C-c\C-s" 'idlwave-shell) | ||
| 1575 | (define-key idlwave-mode-map "\C-c\C-l" 'idlwave-shell-recenter-shell-window) | ||
| 1576 | (define-key idlwave-mode-map "\C-c\C-b" 'idlwave-list-buffer-load-path-shadows) | ||
| 1577 | (autoload 'idlwave-shell "idlw-shell" | ||
| 1578 | "Run an inferior IDL, with I/O through buffer `(idlwave-shell-buffer)'." t) | ||
| 1579 | (autoload 'idlwave-shell-send-command "idlw-shell") | ||
| 1580 | (autoload 'idlwave-shell-recenter-shell-window "idlw-shell" | ||
| 1581 | "Run `idlwave-shell' and switch back to current window" t) | ||
| 1582 | (autoload 'idlwave-shell-save-and-run "idlw-shell" | ||
| 1583 | "Save and run buffer under the shell." t) | ||
| 1584 | (autoload 'idlwave-shell-break-here "idlw-shell" | ||
| 1585 | "Set breakpoint in current line." t) | ||
| 1586 | (autoload 'idlwave-shell-run-region "idlw-shell" | ||
| 1587 | "Compile and run the region." t) | ||
| 1588 | (define-key idlwave-mode-map "\C-c\C-v" 'idlwave-find-module) | ||
| 1589 | (define-key idlwave-mode-map "\C-c\C-t" 'idlwave-find-module-this-file) | ||
| 1590 | (define-key idlwave-mode-map "\C-c?" 'idlwave-routine-info) | ||
| 1591 | (define-key idlwave-mode-map "\M-?" 'idlwave-context-help) | ||
| 1592 | (define-key idlwave-mode-map [(control meta ?\?)] | ||
| 1593 | 'idlwave-help-assistant-help-with-topic) | ||
| 1594 | ;; Pickup both forms of Esc/Meta binding | ||
| 1595 | (define-key idlwave-mode-map [(meta tab)] 'idlwave-complete) | ||
| 1596 | (define-key idlwave-mode-map [?\e?\t] 'idlwave-complete) | ||
| 1597 | (define-key idlwave-mode-map "\M-\C-i" 'idlwave-complete) | ||
| 1598 | (define-key idlwave-mode-map "\C-c\C-i" 'idlwave-update-routine-info) | ||
| 1599 | (define-key idlwave-mode-map "\C-c=" 'idlwave-resolve) | ||
| 1600 | (define-key idlwave-mode-map | ||
| 1601 | (if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)]) | ||
| 1602 | 'idlwave-mouse-context-help) | ||
| 1603 | 1605 | ||
| 1604 | ;; Set action and key bindings. | 1606 | ;; Set action and key bindings. |
| 1605 | ;; See description of the function `idlwave-action-and-binding'. | 1607 | ;; See description of the function `idlwave-action-and-binding'. |
| @@ -2345,9 +2347,7 @@ nil - do nothing. | |||
| 2345 | (defun idlwave-comment-hook () | 2347 | (defun idlwave-comment-hook () |
| 2346 | "Compute indent for the beginning of the IDL comment delimiter." | 2348 | "Compute indent for the beginning of the IDL comment delimiter." |
| 2347 | (if (or (looking-at idlwave-no-change-comment) | 2349 | (if (or (looking-at idlwave-no-change-comment) |
| 2348 | (if idlwave-begin-line-comment | 2350 | (looking-at (or idlwave-begin-line-comment "^;"))) |
| 2349 | (looking-at idlwave-begin-line-comment) | ||
| 2350 | (looking-at "^;"))) | ||
| 2351 | (current-column) | 2351 | (current-column) |
| 2352 | (if (looking-at idlwave-code-comment) | 2352 | (if (looking-at idlwave-code-comment) |
| 2353 | (if (save-excursion (skip-chars-backward " \t") (bolp)) | 2353 | (if (save-excursion (skip-chars-backward " \t") (bolp)) |
| @@ -3649,15 +3649,15 @@ location on mark ring so that the user can return to previous point." | |||
| 3649 | (error "No valid DOCLIB header")))) | 3649 | (error "No valid DOCLIB header")))) |
| 3650 | 3650 | ||
| 3651 | 3651 | ||
| 3652 | ;;; CJC 3/16/93 | 3652 | ;; CJC 3/16/93 |
| 3653 | ;;; Interface to expand-region-abbrevs which did not work when the | 3653 | ;; Interface to expand-region-abbrevs which did not work when the |
| 3654 | ;;; abbrev hook associated with an abbrev moves point backwards | 3654 | ;; abbrev hook associated with an abbrev moves point backwards |
| 3655 | ;;; after abbrev expansion, e.g., as with the abbrev '.n'. | 3655 | ;; after abbrev expansion, e.g., as with the abbrev '.n'. |
| 3656 | ;;; The original would enter an infinite loop in attempting to expand | 3656 | ;; The original would enter an infinite loop in attempting to expand |
| 3657 | ;;; .n (it would continually expand and unexpand the abbrev without expanding | 3657 | ;; .n (it would continually expand and unexpand the abbrev without expanding |
| 3658 | ;;; because the point would keep going back to the beginning of the | 3658 | ;; because the point would keep going back to the beginning of the |
| 3659 | ;;; abbrev instead of to the end of the abbrev). We now keep the | 3659 | ;; abbrev instead of to the end of the abbrev). We now keep the |
| 3660 | ;;; abbrev hook from moving backwards. | 3660 | ;; abbrev hook from moving backwards. |
| 3661 | ;;; | 3661 | ;;; |
| 3662 | (defun idlwave-expand-region-abbrevs (start end) | 3662 | (defun idlwave-expand-region-abbrevs (start end) |
| 3663 | "Expand each abbrev occurrence in the region. | 3663 | "Expand each abbrev occurrence in the region. |
| @@ -3680,10 +3680,10 @@ if point is in a IDL string constant, nil otherwise. | |||
| 3680 | Ignores comment delimiters on the current line. | 3680 | Ignores comment delimiters on the current line. |
| 3681 | Properly handles nested quotation marks and octal | 3681 | Properly handles nested quotation marks and octal |
| 3682 | constants - a double quote followed by an octal digit." | 3682 | constants - a double quote followed by an octal digit." |
| 3683 | ;;; Treat an octal inside an apostrophe to be a normal string. Treat a | 3683 | ;; Treat an octal inside an apostrophe to be a normal string. Treat a |
| 3684 | ;;; double quote followed by an octal digit to be an octal constant | 3684 | ;; double quote followed by an octal digit to be an octal constant |
| 3685 | ;;; rather than a string. Therefore, there is no terminating double | 3685 | ;; rather than a string. Therefore, there is no terminating double |
| 3686 | ;;; quote. | 3686 | ;; quote. |
| 3687 | (save-excursion | 3687 | (save-excursion |
| 3688 | ;; Because single and double quotes can quote each other we must | 3688 | ;; Because single and double quotes can quote each other we must |
| 3689 | ;; search for the string start from the beginning of line. | 3689 | ;; search for the string start from the beginning of line. |
| @@ -3718,9 +3718,7 @@ constants - a double quote followed by an octal digit." | |||
| 3718 | (while (looking-at delim) | 3718 | (while (looking-at delim) |
| 3719 | (forward-char 1) | 3719 | (forward-char 1) |
| 3720 | (setq found (search-forward delim eol 'lim))) | 3720 | (setq found (search-forward delim eol 'lim))) |
| 3721 | (if found | 3721 | (setq endq (if found (1- (point)) (point))) |
| 3722 | (setq endq (- (point) 1)) | ||
| 3723 | (setq endq (point))) | ||
| 3724 | )) | 3722 | )) |
| 3725 | (progn (setq bq (point)) (setq endq (point))))) | 3723 | (progn (setq bq (point)) (setq endq (point))))) |
| 3726 | (store-match-data data) | 3724 | (store-match-data data) |
| @@ -3729,14 +3727,13 @@ constants - a double quote followed by an octal digit." | |||
| 3729 | 3727 | ||
| 3730 | (defun idlwave-is-pointer-dereference (&optional limit) | 3728 | (defun idlwave-is-pointer-dereference (&optional limit) |
| 3731 | "Determine if the character after point is a pointer dereference *." | 3729 | "Determine if the character after point is a pointer dereference *." |
| 3732 | (let ((pos (point))) | 3730 | (and |
| 3733 | (and | 3731 | (eq (char-after) ?\*) |
| 3734 | (eq (char-after) ?\*) | 3732 | (not (idlwave-in-quote)) |
| 3735 | (not (idlwave-in-quote)) | 3733 | (save-excursion |
| 3736 | (save-excursion | 3734 | (forward-char) |
| 3737 | (forward-char) | 3735 | (re-search-backward (concat "\\(" idlwave-idl-keywords |
| 3738 | (re-search-backward (concat "\\(" idlwave-idl-keywords | 3736 | "\\|[[(*+-/=,^><]\\)\\s-*\\*") limit t)))) |
| 3739 | "\\|[[(*+-/=,^><]\\)\\s-*\\*") limit t))))) | ||
| 3740 | 3737 | ||
| 3741 | 3738 | ||
| 3742 | ;; Statement templates | 3739 | ;; Statement templates |
| @@ -4139,12 +4136,11 @@ blank lines." | |||
| 4139 | (defun idlwave-reset-sintern (&optional what) | 4136 | (defun idlwave-reset-sintern (&optional what) |
| 4140 | "Reset all sintern hashes." | 4137 | "Reset all sintern hashes." |
| 4141 | ;; Make sure the hash functions are accessible. | 4138 | ;; Make sure the hash functions are accessible. |
| 4142 | (if (or (not (fboundp 'gethash)) | 4139 | (unless (and (fboundp 'gethash) |
| 4143 | (not (fboundp 'puthash))) | 4140 | (fboundp 'puthash)) |
| 4144 | (progn | 4141 | (require 'cl) |
| 4145 | (require 'cl) | 4142 | (or (fboundp 'puthash) |
| 4146 | (or (fboundp 'puthash) | 4143 | (defalias 'puthash 'cl-puthash))) |
| 4147 | (defalias 'puthash 'cl-puthash)))) | ||
| 4148 | (let ((entries '((idlwave-sint-routines 1000 10) | 4144 | (let ((entries '((idlwave-sint-routines 1000 10) |
| 4149 | (idlwave-sint-keywords 1000 10) | 4145 | (idlwave-sint-keywords 1000 10) |
| 4150 | (idlwave-sint-methods 100 10) | 4146 | (idlwave-sint-methods 100 10) |
| @@ -4678,12 +4674,12 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4678 | methods-entry))) | 4674 | methods-entry))) |
| 4679 | (t))) | 4675 | (t))) |
| 4680 | (setq params (cdr params))) | 4676 | (setq params (cdr params))) |
| 4681 | ;(unless (get 'init-props 'matched) | 4677 | ;;(unless (get 'init-props 'matched) |
| 4682 | ; (message "Failed to match Init in class %s" class)) | 4678 | ;; (message "Failed to match Init in class %s" class)) |
| 4683 | ;(unless (get 'get-props 'matched) | 4679 | ;;(unless (get 'get-props 'matched) |
| 4684 | ; (message "Failed to match GetProperty in class %s" class)) | 4680 | ;; (message "Failed to match GetProperty in class %s" class)) |
| 4685 | ;(unless (get 'set-props 'matched) | 4681 | ;;(unless (get 'set-props 'matched) |
| 4686 | ; (message "Failed to match SetProperty in class %s" class)) | 4682 | ;; (message "Failed to match SetProperty in class %s" class)) |
| 4687 | (setq class-entry | 4683 | (setq class-entry |
| 4688 | (if inherits | 4684 | (if inherits |
| 4689 | (list class (append '(inherits) inherits) (list 'link link)) | 4685 | (list class (append '(inherits) inherits) (list 'link link)) |
| @@ -4701,7 +4697,7 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4701 | (params (cddr xml-entry)) | 4697 | (params (cddr xml-entry)) |
| 4702 | (syntax-vec (make-vector 3 nil)) ; procedure, function, exec command | 4698 | (syntax-vec (make-vector 3 nil)) ; procedure, function, exec command |
| 4703 | (case-fold-search t) | 4699 | (case-fold-search t) |
| 4704 | syntax kwd klink pref-list kwds pelem ptype entry props result type) | 4700 | syntax kwd klink pref-list kwds pelem ptype props result type) |
| 4705 | (if class ;; strip out class name from class method name string | 4701 | (if class ;; strip out class name from class method name string |
| 4706 | (if (string-match (concat class "::") name) | 4702 | (if (string-match (concat class "::") name) |
| 4707 | (setq name (substring name (match-end 0))))) | 4703 | (setq name (substring name (match-end 0))))) |
| @@ -4737,13 +4733,13 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4737 | (setq params (cdr params))) | 4733 | (setq params (cdr params))) |
| 4738 | 4734 | ||
| 4739 | ;; Debug | 4735 | ;; Debug |
| 4740 | ; (if (and (null (aref syntax-vec 0)) | 4736 | ;; (if (and (null (aref syntax-vec 0)) |
| 4741 | ; (null (aref syntax-vec 1)) | 4737 | ;; (null (aref syntax-vec 1)) |
| 4742 | ; (null (aref syntax-vec 2))) | 4738 | ;; (null (aref syntax-vec 2))) |
| 4743 | ; (with-current-buffer (get-buffer-create "IDL_XML_catalog_complaints") | 4739 | ;; (with-current-buffer (get-buffer-create "IDL_XML_catalog_complaints") |
| 4744 | ; (if class | 4740 | ;; (if class |
| 4745 | ; (insert (format "Missing SYNTAX entry for %s::%s\n" class name)) | 4741 | ;; (insert (format "Missing SYNTAX entry for %s::%s\n" class name)) |
| 4746 | ; (insert (message "Missing SYNTAX entry for %s\n" name))))) | 4742 | ;; (insert (message "Missing SYNTAX entry for %s\n" name))))) |
| 4747 | 4743 | ||
| 4748 | ;; Executive commands are treated specially | 4744 | ;; Executive commands are treated specially |
| 4749 | (if (aref syntax-vec 2) | 4745 | (if (aref syntax-vec 2) |
| @@ -4820,7 +4816,7 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4820 | (defun idlwave-convert-xml-clean-sysvar-aliases (aliases) | 4816 | (defun idlwave-convert-xml-clean-sysvar-aliases (aliases) |
| 4821 | ;; Duplicate and trim original routine aliases from rinfo list | 4817 | ;; Duplicate and trim original routine aliases from rinfo list |
| 4822 | ;; This if for, e.g. !X, !Y, !Z. | 4818 | ;; This if for, e.g. !X, !Y, !Z. |
| 4823 | (let (alias remove-list new parts all-parts) | 4819 | (let (alias remove-list) |
| 4824 | (loop for x in aliases do | 4820 | (loop for x in aliases do |
| 4825 | (when (setq alias (assoc (cdr x) idlwave-system-variables-alist)) | 4821 | (when (setq alias (assoc (cdr x) idlwave-system-variables-alist)) |
| 4826 | (unless (memq alias remove-list) (push alias remove-list)) | 4822 | (unless (memq alias remove-list) (push alias remove-list)) |
| @@ -4840,7 +4836,7 @@ Gets set in cached XML rinfo, or `idlw-rinfo.el'.") | |||
| 4840 | (link (cdr (assq 'link nameblock))) | 4836 | (link (cdr (assq 'link nameblock))) |
| 4841 | (params (cddr xml-entry)) | 4837 | (params (cddr xml-entry)) |
| 4842 | (case-fold-search t) | 4838 | (case-fold-search t) |
| 4843 | pelem ptype props fields tags) | 4839 | pelem ptype props tags) |
| 4844 | (while params | 4840 | (while params |
| 4845 | (setq pelem (car params)) | 4841 | (setq pelem (car params)) |
| 4846 | (when (listp pelem) | 4842 | (when (listp pelem) |
| @@ -4896,8 +4892,7 @@ Cache to disk for quick recovery." | |||
| 4896 | (catalog-file (expand-file-name "idl_catalog.xml" dir)) | 4892 | (catalog-file (expand-file-name "idl_catalog.xml" dir)) |
| 4897 | (elem-cnt 0) | 4893 | (elem-cnt 0) |
| 4898 | props rinfo msg-cnt elem type nelem class-result alias | 4894 | props rinfo msg-cnt elem type nelem class-result alias |
| 4899 | routines routine-aliases statement-aliases sysvar-aliases | 4895 | routines routine-aliases statement-aliases sysvar-aliases) |
| 4900 | version-string) | ||
| 4901 | (if (not (file-exists-p catalog-file)) | 4896 | (if (not (file-exists-p catalog-file)) |
| 4902 | (error "No such XML routine info file: %s" catalog-file) | 4897 | (error "No such XML routine info file: %s" catalog-file) |
| 4903 | (if (not (file-readable-p catalog-file)) | 4898 | (if (not (file-readable-p catalog-file)) |
| @@ -4909,8 +4904,7 @@ Cache to disk for quick recovery." | |||
| 4909 | (unless rinfo (error "Failed to parse XML routine info")) | 4904 | (unless rinfo (error "Failed to parse XML routine info")) |
| 4910 | ;;(setq rinfo (car rinfo)) ; Skip the catalog stuff. | 4905 | ;;(setq rinfo (car rinfo)) ; Skip the catalog stuff. |
| 4911 | 4906 | ||
| 4912 | (setq version-string (cdr (assq 'version (nth 1 rinfo))) | 4907 | (setq rinfo (cddr rinfo)) |
| 4913 | rinfo (cddr rinfo)) | ||
| 4914 | 4908 | ||
| 4915 | (setq nelem (length rinfo) | 4909 | (setq nelem (length rinfo) |
| 4916 | msg-cnt (/ nelem 20)) | 4910 | msg-cnt (/ nelem 20)) |
| @@ -5056,6 +5050,8 @@ Cache to disk for quick recovery." | |||
| 5056 | idlwave-init-rinfo-when-idle-after | 5050 | idlwave-init-rinfo-when-idle-after |
| 5057 | nil 'idlwave-load-rinfo-next-step)))))) | 5051 | nil 'idlwave-load-rinfo-next-step)))))) |
| 5058 | 5052 | ||
| 5053 | (defvar idlwave-after-load-rinfo-hook nil) | ||
| 5054 | |||
| 5059 | (defun idlwave-load-all-rinfo (&optional force) | 5055 | (defun idlwave-load-all-rinfo (&optional force) |
| 5060 | ;; Load and case-treat the system, user catalog, and library routine | 5056 | ;; Load and case-treat the system, user catalog, and library routine |
| 5061 | ;; info files. | 5057 | ;; info files. |
| @@ -5245,6 +5241,7 @@ Can run from `after-save-hook'." | |||
| 5245 | routine-list)) | 5241 | routine-list)) |
| 5246 | 5242 | ||
| 5247 | (defvar idlwave-scanning-lib-dir) | 5243 | (defvar idlwave-scanning-lib-dir) |
| 5244 | (defvar idlwave-scanning-lib) | ||
| 5248 | (defun idlwave-parse-definition (string) | 5245 | (defun idlwave-parse-definition (string) |
| 5249 | "Parse a module definition." | 5246 | "Parse a module definition." |
| 5250 | (let ((case-fold-search t) | 5247 | (let ((case-fold-search t) |
| @@ -5429,23 +5426,21 @@ directories and save the routine info. | |||
| 5429 | (widget-insert " ") | 5426 | (widget-insert " ") |
| 5430 | (widget-create 'push-button | 5427 | (widget-create 'push-button |
| 5431 | :notify | 5428 | :notify |
| 5432 | '(lambda (&rest ignore) | 5429 | (lambda (&rest ignore) |
| 5433 | (let ((path-list (widget-get idlwave-widget :path-dirs))) | 5430 | (let ((path-list (widget-get idlwave-widget :path-dirs))) |
| 5434 | (mapcar (lambda (x) | 5431 | (dolist (x path-list) |
| 5435 | (unless (memq 'lib (cdr x)) | 5432 | (unless (memq 'lib (cdr x)) |
| 5436 | (idlwave-path-alist-add-flag x 'user))) | 5433 | (idlwave-path-alist-add-flag x 'user))) |
| 5437 | path-list) | 5434 | (idlwave-display-user-catalog-widget path-list))) |
| 5438 | (idlwave-display-user-catalog-widget path-list))) | ||
| 5439 | "Select All Non-Lib") | 5435 | "Select All Non-Lib") |
| 5440 | (widget-insert " ") | 5436 | (widget-insert " ") |
| 5441 | (widget-create 'push-button | 5437 | (widget-create 'push-button |
| 5442 | :notify | 5438 | :notify |
| 5443 | '(lambda (&rest ignore) | 5439 | (lambda (&rest ignore) |
| 5444 | (let ((path-list (widget-get idlwave-widget :path-dirs))) | 5440 | (let ((path-list (widget-get idlwave-widget :path-dirs))) |
| 5445 | (mapcar (lambda (x) | 5441 | (dolist (x path-list) |
| 5446 | (idlwave-path-alist-remove-flag x 'user)) | 5442 | (idlwave-path-alist-remove-flag x 'user)) |
| 5447 | path-list) | 5443 | (idlwave-display-user-catalog-widget path-list))) |
| 5448 | (idlwave-display-user-catalog-widget path-list))) | ||
| 5449 | "Deselect All") | 5444 | "Deselect All") |
| 5450 | (widget-insert " ") | 5445 | (widget-insert " ") |
| 5451 | (widget-create 'push-button | 5446 | (widget-create 'push-button |
| @@ -5653,7 +5648,7 @@ be set to nil to disable library catalog scanning." | |||
| 5653 | (idlwave-expand-path idlwave-library-path) | 5648 | (idlwave-expand-path idlwave-library-path) |
| 5654 | (mapcar 'car idlwave-path-alist))) | 5649 | (mapcar 'car idlwave-path-alist))) |
| 5655 | (old-libname "") | 5650 | (old-libname "") |
| 5656 | dir-entry dir flags catalog all-routines) | 5651 | dir-entry dir catalog all-routines) |
| 5657 | (if message-base (message message-base)) | 5652 | (if message-base (message message-base)) |
| 5658 | (while (setq dir (pop dirs)) | 5653 | (while (setq dir (pop dirs)) |
| 5659 | (catch 'continue | 5654 | (catch 'continue |
| @@ -5866,6 +5861,10 @@ end | |||
| 5866 | (defvar idlwave-completion-help-links nil) | 5861 | (defvar idlwave-completion-help-links nil) |
| 5867 | (defvar idlwave-current-obj_new-class nil) | 5862 | (defvar idlwave-current-obj_new-class nil) |
| 5868 | (defvar idlwave-complete-special nil) | 5863 | (defvar idlwave-complete-special nil) |
| 5864 | (defvar method-selector) | ||
| 5865 | (defvar class-selector) | ||
| 5866 | (defvar type-selector) | ||
| 5867 | (defvar super-classes) | ||
| 5869 | 5868 | ||
| 5870 | (defun idlwave-complete (&optional arg module class) | 5869 | (defun idlwave-complete (&optional arg module class) |
| 5871 | "Complete a function, procedure or keyword name at point. | 5870 | "Complete a function, procedure or keyword name at point. |
| @@ -6451,10 +6450,6 @@ Must accept two arguments: `apos' and `info'.") | |||
| 6451 | ;; Default as fallback | 6450 | ;; Default as fallback |
| 6452 | (t class)))) | 6451 | (t class)))) |
| 6453 | 6452 | ||
| 6454 | (defvar type-selector) | ||
| 6455 | (defvar class-selector) | ||
| 6456 | (defvar method-selector) | ||
| 6457 | (defvar super-classes) | ||
| 6458 | (defun idlwave-selector (a) | 6453 | (defun idlwave-selector (a) |
| 6459 | (and (eq (nth 1 a) type-selector) | 6454 | (and (eq (nth 1 a) type-selector) |
| 6460 | (or (and (nth 2 a) (eq class-selector t)) | 6455 | (or (and (nth 2 a) (eq class-selector t)) |
| @@ -6703,6 +6698,7 @@ This function is not general, can only be used for completion stuff." | |||
| 6703 | "A form to evaluate after completion selection in *Completions* buffer.") | 6698 | "A form to evaluate after completion selection in *Completions* buffer.") |
| 6704 | (defconst idlwave-completion-mark (make-marker) | 6699 | (defconst idlwave-completion-mark (make-marker) |
| 6705 | "A mark pointing to the beginning of the completion string.") | 6700 | "A mark pointing to the beginning of the completion string.") |
| 6701 | (defvar completion-highlight-first-word-only) ;XEmacs. | ||
| 6706 | 6702 | ||
| 6707 | (defun idlwave-complete-in-buffer (type stype list selector prompt isa | 6703 | (defun idlwave-complete-in-buffer (type stype list selector prompt isa |
| 6708 | &optional prepare-display-function | 6704 | &optional prepare-display-function |
| @@ -6747,12 +6743,12 @@ accumulate information on matching completions." | |||
| 6747 | (not (eq t completion))) | 6743 | (not (eq t completion))) |
| 6748 | ;; We can add something | 6744 | ;; We can add something |
| 6749 | (delete-region beg end) | 6745 | (delete-region beg end) |
| 6750 | (if (and (string= part dpart) | 6746 | (insert (if (and (string= part dpart) |
| 6751 | (or (not (string= part "")) | 6747 | (or (not (string= part "")) |
| 6752 | idlwave-complete-empty-string-as-lower-case) | 6748 | idlwave-complete-empty-string-as-lower-case) |
| 6753 | (not idlwave-completion-force-default-case)) | 6749 | (not idlwave-completion-force-default-case)) |
| 6754 | (insert dcompletion) | 6750 | dcompletion |
| 6755 | (insert completion)) | 6751 | completion)) |
| 6756 | (if (eq t (try-completion completion list selector)) | 6752 | (if (eq t (try-completion completion list selector)) |
| 6757 | ;; Now this is a unique match | 6753 | ;; Now this is a unique match |
| 6758 | (idlwave-after-successful-completion type slash beg)) | 6754 | (idlwave-after-successful-completion type slash beg)) |
| @@ -6783,9 +6779,9 @@ accumulate information on matching completions." | |||
| 6783 | ;; "complete" means, this is already a valid completion | 6779 | ;; "complete" means, this is already a valid completion |
| 6784 | (complete (memq spart all-completions)) | 6780 | (complete (memq spart all-completions)) |
| 6785 | (completion-highlight-first-word-only t)) ; XEmacs | 6781 | (completion-highlight-first-word-only t)) ; XEmacs |
| 6786 | ; (completion-fixup-function ; Emacs | 6782 | ;; (completion-fixup-function ; Emacs |
| 6787 | ; (lambda () (and (eq (preceding-char) ?>) | 6783 | ;; (lambda () (and (eq (preceding-char) ?>) |
| 6788 | ; (re-search-backward " <" beg t))))) | 6784 | ;; (re-search-backward " <" beg t))))) |
| 6789 | 6785 | ||
| 6790 | (setq list (sort list (lambda (a b) | 6786 | (setq list (sort list (lambda (a b) |
| 6791 | (string< (downcase a) (downcase b))))) | 6787 | (string< (downcase a) (downcase b))))) |
| @@ -6824,14 +6820,14 @@ accumulate information on matching completions." | |||
| 6824 | (idlwave-complete-in-buffer | 6820 | (idlwave-complete-in-buffer |
| 6825 | 'class 'class (idlwave-class-alist) nil | 6821 | 'class 'class (idlwave-class-alist) nil |
| 6826 | "Select a class" "class" | 6822 | "Select a class" "class" |
| 6827 | '(lambda (list) ;; Push it to help-links if system help available | 6823 | (lambda (list) ;; Push it to help-links if system help available |
| 6828 | (mapcar (lambda (x) | 6824 | (mapcar (lambda (x) |
| 6829 | (let* ((entry (idlwave-class-info x)) | 6825 | (let* ((entry (idlwave-class-info x)) |
| 6830 | (link (nth 1 (assq 'link entry)))) | 6826 | (link (nth 1 (assq 'link entry)))) |
| 6831 | (if link (push (cons x link) | 6827 | (if link (push (cons x link) |
| 6832 | idlwave-completion-help-links)) | 6828 | idlwave-completion-help-links)) |
| 6833 | x)) | 6829 | x)) |
| 6834 | list))))) | 6830 | list))))) |
| 6835 | 6831 | ||
| 6836 | (defun idlwave-attach-classes (list type show-classes) | 6832 | (defun idlwave-attach-classes (list type show-classes) |
| 6837 | ;; Attach the proper class list to a LIST of completion items. | 6833 | ;; Attach the proper class list to a LIST of completion items. |
| @@ -6923,7 +6919,7 @@ accumulate information on matching completions." | |||
| 6923 | TITLE is the title to put atop the popup. If SORT is non-nil, | 6919 | TITLE is the title to put atop the popup. If SORT is non-nil, |
| 6924 | sort the list before displaying." | 6920 | sort the list before displaying." |
| 6925 | (let ((maxpopup idlwave-max-popup-menu-items) | 6921 | (let ((maxpopup idlwave-max-popup-menu-items) |
| 6926 | rtn menu resp) | 6922 | rtn menu) |
| 6927 | (cond ((null list)) | 6923 | (cond ((null list)) |
| 6928 | ((= 1 (length list)) | 6924 | ((= 1 (length list)) |
| 6929 | (setq rtn (car list))) | 6925 | (setq rtn (car list))) |
| @@ -6936,8 +6932,8 @@ sort the list before displaying." | |||
| 6936 | x))) | 6932 | x))) |
| 6937 | list))) | 6933 | list))) |
| 6938 | (setq menu (idlwave-split-menu-xemacs menu maxpopup)) | 6934 | (setq menu (idlwave-split-menu-xemacs menu maxpopup)) |
| 6939 | (setq resp (get-popup-menu-response menu)) | 6935 | (let ((resp (get-popup-menu-response menu))) |
| 6940 | (funcall (event-function resp) (event-object resp))) | 6936 | (funcall (event-function resp) (event-object resp)))) |
| 6941 | (t | 6937 | (t |
| 6942 | (if sort (setq list (sort list (lambda (a b) | 6938 | (if sort (setq list (sort list (lambda (a b) |
| 6943 | (string< (upcase a) (upcase b)))))) | 6939 | (string< (upcase a) (upcase b)))))) |
| @@ -7289,7 +7285,6 @@ Point is expected just before the opening `{' of the struct definition." | |||
| 7289 | (defun idlwave-find-struct-tag (tag) | 7285 | (defun idlwave-find-struct-tag (tag) |
| 7290 | "Find a given TAG in the structure defined at point." | 7286 | "Find a given TAG in the structure defined at point." |
| 7291 | (let* ((borders (idlwave-struct-borders)) | 7287 | (let* ((borders (idlwave-struct-borders)) |
| 7292 | (beg (car borders)) | ||
| 7293 | (end (cdr borders)) | 7288 | (end (cdr borders)) |
| 7294 | (case-fold-search t)) | 7289 | (case-fold-search t)) |
| 7295 | (re-search-forward (concat "\\(^[ \t]*\\|[,{][ \t]*\\)" tag "[ \t]*:") | 7290 | (re-search-forward (concat "\\(^[ \t]*\\|[,{][ \t]*\\)" tag "[ \t]*:") |
| @@ -7406,8 +7401,7 @@ we search only backward." | |||
| 7406 | 7401 | ||
| 7407 | (defun idlwave-sintern-class-info (entry) | 7402 | (defun idlwave-sintern-class-info (entry) |
| 7408 | "Sintern the class names in a class-info entry." | 7403 | "Sintern the class names in a class-info entry." |
| 7409 | (let ((taglist (assq 'tags entry)) | 7404 | (let ((inherits (assq 'inherits entry))) |
| 7410 | (inherits (assq 'inherits entry))) | ||
| 7411 | (setcar entry (idlwave-sintern-class (car entry) 'set)) | 7405 | (setcar entry (idlwave-sintern-class (car entry) 'set)) |
| 7412 | (if inherits | 7406 | (if inherits |
| 7413 | (setcdr inherits (mapcar (lambda (x) (idlwave-sintern-class x 'set)) | 7407 | (setcdr inherits (mapcar (lambda (x) (idlwave-sintern-class x 'set)) |
| @@ -7419,7 +7413,7 @@ If ALL-HOOK is set, find all named structure definitions in a given | |||
| 7419 | class__define routine, on which ALL-HOOK will be run. If ALT-CLASS is | 7413 | class__define routine, on which ALL-HOOK will be run. If ALT-CLASS is |
| 7420 | set, look for the name__define pro, and inside of it, for the ALT-CLASS | 7414 | set, look for the name__define pro, and inside of it, for the ALT-CLASS |
| 7421 | class/struct definition." | 7415 | class/struct definition." |
| 7422 | (let ((case-fold-search t) end-lim list name) | 7416 | (let ((case-fold-search t) end-lim name) |
| 7423 | (when (re-search-forward | 7417 | (when (re-search-forward |
| 7424 | (concat "^[ \t]*pro[ \t]+" (downcase class) "__define" "\\>") nil t) | 7418 | (concat "^[ \t]*pro[ \t]+" (downcase class) "__define" "\\>") nil t) |
| 7425 | (if all-hook | 7419 | (if all-hook |
| @@ -7610,6 +7604,7 @@ property indicating the link is added." | |||
| 7610 | (idlwave-sintern-routine | 7604 | (idlwave-sintern-routine |
| 7611 | (concat class-selector "__define")) | 7605 | (concat class-selector "__define")) |
| 7612 | nil)) | 7606 | nil)) |
| 7607 | ;; FIXME: idlwave-cpl-bold doesn't seem used anywhere. | ||
| 7613 | (let ((idlwave-cpl-bold idlwave-current-native-class-tags)) | 7608 | (let ((idlwave-cpl-bold idlwave-current-native-class-tags)) |
| 7614 | (idlwave-complete-in-buffer | 7609 | (idlwave-complete-in-buffer |
| 7615 | 'class-tag 'class-tag | 7610 | 'class-tag 'class-tag |
| @@ -7703,7 +7698,7 @@ property indicating the link is added." | |||
| 7703 | (entry (assoc var idlwave-system-variables-alist)) | 7698 | (entry (assoc var idlwave-system-variables-alist)) |
| 7704 | (tags (cdr (assq 'tags entry))) | 7699 | (tags (cdr (assq 'tags entry))) |
| 7705 | (main (nth 1 (assq 'link entry))) | 7700 | (main (nth 1 (assq 'link entry))) |
| 7706 | target main-base) | 7701 | target) |
| 7707 | (cond | 7702 | (cond |
| 7708 | ((eq mode 'test) ; we can at least link the main | 7703 | ((eq mode 'test) ; we can at least link the main |
| 7709 | (and (stringp word) entry main)) | 7704 | (and (stringp word) entry main)) |
| @@ -8161,8 +8156,7 @@ Used by `idlwave-routine-info' and `idlwave-find-module'." | |||
| 8161 | (defun idlwave-what-module-find-class () | 8156 | (defun idlwave-what-module-find-class () |
| 8162 | "Call `idlwave-what-module' and find the inherited class if necessary." | 8157 | "Call `idlwave-what-module' and find the inherited class if necessary." |
| 8163 | (let* ((module (idlwave-what-module)) | 8158 | (let* ((module (idlwave-what-module)) |
| 8164 | (class (nth 2 module)) | 8159 | (class (nth 2 module))) |
| 8165 | classes) | ||
| 8166 | (if (and (= (length module) 3) | 8160 | (if (and (= (length module) 3) |
| 8167 | (stringp class)) | 8161 | (stringp class)) |
| 8168 | (list (car module) | 8162 | (list (car module) |
| @@ -8689,6 +8683,9 @@ with this command." | |||
| 8689 | (interactive "P") | 8683 | (interactive "P") |
| 8690 | (idlwave-list-load-path-shadows nil nil "globally")) | 8684 | (idlwave-list-load-path-shadows nil nil "globally")) |
| 8691 | 8685 | ||
| 8686 | (defvar idlwave-sort-prefer-buffer-info t | ||
| 8687 | "Internal variable used to influence `idlwave-routine-twin-compare'.") | ||
| 8688 | |||
| 8692 | (defun idlwave-list-load-path-shadows (arg &optional special-routines loc) | 8689 | (defun idlwave-list-load-path-shadows (arg &optional special-routines loc) |
| 8693 | "List the routines which are defined multiple times. | 8690 | "List the routines which are defined multiple times. |
| 8694 | Search the information IDLWAVE has about IDL routines for multiple | 8691 | Search the information IDLWAVE has about IDL routines for multiple |
| @@ -8870,11 +8867,9 @@ routines, and may have been scanned." | |||
| 8870 | (setcar entry 'builtin)) | 8867 | (setcar entry 'builtin)) |
| 8871 | (sort alist 'idlwave-routine-twin-compare))) | 8868 | (sort alist 'idlwave-routine-twin-compare))) |
| 8872 | 8869 | ||
| 8873 | (defvar type) | 8870 | ;; FIXME: Dynamically scoped vars need to use the `idlwave-' prefix. |
| 8874 | (defvar class) | 8871 | ;; (defvar type) |
| 8875 | (defvar idlwave-sort-prefer-buffer-info t | 8872 | ;; (defvar class) |
| 8876 | "Internal variable used to influence `idlwave-routine-twin-compare'.") | ||
| 8877 | |||
| 8878 | (defmacro idlwave-xor (a b) | 8873 | (defmacro idlwave-xor (a b) |
| 8879 | `(and (or ,a ,b) | 8874 | `(and (or ,a ,b) |
| 8880 | (not (and ,a ,b)))) | 8875 | (not (and ,a ,b)))) |