diff options
| author | J.D. Smith | 2004-12-13 20:35:07 +0000 |
|---|---|---|
| committer | J.D. Smith | 2004-12-13 20:35:07 +0000 |
| commit | 25d24a50f6a396e433bf7bea97a2ac3a1620aefe (patch) | |
| tree | 614f843efeeab0c22d81ef3a901e3896f4fc0632 | |
| parent | d9c1ce9ddcd2492142cc3f9ace70a09505163938 (diff) | |
| download | emacs-25d24a50f6a396e433bf7bea97a2ac3a1620aefe.tar.gz emacs-25d24a50f6a396e433bf7bea97a2ac3a1620aefe.zip | |
Re-arrange variables to avoid compiler warnings. Change
assoc-ignore-case to assoc-string. Remove make-local-hook.
| -rw-r--r-- | lisp/progmodes/idlw-shell.el | 123 |
1 files changed, 64 insertions, 59 deletions
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index eaa6f3be4ea..787b9249ad7 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el | |||
| @@ -841,6 +841,8 @@ IDL has currently stepped.") | |||
| 841 | (defvar idlwave-shell-sources-query) | 841 | (defvar idlwave-shell-sources-query) |
| 842 | (defvar idlwave-shell-mode-map) | 842 | (defvar idlwave-shell-mode-map) |
| 843 | (defvar idlwave-shell-calling-stack-index) | 843 | (defvar idlwave-shell-calling-stack-index) |
| 844 | (defvar idlwave-shell-only-prompt-pattern nil) | ||
| 845 | (defvar tool-bar-map) | ||
| 844 | 846 | ||
| 845 | (defun idlwave-shell-mode () | 847 | (defun idlwave-shell-mode () |
| 846 | "Major mode for interacting with an inferior IDL process. | 848 | "Major mode for interacting with an inferior IDL process. |
| @@ -994,7 +996,7 @@ IDL has currently stepped.") | |||
| 994 | (setq idlwave-shell-hide-output nil) | 996 | (setq idlwave-shell-hide-output nil) |
| 995 | 997 | ||
| 996 | ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility | 998 | ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility |
| 997 | (make-local-hook 'kill-buffer-hook) | 999 | ;;(make-local-hook 'kill-buffer-hook) |
| 998 | (add-hook 'kill-buffer-hook 'idlwave-shell-kill-shell-buffer-confirm | 1000 | (add-hook 'kill-buffer-hook 'idlwave-shell-kill-shell-buffer-confirm |
| 999 | nil 'local) | 1001 | nil 'local) |
| 1000 | (add-hook 'kill-buffer-hook 'idlwave-shell-delete-temp-files nil 'local) | 1002 | (add-hook 'kill-buffer-hook 'idlwave-shell-delete-temp-files nil 'local) |
| @@ -1038,7 +1040,7 @@ IDL has currently stepped.") | |||
| 1038 | (setq abbrev-mode t) | 1040 | (setq abbrev-mode t) |
| 1039 | 1041 | ||
| 1040 | ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility | 1042 | ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility |
| 1041 | (make-local-hook 'post-command-hook) | 1043 | ;;(make-local-hook 'post-command-hook) |
| 1042 | (add-hook 'post-command-hook 'idlwave-command-hook nil t) | 1044 | (add-hook 'post-command-hook 'idlwave-command-hook nil t) |
| 1043 | 1045 | ||
| 1044 | ;; Read the command history? | 1046 | ;; Read the command history? |
| @@ -1458,7 +1460,6 @@ Otherwise just move the line. Move down unless UP is non-nil." | |||
| 1458 | "Return t if the shell process is running." | 1460 | "Return t if the shell process is running." |
| 1459 | (eq (process-status idlwave-shell-process-name) 'run)) | 1461 | (eq (process-status idlwave-shell-process-name) 'run)) |
| 1460 | 1462 | ||
| 1461 | (defvar idlwave-shell-only-prompt-pattern nil) | ||
| 1462 | (defun idlwave-shell-filter-hidden-output (output) | 1463 | (defun idlwave-shell-filter-hidden-output (output) |
| 1463 | "Filter hidden output, leaving the good stuff. | 1464 | "Filter hidden output, leaving the good stuff. |
| 1464 | 1465 | ||
| @@ -1475,6 +1476,7 @@ error messages, etc." | |||
| 1475 | 1476 | ||
| 1476 | (defvar idlwave-shell-hidden-output-buffer " *idlwave-shell-hidden-output*" | 1477 | (defvar idlwave-shell-hidden-output-buffer " *idlwave-shell-hidden-output*" |
| 1477 | "Buffer containing hidden output from IDL commands.") | 1478 | "Buffer containing hidden output from IDL commands.") |
| 1479 | (defvar idlwave-shell-current-state nil) | ||
| 1478 | 1480 | ||
| 1479 | (defun idlwave-shell-filter (proc string) | 1481 | (defun idlwave-shell-filter (proc string) |
| 1480 | "Watch for IDL prompt and filter incoming text. | 1482 | "Watch for IDL prompt and filter incoming text. |
| @@ -1627,7 +1629,55 @@ and then calls `idlwave-shell-send-command' for any pending commands." | |||
| 1627 | (run-hooks 'idlwave-shell-sentinel-hook)) | 1629 | (run-hooks 'idlwave-shell-sentinel-hook)) |
| 1628 | (run-hooks 'idlwave-shell-sentinel-hook)))) | 1630 | (run-hooks 'idlwave-shell-sentinel-hook)))) |
| 1629 | 1631 | ||
| 1630 | (defvar idlwave-shell-current-state nil) | 1632 | (defvar idlwave-shell-error-buffer " *idlwave-shell-errors*" |
| 1633 | "Buffer containing syntax errors from IDL compilations.") | ||
| 1634 | |||
| 1635 | ;; FIXME: the following two variables do not currently allow line breaks | ||
| 1636 | ;; in module and file names. I am not sure if it will be necessary to | ||
| 1637 | ;; change this. Currently it seems to work the way it is. | ||
| 1638 | (defvar idlwave-shell-syntax-error | ||
| 1639 | "^% Syntax error.\\s-*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" | ||
| 1640 | "A regular expression to match an IDL syntax error. | ||
| 1641 | The 1st pair matches the file name, the second pair matches the line | ||
| 1642 | number.") | ||
| 1643 | |||
| 1644 | (defvar idlwave-shell-other-error | ||
| 1645 | "^% .*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" | ||
| 1646 | "A regular expression to match any IDL error.") | ||
| 1647 | |||
| 1648 | (defvar idlwave-shell-halting-error | ||
| 1649 | "^% .*\n\\([^%].*\n\\)*% Execution halted at:\\(\\s-*\\S-+\\s-*[0-9]+\\s-*.*\\)\n" | ||
| 1650 | "A regular expression to match errors which halt execution.") | ||
| 1651 | |||
| 1652 | (defvar idlwave-shell-cant-continue-error | ||
| 1653 | "^% Can't continue from this point.\n" | ||
| 1654 | "A regular expression to match errors stepping errors.") | ||
| 1655 | |||
| 1656 | (defvar idlwave-shell-file-line-message | ||
| 1657 | (concat | ||
| 1658 | "\\(" ; program name group (1) | ||
| 1659 | "\\$MAIN\\$\\|" ; main level routine | ||
| 1660 | "\\<[a-zA-Z][a-zA-Z0-9_$:]*" ; start with a letter followed by [..] | ||
| 1661 | "\\([ \t]*\n[ \t]*[a-zA-Z0-9_$:]+\\)*"; continuation lines program name (2) | ||
| 1662 | "\\)" ; end program name group (1) | ||
| 1663 | "[ \t\n]+" ; white space | ||
| 1664 | "\\(" ; line number group (3) | ||
| 1665 | "[0-9]+" ; the line number (the fix point) | ||
| 1666 | "\\([ \t]*\n[ \t]*[0-9]+\\)*" ; continuation lines number (4) | ||
| 1667 | "\\)" ; end line number group (3) | ||
| 1668 | "[ \t\n]+" ; white space | ||
| 1669 | "\\(" ; file name group (5) | ||
| 1670 | "[^ \t\n]+" ; file names can contain any non-white | ||
| 1671 | "\\([ \t]*\n[ \t]*[^ \t\n]+\\)*" ; continuation lines file name (6) | ||
| 1672 | "\\)" ; end line number group (5) | ||
| 1673 | ) | ||
| 1674 | "*A regular expression to parse out the file name and line number. | ||
| 1675 | The 1st group should match the subroutine name. | ||
| 1676 | The 3rd group is the line number. | ||
| 1677 | The 5th group is the file name. | ||
| 1678 | All parts may contain linebreaks surrounded by spaces. This is important | ||
| 1679 | in IDL5 which inserts random linebreaks in long module and file names.") | ||
| 1680 | |||
| 1631 | (defun idlwave-shell-scan-for-state () | 1681 | (defun idlwave-shell-scan-for-state () |
| 1632 | "Scan for state info. Looks for messages in output from last IDL | 1682 | "Scan for state info. Looks for messages in output from last IDL |
| 1633 | command indicating where IDL has stopped. The types of messages we are | 1683 | command indicating where IDL has stopped. The types of messages we are |
| @@ -1721,55 +1771,6 @@ the above." | |||
| 1721 | ;; Otherwise, no particular state | 1771 | ;; Otherwise, no particular state |
| 1722 | (t (setq idlwave-shell-current-state nil))))) | 1772 | (t (setq idlwave-shell-current-state nil))))) |
| 1723 | 1773 | ||
| 1724 | (defvar idlwave-shell-error-buffer " *idlwave-shell-errors*" | ||
| 1725 | "Buffer containing syntax errors from IDL compilations.") | ||
| 1726 | |||
| 1727 | ;; FIXME: the following two variables do not currently allow line breaks | ||
| 1728 | ;; in module and file names. I am not sure if it will be necessary to | ||
| 1729 | ;; change this. Currently it seems to work the way it is. | ||
| 1730 | (defvar idlwave-shell-syntax-error | ||
| 1731 | "^% Syntax error.\\s-*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" | ||
| 1732 | "A regular expression to match an IDL syntax error. | ||
| 1733 | The 1st pair matches the file name, the second pair matches the line | ||
| 1734 | number.") | ||
| 1735 | |||
| 1736 | (defvar idlwave-shell-other-error | ||
| 1737 | "^% .*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" | ||
| 1738 | "A regular expression to match any IDL error.") | ||
| 1739 | |||
| 1740 | (defvar idlwave-shell-halting-error | ||
| 1741 | "^% .*\n\\([^%].*\n\\)*% Execution halted at:\\(\\s-*\\S-+\\s-*[0-9]+\\s-*.*\\)\n" | ||
| 1742 | "A regular expression to match errors which halt execution.") | ||
| 1743 | |||
| 1744 | (defvar idlwave-shell-cant-continue-error | ||
| 1745 | "^% Can't continue from this point.\n" | ||
| 1746 | "A regular expression to match errors stepping errors.") | ||
| 1747 | |||
| 1748 | (defvar idlwave-shell-file-line-message | ||
| 1749 | (concat | ||
| 1750 | "\\(" ; program name group (1) | ||
| 1751 | "\\$MAIN\\$\\|" ; main level routine | ||
| 1752 | "\\<[a-zA-Z][a-zA-Z0-9_$:]*" ; start with a letter followed by [..] | ||
| 1753 | "\\([ \t]*\n[ \t]*[a-zA-Z0-9_$:]+\\)*"; continuation lines program name (2) | ||
| 1754 | "\\)" ; end program name group (1) | ||
| 1755 | "[ \t\n]+" ; white space | ||
| 1756 | "\\(" ; line number group (3) | ||
| 1757 | "[0-9]+" ; the line number (the fix point) | ||
| 1758 | "\\([ \t]*\n[ \t]*[0-9]+\\)*" ; continuation lines number (4) | ||
| 1759 | "\\)" ; end line number group (3) | ||
| 1760 | "[ \t\n]+" ; white space | ||
| 1761 | "\\(" ; file name group (5) | ||
| 1762 | "[^ \t\n]+" ; file names can contain any non-white | ||
| 1763 | "\\([ \t]*\n[ \t]*[^ \t\n]+\\)*" ; continuation lines file name (6) | ||
| 1764 | "\\)" ; end line number group (5) | ||
| 1765 | ) | ||
| 1766 | "*A regular expression to parse out the file name and line number. | ||
| 1767 | The 1st group should match the subroutine name. | ||
| 1768 | The 3rd group is the line number. | ||
| 1769 | The 5th group is the file name. | ||
| 1770 | All parts may contain linebreaks surrounded by spaces. This is important | ||
| 1771 | in IDL5 which inserts random linebreaks in long module and file names.") | ||
| 1772 | |||
| 1773 | (defun idlwave-shell-parse-line (string &optional skip-main) | 1774 | (defun idlwave-shell-parse-line (string &optional skip-main) |
| 1774 | "Parse IDL message for the subroutine, file name and line number. | 1775 | "Parse IDL message for the subroutine, file name and line number. |
| 1775 | We need to work hard here to remove the stupid line breaks inserted by | 1776 | We need to work hard here to remove the stupid line breaks inserted by |
| @@ -2102,8 +2103,8 @@ Change the default directory for the process buffer to concur." | |||
| 2102 | 'hide 'wait) | 2103 | 'hide 'wait) |
| 2103 | ;; If we don't know anything about the class, update shell routines | 2104 | ;; If we don't know anything about the class, update shell routines |
| 2104 | (if (and idlwave-shell-get-object-class | 2105 | (if (and idlwave-shell-get-object-class |
| 2105 | (not (assoc-ignore-case idlwave-shell-get-object-class | 2106 | (not (assoc-string idlwave-shell-get-object-class |
| 2106 | (idlwave-class-alist)))) | 2107 | (idlwave-class-alist) t))) |
| 2107 | (idlwave-shell-maybe-update-routine-info)) | 2108 | (idlwave-shell-maybe-update-routine-info)) |
| 2108 | idlwave-shell-get-object-class))) | 2109 | idlwave-shell-get-object-class))) |
| 2109 | 2110 | ||
| @@ -2165,9 +2166,10 @@ keywords." | |||
| 2165 | (idlwave-complete arg))))) | 2166 | (idlwave-complete arg))))) |
| 2166 | 2167 | ||
| 2167 | ;; Get rid of opaque dynamic variable passing of link? | 2168 | ;; Get rid of opaque dynamic variable passing of link? |
| 2169 | (defvar link) ;dynamic variable | ||
| 2168 | (defun idlwave-shell-complete-execcomm-help (mode word) | 2170 | (defun idlwave-shell-complete-execcomm-help (mode word) |
| 2169 | (let ((word (or (nth 1 idlwave-completion-help-info) word)) | 2171 | (let ((word (or (nth 1 idlwave-completion-help-info) word)) |
| 2170 | (entry (assoc-ignore-case word idlwave-executive-commands-alist))) | 2172 | (entry (assoc-string word idlwave-executive-commands-alist t))) |
| 2171 | (cond | 2173 | (cond |
| 2172 | ((eq mode 'test) | 2174 | ((eq mode 'test) |
| 2173 | (and (stringp word) entry (cdr entry))) | 2175 | (and (stringp word) entry (cdr entry))) |
| @@ -3517,6 +3519,7 @@ considered the new breakpoint if the file name of frame matches." | |||
| 3517 | 3519 | ||
| 3518 | (defvar idlwave-shell-bp-overlays nil | 3520 | (defvar idlwave-shell-bp-overlays nil |
| 3519 | "Alist of overlays marking breakpoints") | 3521 | "Alist of overlays marking breakpoints") |
| 3522 | (defvar idlwave-shell-bp-glyph) | ||
| 3520 | 3523 | ||
| 3521 | (defun idlwave-shell-update-bp-overlays () | 3524 | (defun idlwave-shell-update-bp-overlays () |
| 3522 | "Update the overlays which mark breakpoints in the source code. | 3525 | "Update the overlays which mark breakpoints in the source code. |
| @@ -3605,7 +3608,6 @@ Existing overlays are recycled, in order to minimize consumption." | |||
| 3605 | (set-window-buffer win buf)))))))) | 3608 | (set-window-buffer win buf)))))))) |
| 3606 | 3609 | ||
| 3607 | 3610 | ||
| 3608 | (defvar idlwave-shell-bp-glyph) | ||
| 3609 | (defun idlwave-shell-make-new-bp-overlay (&optional type disabled help) | 3611 | (defun idlwave-shell-make-new-bp-overlay (&optional type disabled help) |
| 3610 | "Make a new overlay for highlighting breakpoints. | 3612 | "Make a new overlay for highlighting breakpoints. |
| 3611 | 3613 | ||
| @@ -4026,7 +4028,7 @@ Otherwise, just expand the file name." | |||
| 4026 | '(alt)))) | 4028 | '(alt)))) |
| 4027 | (shift (memq 'shift mod)) | 4029 | (shift (memq 'shift mod)) |
| 4028 | (mod-noshift (delete 'shift (copy-sequence mod))) | 4030 | (mod-noshift (delete 'shift (copy-sequence mod))) |
| 4029 | s k1 c2 k2 cmd cannotshift) | 4031 | s k1 c2 k2 cmd electric only-buffer cannotshift) |
| 4030 | (while (setq s (pop specs)) | 4032 | (while (setq s (pop specs)) |
| 4031 | (setq k1 (nth 0 s) | 4033 | (setq k1 (nth 0 s) |
| 4032 | c2 (nth 1 s) | 4034 | c2 (nth 1 s) |
| @@ -4089,6 +4091,10 @@ Otherwise, just expand the file name." | |||
| 4089 | (setq idlwave-shell-suppress-electric-debug nil)) | 4091 | (setq idlwave-shell-suppress-electric-debug nil)) |
| 4090 | (idlwave-shell-electric-debug-mode)) | 4092 | (idlwave-shell-electric-debug-mode)) |
| 4091 | 4093 | ||
| 4094 | (defvar idlwave-shell-electric-debug-mode) ; defined by easy-mmode | ||
| 4095 | (defvar idlwave-shell-electric-debug-read-only) | ||
| 4096 | (defvar idlwave-shell-electric-debug-buffers nil) | ||
| 4097 | |||
| 4092 | (easy-mmode-define-minor-mode idlwave-shell-electric-debug-mode | 4098 | (easy-mmode-define-minor-mode idlwave-shell-electric-debug-mode |
| 4093 | "Toggle Electric Debug mode. | 4099 | "Toggle Electric Debug mode. |
| 4094 | With no argument, this command toggles the mode. | 4100 | With no argument, this command toggles the mode. |
| @@ -4138,7 +4144,6 @@ idlwave-shell-electric-debug-mode-map) | |||
| 4138 | (force-mode-line-update)) | 4144 | (force-mode-line-update)) |
| 4139 | 4145 | ||
| 4140 | ;; Turn it off in all relevant buffers | 4146 | ;; Turn it off in all relevant buffers |
| 4141 | (defvar idlwave-shell-electric-debug-buffers nil) | ||
| 4142 | (defun idlwave-shell-electric-debug-all-off () | 4147 | (defun idlwave-shell-electric-debug-all-off () |
| 4143 | (setq idlwave-shell-suppress-electric-debug nil) | 4148 | (setq idlwave-shell-suppress-electric-debug nil) |
| 4144 | (let ((buffers idlwave-shell-electric-debug-buffers) | 4149 | (let ((buffers idlwave-shell-electric-debug-buffers) |