aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorMiles Bader2005-08-26 09:51:52 +0000
committerMiles Bader2005-08-26 09:51:52 +0000
commitd4cccb140682cfa548a8658f905764ceb4a38cb2 (patch)
tree5230af18ee25b37efed50fa38cac1eefb47d03fc /lisp/progmodes
parent5e10f34207ff594cd6570928bc0292a7b53297b8 (diff)
parentf3f01d5df3156fb408b43da0c670796c37ed084f (diff)
downloademacs-d4cccb140682cfa548a8658f905764ceb4a38cb2.tar.gz
emacs-d4cccb140682cfa548a8658f905764ceb4a38cb2.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-78
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 514-518) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 104-105) - Update from CVS
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/ada-prj.el3
-rw-r--r--lisp/progmodes/cc-engine.el1
-rw-r--r--lisp/progmodes/compile.el98
-rw-r--r--lisp/progmodes/flymake.el4
-rw-r--r--lisp/progmodes/gdb-ui.el6
-rw-r--r--lisp/progmodes/grep.el35
-rw-r--r--lisp/progmodes/gud.el6
-rw-r--r--lisp/progmodes/idlw-help.el2
-rw-r--r--lisp/progmodes/idlw-rinfo.el6
-rw-r--r--lisp/progmodes/idlw-shell.el24
-rw-r--r--lisp/progmodes/idlw-toolbar.el3
-rw-r--r--lisp/progmodes/ld-script.el2
-rw-r--r--lisp/progmodes/sh-script.el86
-rw-r--r--lisp/progmodes/sql.el19
-rw-r--r--lisp/progmodes/vhdl-mode.el13
-rw-r--r--lisp/progmodes/which-func.el2
-rw-r--r--lisp/progmodes/xscheme.el292
17 files changed, 299 insertions, 303 deletions
diff --git a/lisp/progmodes/ada-prj.el b/lisp/progmodes/ada-prj.el
index d9bfb891ee3..91adf1ed187 100644
--- a/lisp/progmodes/ada-prj.el
+++ b/lisp/progmodes/ada-prj.el
@@ -477,7 +477,8 @@ connect to the target when working with cross-environments" t)
477 (widget-insert "\n\n") 477 (widget-insert "\n\n")
478 478
479 (widget-setup) 479 (widget-setup)
480 (beginning-of-buffer) 480 (with-no-warnings
481 (beginning-of-buffer))
481 ) 482 )
482 483
483 484
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index d9f0d088319..71dc39a56e9 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -5599,6 +5599,7 @@ brace."
5599 containing-sexp paren-state)) 5599 containing-sexp paren-state))
5600 ))) 5600 )))
5601 5601
5602;;;###autoload
5602(defun c-guess-basic-syntax () 5603(defun c-guess-basic-syntax ()
5603 "Return the syntactic context of the current line. 5604 "Return the syntactic context of the current line.
5604This function does not do any hidden buffer changes." 5605This function does not do any hidden buffer changes."
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index fa9eac2e021..dff4de60e45 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -377,13 +377,16 @@ you may also want to change `compilation-page-delimiter'.")
377 '(;; configure output lines. 377 '(;; configure output lines.
378 ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$" 378 ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$"
379 (1 font-lock-variable-name-face) 379 (1 font-lock-variable-name-face)
380 (2 font-lock-keyword-face)) 380 (2 (compilation-face '(4 . 3))))
381 ;; Command output lines. Recognize `make[n]:' lines too. 381 ;; Command output lines. Recognize `make[n]:' lines too.
382 ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" 382 ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"
383 (1 font-lock-function-name-face) (3 compilation-line-face nil t)) 383 (1 font-lock-function-name-face) (3 compilation-line-face nil t))
384 (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1) 384 (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1)
385 ("^Compilation finished" . font-lock-keyword-face) 385 ("^Compilation \\(finished\\)"
386 ("^Compilation exited abnormally" . font-lock-keyword-face)) 386 (1 compilation-info-face))
387 ("^Compilation \\(exited abnormally\\|interrupt\\|killed\\|terminated\\)\\(?:.*with code \\([0-9]+\\)\\)?"
388 (1 compilation-error-face)
389 (2 compilation-error-face nil t)))
387 "Additional things to highlight in Compilation mode. 390 "Additional things to highlight in Compilation mode.
388This gets tacked on the end of the generated expressions.") 391This gets tacked on the end of the generated expressions.")
389 392
@@ -443,6 +446,14 @@ You might also use mode hooks to specify it in certain modes, like this:
443 :type 'string 446 :type 'string
444 :group 'compilation) 447 :group 'compilation)
445 448
449(defcustom compilation-disable-input nil
450 "*If non-nil, send end-of-file as compilation process input.
451This only affects platforms that support asynchronous processes (see
452`start-process'); synchronous compilation processes never accept input."
453 :type 'boolean
454 :group 'compilation
455 :version "22.1")
456
446;; A weak per-compilation-buffer hash indexed by (FILENAME . DIRECTORY). Each 457;; A weak per-compilation-buffer hash indexed by (FILENAME . DIRECTORY). Each
447;; value is a FILE-STRUCTURE as described above, with the car eq to the hash 458;; value is a FILE-STRUCTURE as described above, with the car eq to the hash
448;; key. This holds the tree seen from root, for storing new nodes. 459;; key. This holds the tree seen from root, for storing new nodes.
@@ -468,6 +479,12 @@ starting the compilation process.")
468;; History of compile commands. 479;; History of compile commands.
469(defvar compile-history nil) 480(defvar compile-history nil)
470 481
482(defface compilation-error
483 '((t :inherit font-lock-warning-face))
484 "Face used to highlight compiler errors."
485 :group 'font-lock-highlighting-faces
486 :version "22.1")
487
471(defface compilation-warning 488(defface compilation-warning
472 '((((class color) (min-colors 16)) (:foreground "Orange" :weight bold)) 489 '((((class color) (min-colors 16)) (:foreground "Orange" :weight bold))
473 (((class color)) (:foreground "cyan" :weight bold)) 490 (((class color)) (:foreground "cyan" :weight bold))
@@ -475,8 +492,6 @@ starting the compilation process.")
475 "Face used to highlight compiler warnings." 492 "Face used to highlight compiler warnings."
476 :group 'font-lock-highlighting-faces 493 :group 'font-lock-highlighting-faces
477 :version "22.1") 494 :version "22.1")
478;; backward-compatibility alias
479(put 'compilation-warning-face 'face-alias 'compilation-warning)
480 495
481(defface compilation-info 496(defface compilation-info
482 '((((class color) (min-colors 16) (background light)) 497 '((((class color) (min-colors 16) (background light))
@@ -487,74 +502,49 @@ starting the compilation process.")
487 (:foreground "Green" :weight bold)) 502 (:foreground "Green" :weight bold))
488 (((class color)) (:foreground "green" :weight bold)) 503 (((class color)) (:foreground "green" :weight bold))
489 (t (:weight bold))) 504 (t (:weight bold)))
490 "Face used to highlight compiler warnings." 505 "Face used to highlight compiler information."
491 :group 'font-lock-highlighting-faces
492 :version "22.1")
493;; backward-compatibility alias
494(put 'compilation-info-face 'face-alias 'compilation-info)
495
496(defface compilation-error-file-name
497 '((default :inherit font-lock-warning-face)
498 (((supports :underline t)) :underline t))
499 "Face for displaying file names in compilation errors."
500 :group 'font-lock-highlighting-faces
501 :version "22.1")
502
503(defface compilation-warning-file-name
504 '((default :inherit font-lock-warning-face)
505 (((supports :underline t)) :underline t))
506 "Face for displaying file names in compilation errors."
507 :group 'font-lock-highlighting-faces
508 :version "22.1")
509
510(defface compilation-info-file-name
511 '((default :inherit compilation-info)
512 (((supports :underline t)) :underline t))
513 "Face for displaying file names in compilation errors."
514 :group 'font-lock-highlighting-faces 506 :group 'font-lock-highlighting-faces
515 :version "22.1") 507 :version "22.1")
516 508
517(defface compilation-line-number 509(defface compilation-line-number
518 '((default :inherit font-lock-variable-name-face) 510 '((t :inherit font-lock-variable-name-face))
519 (((supports :underline t)) :underline t)) 511 "Face for displaying line numbers in compiler messages."
520 "Face for displaying file names in compilation errors."
521 :group 'font-lock-highlighting-faces 512 :group 'font-lock-highlighting-faces
522 :version "22.1") 513 :version "22.1")
523 514
524(defface compilation-column-number 515(defface compilation-column-number
525 '((default :inherit font-lock-type-face) 516 '((t :inherit font-lock-type-face))
526 (((supports :underline t)) :underline t)) 517 "Face for displaying column numbers in compiler messages."
527 "Face for displaying file names in compilation errors."
528 :group 'font-lock-highlighting-faces 518 :group 'font-lock-highlighting-faces
529 :version "22.1") 519 :version "22.1")
530 520
531(defvar compilation-message-face nil 521(defvar compilation-message-face 'underline
532 "Face name to use for whole messages. 522 "Face name to use for whole messages.
533Faces `compilation-error-face', `compilation-warning-face', 523Faces `compilation-error-face', `compilation-warning-face',
534`compilation-info-face', `compilation-line-face' and 524`compilation-info-face', `compilation-line-face' and
535`compilation-column-face' get prepended to this, when applicable.") 525`compilation-column-face' get prepended to this, when applicable.")
536 526
537(defvar compilation-error-face 'compilation-error-file-name 527(defvar compilation-error-face 'compilation-error
538 "Face name to use for file name in error messages.") 528 "Face name to use for file name in error messages.")
539 529
540(defvar compilation-warning-face 'compilation-warning-file-name 530(defvar compilation-warning-face 'compilation-warning
541 "Face name to use for file name in warning messages.") 531 "Face name to use for file name in warning messages.")
542 532
543(defvar compilation-info-face 'compilation-info-file-name 533(defvar compilation-info-face 'compilation-info
544 "Face name to use for file name in informational messages.") 534 "Face name to use for file name in informational messages.")
545 535
546(defvar compilation-line-face 'compilation-line-number 536(defvar compilation-line-face 'compilation-line-number
547 "Face name to use for line number in message.") 537 "Face name to use for line numbers in compiler messages.")
548 538
549(defvar compilation-column-face 'compilation-column-number 539(defvar compilation-column-face 'compilation-column-number
550 "Face name to use for column number in message.") 540 "Face name to use for column numbers in compiler messages.")
551 541
552;; same faces as dired uses 542;; same faces as dired uses
553(defvar compilation-enter-directory-face 'font-lock-function-name-face 543(defvar compilation-enter-directory-face 'font-lock-function-name-face
554 "Face name to use for column number in message.") 544 "Face name to use for entering directory messages.")
555 545
556(defvar compilation-leave-directory-face 'font-lock-type-face 546(defvar compilation-leave-directory-face 'font-lock-type-face
557 "Face name to use for column number in message.") 547 "Face name to use for leaving directory messages.")
558 548
559 549
560 550
@@ -987,7 +977,11 @@ Returns the compilation buffer created."
987 ;; Output a mode setter, for saving and later reloading this buffer. 977 ;; Output a mode setter, for saving and later reloading this buffer.
988 (insert "-*- mode: " name-of-mode 978 (insert "-*- mode: " name-of-mode
989 "; default-directory: " (prin1-to-string default-directory) 979 "; default-directory: " (prin1-to-string default-directory)
990 " -*-\n" command "\n") 980 " -*-\n"
981 (format "%s started at %s\n\n"
982 mode-name
983 (substring (current-time-string) 0 19))
984 command "\n")
991 (setq thisdir default-directory)) 985 (setq thisdir default-directory))
992 (set-buffer-modified-p nil)) 986 (set-buffer-modified-p nil))
993 ;; If we're already in the compilation buffer, go to the end 987 ;; If we're already in the compilation buffer, go to the end
@@ -1036,6 +1030,8 @@ Returns the compilation buffer created."
1036 outbuf command)))) 1030 outbuf command))))
1037 ;; Make the buffer's mode line show process state. 1031 ;; Make the buffer's mode line show process state.
1038 (setq mode-line-process '(":%s")) 1032 (setq mode-line-process '(":%s"))
1033 (when compilation-disable-input
1034 (process-send-eof proc))
1039 (set-process-sentinel proc 'compilation-sentinel) 1035 (set-process-sentinel proc 'compilation-sentinel)
1040 (set-process-filter proc 'compilation-filter) 1036 (set-process-filter proc 'compilation-filter)
1041 (set-marker (process-mark proc) (point) outbuf) 1037 (set-marker (process-mark proc) (point) outbuf)
@@ -1173,7 +1169,7 @@ exited abnormally with code %d\n"
1173 (define-key map [menu-bar compilation compilation-separator2] 1169 (define-key map [menu-bar compilation compilation-separator2]
1174 '("----" . nil)) 1170 '("----" . nil))
1175 (define-key map [menu-bar compilation compilation-grep] 1171 (define-key map [menu-bar compilation compilation-grep]
1176 '("Search Files (grep)" . grep)) 1172 '("Search Files (grep)..." . grep))
1177 (define-key map [menu-bar compilation compilation-recompile] 1173 (define-key map [menu-bar compilation compilation-recompile]
1178 '("Recompile" . recompile)) 1174 '("Recompile" . recompile))
1179 (define-key map [menu-bar compilation compilation-compile] 1175 (define-key map [menu-bar compilation compilation-compile]
@@ -1232,9 +1228,9 @@ Runs `compilation-mode-hook' with `run-mode-hooks' (which see).
1232(defmacro define-compilation-mode (mode name doc &rest body) 1228(defmacro define-compilation-mode (mode name doc &rest body)
1233 "This is like `define-derived-mode' without the PARENT argument. 1229 "This is like `define-derived-mode' without the PARENT argument.
1234The parent is always `compilation-mode' and the customizable `compilation-...' 1230The parent is always `compilation-mode' and the customizable `compilation-...'
1235variables are also set from the name of the mode you have chosen, by replacing 1231variables are also set from the name of the mode you have chosen,
1236the fist word, e.g `compilation-scroll-output' from `grep-scroll-output' if that 1232by replacing the first word, e.g `compilation-scroll-output' from
1237variable exists." 1233`grep-scroll-output' if that variable exists."
1238 (let ((mode-name (replace-regexp-in-string "-mode\\'" "" (symbol-name mode)))) 1234 (let ((mode-name (replace-regexp-in-string "-mode\\'" "" (symbol-name mode))))
1239 `(define-derived-mode ,mode compilation-mode ,name 1235 `(define-derived-mode ,mode compilation-mode ,name
1240 ,doc 1236 ,doc
@@ -1513,7 +1509,7 @@ Prefix arg N says how many files to move backwards (or forwards, if negative)."
1513 (let ((buffer (compilation-find-buffer))) 1509 (let ((buffer (compilation-find-buffer)))
1514 (if (get-buffer-process buffer) 1510 (if (get-buffer-process buffer)
1515 (interrupt-process (get-buffer-process buffer)) 1511 (interrupt-process (get-buffer-process buffer))
1516 (error "The compilation process is not running")))) 1512 (error "The %s process is not running" (downcase mode-name)))))
1517 1513
1518(defalias 'compile-mouse-goto-error 'compile-goto-error) 1514(defalias 'compile-mouse-goto-error 'compile-goto-error)
1519 1515
@@ -1758,8 +1754,8 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
1758 marker) 1754 marker)
1759 (let ((name (expand-file-name 1755 (let ((name (expand-file-name
1760 (read-file-name 1756 (read-file-name
1761 (format "Find this error in: (default %s) " 1757 (format "Find this %s in: (default %s) "
1762 filename) 1758 compilation-error filename)
1763 dir filename t)))) 1759 dir filename t))))
1764 (if (file-directory-p name) 1760 (if (file-directory-p name)
1765 (setq name (expand-file-name filename name))) 1761 (setq name (expand-file-name filename name)))
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index a698ee6322f..8854d57915c 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -858,16 +858,12 @@ Return t if it has at least one flymake overlay, nil if no overlay."
858 (t (:bold t))) 858 (t (:bold t)))
859 "Face used for marking error lines." 859 "Face used for marking error lines."
860 :group 'flymake) 860 :group 'flymake)
861;; backward-compatibility alias
862(put 'flymake-errline-face 'face-alias 'flymake-errline)
863 861
864(defface flymake-warnline 862(defface flymake-warnline
865 '((((class color)) (:background "LightBlue2")) 863 '((((class color)) (:background "LightBlue2"))
866 (t (:bold t))) 864 (t (:bold t)))
867 "Face used for marking warning lines." 865 "Face used for marking warning lines."
868 :group 'flymake) 866 :group 'flymake)
869;; backward-compatibility alias
870(put 'flymake-warnline-face 'face-alias 'flymake-warnline)
871 867
872(defun flymake-highlight-line (line-no line-err-info-list) 868(defun flymake-highlight-line (line-no line-err-info-list)
873 "Highlight line LINE-NO in current buffer. 869 "Highlight line LINE-NO in current buffer.
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 42e415c5799..a1c6f0a80b0 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -58,7 +58,7 @@
58;; using a macro: 58;; using a macro:
59;; 59;;
60;; #ifdef UNBUFFERED 60;; #ifdef UNBUFFERED
61;; setvbuf(stdout,(char *)NULL, _IONBF,0); 61;; setvbuf (stdout, (char *) NULL, _IONBF, 0);
62;; #endif 62;; #endif
63;; 63;;
64;; and compiling with -DUNBUFFERED while debugging. 64;; and compiling with -DUNBUFFERED while debugging.
@@ -1307,8 +1307,6 @@ static char *magick[] = {
1307 (((background light)) :foreground "grey40")) 1307 (((background light)) :foreground "grey40"))
1308 "Face for disabled breakpoint icon in fringe." 1308 "Face for disabled breakpoint icon in fringe."
1309 :group 'gud) 1309 :group 'gud)
1310;; Compatibility alias for old name.
1311(put 'breakpoint-disabled-bitmap-face 'face-alias 'breakpoint-disabled)
1312 1310
1313;; Put breakpoint icons in relevant margins (even those set in the GUD buffer). 1311;; Put breakpoint icons in relevant margins (even those set in the GUD buffer).
1314(defun gdb-info-breakpoints-custom () 1312(defun gdb-info-breakpoints-custom ()
@@ -2192,6 +2190,7 @@ corresponding to the mode line clicked."
2192 (define-key gud-menu-map [ui] 2190 (define-key gud-menu-map [ui]
2193 `(menu-item "GDB-UI" ,menu :visible (eq gud-minor-mode 'gdba))) 2191 `(menu-item "GDB-UI" ,menu :visible (eq gud-minor-mode 'gdba)))
2194 (define-key menu [gdb-use-inferior-io] 2192 (define-key menu [gdb-use-inferior-io]
2193 ;; See defadvice below.
2195 (menu-bar-make-toggle toggle-gdb-use-inferior-io-buffer 2194 (menu-bar-make-toggle toggle-gdb-use-inferior-io-buffer
2196 gdb-use-inferior-io-buffer 2195 gdb-use-inferior-io-buffer
2197 "Separate inferior IO" "Use separate IO %s" 2196 "Separate inferior IO" "Use separate IO %s"
@@ -2204,6 +2203,7 @@ corresponding to the mode line clicked."
2204 '(menu-item "Restore Window Layout" gdb-restore-windows 2203 '(menu-item "Restore Window Layout" gdb-restore-windows
2205 :help "Restore standard layout for debug session."))) 2204 :help "Restore standard layout for debug session.")))
2206 2205
2206;; This function is defined above through a macro.
2207(defadvice toggle-gdb-use-inferior-io-buffer (after gdb-kill-io-buffer activate) 2207(defadvice toggle-gdb-use-inferior-io-buffer (after gdb-kill-io-buffer activate)
2208 (unless gdb-use-inferior-io-buffer 2208 (unless gdb-use-inferior-io-buffer
2209 (kill-buffer (gdb-inferior-io-name)))) 2209 (kill-buffer (gdb-inferior-io-name))))
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 4378a7c253d..6dc5fcabd41 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -206,7 +206,7 @@ See `compilation-error-screen-columns'"
206 (define-key map [menu-bar grep compilation-compile] 206 (define-key map [menu-bar grep compilation-compile]
207 '("Compile..." . compile)) 207 '("Compile..." . compile))
208 (define-key map [menu-bar grep compilation-grep] 208 (define-key map [menu-bar grep compilation-grep]
209 '("Another grep" . grep)) 209 '("Another grep..." . grep))
210 (define-key map [menu-bar grep compilation-recompile] 210 (define-key map [menu-bar grep compilation-recompile]
211 '("Repeat grep" . recompile)) 211 '("Repeat grep" . recompile))
212 (define-key map [menu-bar grep compilation-separator2] 212 (define-key map [menu-bar grep compilation-separator2]
@@ -244,11 +244,11 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
244 244
245;;;###autoload 245;;;###autoload
246(defvar grep-regexp-alist 246(defvar grep-regexp-alist
247 '(("^\\([^:\n]+\\)\\(:[ \t]*\\)\\([0-9]+\\)\\2" 247 '(("^\\(.+?\\)\\(:[ \t]*\\)\\([0-9]+\\)\\2"
248 1 3) 248 1 3)
249 ;; Rule to match column numbers is commented out since no known grep 249 ;; Rule to match column numbers is commented out since no known grep
250 ;; produces them 250 ;; produces them
251 ;; ("^\\([^:\n]+\\)\\(:[ \t]*\\)\\([0-9]+\\)\\2\\(?:\\([0-9]+\\)\\(?:-\\([0-9]+\\)\\)?\\2\\)?" 251 ;; ("^\\(.+?\\)\\(:[ \t]*\\)\\([0-9]+\\)\\2\\(?:\\([0-9]+\\)\\(?:-\\([0-9]+\\)\\)?\\2\\)?"
252 ;; 1 3 (4 . 5)) 252 ;; 1 3 (4 . 5))
253 ("^\\(\\(.+?\\):\\([0-9]+\\):\\).*?\ 253 ("^\\(\\(.+?\\):\\([0-9]+\\):\\).*?\
254\\(\033\\[01;31m\\(?:\033\\[K\\)?\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)" 254\\(\033\\[01;31m\\(?:\033\\[K\\)?\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)"
@@ -261,7 +261,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
261 (lambda () (- (match-end 5) (match-end 1) 261 (lambda () (- (match-end 5) (match-end 1)
262 (- (match-end 4) (match-beginning 4))))) 262 (- (match-end 4) (match-beginning 4)))))
263 nil 1) 263 nil 1)
264 ("^Binary file \\(.+\\) matches$" 1 nil nil 1 1)) 264 ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1))
265 "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") 265 "Regexp used to match grep hits. See `compilation-error-regexp-alist'.")
266 266
267(defvar grep-error "grep hit" 267(defvar grep-error "grep hit"
@@ -272,8 +272,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
272(defvar grep-hit-face compilation-info-face 272(defvar grep-hit-face compilation-info-face
273 "Face name to use for grep hits.") 273 "Face name to use for grep hits.")
274 274
275;; compilation-error-face is wrong for this; it's designed to look like a link. 275(defvar grep-error-face 'compilation-error
276(defvar grep-error-face font-lock-keyword-face
277 "Face name to use for grep error messages.") 276 "Face name to use for grep error messages.")
278 277
279(defvar grep-match-face 'match 278(defvar grep-match-face 'match
@@ -288,15 +287,17 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
288 (": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$" 287 (": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$"
289 1 grep-error-face) 288 1 grep-error-face)
290 ;; remove match from grep-regexp-alist before fontifying 289 ;; remove match from grep-regexp-alist before fontifying
290 ("^Grep started.*"
291 (0 '(face nil message nil help-echo nil mouse-face nil) t))
291 ("^Grep finished \\(?:(\\(matches found\\))\\|with \\(no matches found\\)\\).*" 292 ("^Grep finished \\(?:(\\(matches found\\))\\|with \\(no matches found\\)\\).*"
292 (0 '(face nil message nil help-echo nil mouse-face nil) t) 293 (0 '(face nil message nil help-echo nil mouse-face nil) t)
293 (1 font-lock-keyword-face nil t) 294 (1 compilation-info-face nil t)
294 (2 font-lock-keyword-face nil t)) 295 (2 compilation-warning-face nil t))
295 ("^Grep \\(exited abnormally\\) with code \\([0-9]+\\).*" 296 ("^Grep \\(exited abnormally\\|interrupt\\|killed\\|terminated\\)\\(?:.*with code \\([0-9]+\\)\\)?.*"
296 (0 '(face nil message nil help-echo nil mouse-face nil) t) 297 (0 '(face nil message nil help-echo nil mouse-face nil) t)
297 (1 grep-error-face) 298 (1 grep-error-face)
298 (2 grep-error-face)) 299 (2 grep-error-face nil t))
299 ("^[^\n-]+-[0-9]+-.*" (0 grep-context-face)) 300 ("^.+?-[0-9]+-.*\n" (0 grep-context-face))
300 ;; Highlight grep matches and delete markers 301 ;; Highlight grep matches and delete markers
301 ("\\(\033\\[01;31m\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)" 302 ("\\(\033\\[01;31m\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)"
302 ;; Refontification does not work after the markers have been 303 ;; Refontification does not work after the markers have been
@@ -517,11 +518,10 @@ temporarily highlight in visited source lines."
517 518
518 ;; Setting process-setup-function makes exit-message-function work 519 ;; Setting process-setup-function makes exit-message-function work
519 ;; even when async processes aren't supported. 520 ;; even when async processes aren't supported.
520 (let ((compilation-process-setup-function 'grep-process-setup)) 521 (compilation-start (if (and grep-use-null-device null-device)
521 (compilation-start (if (and grep-use-null-device null-device) 522 (concat command-args " " null-device)
522 (concat command-args " " null-device) 523 command-args)
523 command-args) 524 'grep-mode nil highlight-regexp))
524 'grep-mode nil highlight-regexp)))
525 525
526;;;###autoload 526;;;###autoload
527(define-compilation-mode grep-mode "Grep" 527(define-compilation-mode grep-mode "Grep"
@@ -531,6 +531,9 @@ temporarily highlight in visited source lines."
531 grep-hit-face) 531 grep-hit-face)
532 (set (make-local-variable 'compilation-error-regexp-alist) 532 (set (make-local-variable 'compilation-error-regexp-alist)
533 grep-regexp-alist) 533 grep-regexp-alist)
534 (set (make-local-variable 'compilation-process-setup-function)
535 'grep-process-setup)
536 (set (make-local-variable 'compilation-disable-input) t)
534 ;; Set `font-lock-lines-before' to 0 to not refontify the previous 537 ;; Set `font-lock-lines-before' to 0 to not refontify the previous
535 ;; line where grep markers may be already removed. 538 ;; line where grep markers may be already removed.
536 (set (make-local-variable 'font-lock-lines-before) 0)) 539 (set (make-local-variable 'font-lock-lines-before) 0))
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 22b0b7b36d6..0577e2a2bb7 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -586,7 +586,9 @@ and source-file directory for your debugger."
586 (gud-def gud-nexti "nexti %p" nil "Step one instruction (skip functions).") 586 (gud-def gud-nexti "nexti %p" nil "Step one instruction (skip functions).")
587 (gud-def gud-cont "cont" "\C-r" "Continue with display.") 587 (gud-def gud-cont "cont" "\C-r" "Continue with display.")
588 (gud-def gud-finish "finish" "\C-f" "Finish executing current function.") 588 (gud-def gud-finish "finish" "\C-f" "Finish executing current function.")
589 (gud-def gud-jump "tbreak %f:%l\njump %f:%l" "\C-j" "Relocate execution address to line at point in source buffer.") 589 (gud-def gud-jump
590 (progn (gud-call "tbreak %f:%l") (gud-call "jump %f:%l"))
591 "\C-j" "Set execution address to current line.")
590 592
591 (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).") 593 (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).")
592 (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).") 594 (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).")
@@ -2596,7 +2598,7 @@ It is saved for when this flag is not set.")
2596(defun gud-kill-buffer-hook () 2598(defun gud-kill-buffer-hook ()
2597 (setq gud-minor-mode-type gud-minor-mode) 2599 (setq gud-minor-mode-type gud-minor-mode)
2598 (condition-case nil 2600 (condition-case nil
2599 (kill-process (get-buffer-process gud-comint-buffer)) 2601 (kill-process (get-buffer-process (current-buffer)))
2600 (error nil))) 2602 (error nil)))
2601 2603
2602(defun gud-reset () 2604(defun gud-reset ()
diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el
index 6dbbca4c5b1..8c43831ebac 100644
--- a/lisp/progmodes/idlw-help.el
+++ b/lisp/progmodes/idlw-help.el
@@ -193,8 +193,6 @@ support."
193 (t (:weight bold))) 193 (t (:weight bold)))
194 "Face for highlighting links into IDLWAVE online help." 194 "Face for highlighting links into IDLWAVE online help."
195 :group 'idlwave-online-help) 195 :group 'idlwave-online-help)
196;; backward-compatibility alias
197(put 'idlwave-help-link-face 'face-alias 'idlwave-help-link)
198 196
199(defvar idlwave-help-activate-links-aggressively nil 197(defvar idlwave-help-activate-links-aggressively nil
200 "Obsolete variable.") 198 "Obsolete variable.")
diff --git a/lisp/progmodes/idlw-rinfo.el b/lisp/progmodes/idlw-rinfo.el
index 962292b740a..367de774bcf 100644
--- a/lisp/progmodes/idlw-rinfo.el
+++ b/lisp/progmodes/idlw-rinfo.el
@@ -1899,7 +1899,7 @@
1899 ) 1899 )
1900 "1850 builtin routines with 7685 keywords for IDL version 6.1.") 1900 "1850 builtin routines with 7685 keywords for IDL version 6.1.")
1901 1901
1902(setq idlwave-system-variables-alist 1902(defvar idlwave-system-variables-alist
1903 '( 1903 '(
1904 ("C" (link "sysvars7.html#wp997337")) 1904 ("C" (link "sysvars7.html#wp997337"))
1905 ("CPU" (tags ("HW_VECTOR") ("VECTOR_ENABLE") ("HW_NCPU") ("TPOOL_NTHREADS") ("TPOOL_MIN_ELTS") ("TPOOL_MAX_ELTS")) (link "sysvars6.html#wp1014201")) 1905 ("CPU" (tags ("HW_VECTOR") ("VECTOR_ENABLE") ("HW_NCPU") ("TPOOL_NTHREADS") ("TPOOL_MIN_ELTS") ("TPOOL_MAX_ELTS")) (link "sysvars6.html#wp1014201"))
@@ -1932,7 +1932,7 @@
1932 ("Z" (tags ("TITLE" . 997839) ("TYPE" . 997842) ("STYLE" . 997742) ("TICKS" . 999577) ("TICKLEN" . 1012793) ("THICK" . 997798) ("RANGE" . 997713) ("CRANGE" . 997670) ("S" . 997736) ("MARGIN" . 997689) ("OMARGIN" . 997702) ("WINDOW" . 997845) ("REGION" . 997724) ("CHARSIZE" . 1012787) ("MINOR" . 997699) ("TICKV" . 997833) ("TICKNAME" . 997811) ("GRIDSTYLE" . 998134) ("TICKFORMAT" . 997801) ("TICKINTERVAL" . 997808) ("TICKLAYOUT" . 1012924) ("TICKUNITS" . 1012962)) (link "sysvars7.html#wp997657")))) 1932 ("Z" (tags ("TITLE" . 997839) ("TYPE" . 997842) ("STYLE" . 997742) ("TICKS" . 999577) ("TICKLEN" . 1012793) ("THICK" . 997798) ("RANGE" . 997713) ("CRANGE" . 997670) ("S" . 997736) ("MARGIN" . 997689) ("OMARGIN" . 997702) ("WINDOW" . 997845) ("REGION" . 997724) ("CHARSIZE" . 1012787) ("MINOR" . 997699) ("TICKV" . 997833) ("TICKNAME" . 997811) ("GRIDSTYLE" . 998134) ("TICKFORMAT" . 997801) ("TICKINTERVAL" . 997808) ("TICKLAYOUT" . 1012924) ("TICKUNITS" . 1012962)) (link "sysvars7.html#wp997657"))))
1933 1933
1934 1934
1935(setq idlwave-system-class-info 1935(defvar idlwave-system-class-info
1936 '( 1936 '(
1937 ("IDLgrContour" (tags "IDLGRCOMPONENT_TOP" "IDLGRCOMPONENTVERSION" "HIDE" "PARENT" "IDLGRCOMPONENT_BOTTOM" "IDLGRGRAPHIC_TOP" "IDLGRGRAPHICVERSION" "ALPHACHANNEL" "CLIP_PLANES" "COLOR" "DEPTH_TEST_DISABLE" "DEPTH_TEST_FUNCTION" "DEPTH_WRITE_DISABLE" "GRAPHICFLAGS" "PALETTE" "XCOORD_CONV" "YCOORD_CONV" "ZCOORD_CONV" "XRANGE" "YRANGE" "ZRANGE" "GRAPHIC_DATA_OBJECT" "IDLGRGRAPHIC_BOTTOM" "IDLGRCONTOUR_TOP" "IDLGRCONTOURVERSION" "AM_PM" "ANISOTROPY" "DATA_FORMAT" "DATA" "DAYS_OF_WEEK" "GEOM_FORMAT" "GEOM" "CONTOURFLAGS" "C_COLOR" "C_FILLPATTERN" "C_LABEL_INTERVAL" "C_LABEL_NOGAPS" "C_LABEL_OBJECTS" "C_LABEL_SHOW" "C_LINESTYLE" "C_THICK" "C_USE_LABEL_COLOR" "C_USE_LABEL_ORIENTATION" "C_VALUE" "LABEL_DEFAULTS" "LABEL_FONT" "LABEL_FORMAT" "LABEL_FRMTDATA" "LABEL_UNITS" "LABEL_UNIT_CODE" "MAXVAL" "MINVAL" "MONTHS" "NLEVELS" "POLYGONS" "SHADERANGE" "SHADING" "TICKINTERVAL" "TICKLEN" "PRECISIONDATA" "PRECISIONGEOM" "PRECISIONGRAPH" "LEVELINFO" "CFILL1" "DEPTHOFFSET" "MAPINFO" "IDLGRCONTOUR_BOTTOM") (inherits "IDLitComponent") (link "objects_gr43.html")) 1937 ("IDLgrContour" (tags "IDLGRCOMPONENT_TOP" "IDLGRCOMPONENTVERSION" "HIDE" "PARENT" "IDLGRCOMPONENT_BOTTOM" "IDLGRGRAPHIC_TOP" "IDLGRGRAPHICVERSION" "ALPHACHANNEL" "CLIP_PLANES" "COLOR" "DEPTH_TEST_DISABLE" "DEPTH_TEST_FUNCTION" "DEPTH_WRITE_DISABLE" "GRAPHICFLAGS" "PALETTE" "XCOORD_CONV" "YCOORD_CONV" "ZCOORD_CONV" "XRANGE" "YRANGE" "ZRANGE" "GRAPHIC_DATA_OBJECT" "IDLGRGRAPHIC_BOTTOM" "IDLGRCONTOUR_TOP" "IDLGRCONTOURVERSION" "AM_PM" "ANISOTROPY" "DATA_FORMAT" "DATA" "DAYS_OF_WEEK" "GEOM_FORMAT" "GEOM" "CONTOURFLAGS" "C_COLOR" "C_FILLPATTERN" "C_LABEL_INTERVAL" "C_LABEL_NOGAPS" "C_LABEL_OBJECTS" "C_LABEL_SHOW" "C_LINESTYLE" "C_THICK" "C_USE_LABEL_COLOR" "C_USE_LABEL_ORIENTATION" "C_VALUE" "LABEL_DEFAULTS" "LABEL_FONT" "LABEL_FORMAT" "LABEL_FRMTDATA" "LABEL_UNITS" "LABEL_UNIT_CODE" "MAXVAL" "MINVAL" "MONTHS" "NLEVELS" "POLYGONS" "SHADERANGE" "SHADING" "TICKINTERVAL" "TICKLEN" "PRECISIONDATA" "PRECISIONGEOM" "PRECISIONGRAPH" "LEVELINFO" "CFILL1" "DEPTHOFFSET" "MAPINFO" "IDLGRCONTOUR_BOTTOM") (inherits "IDLitComponent") (link "objects_gr43.html"))
1938 ("IDLgrAxis" (tags "IDLGRCOMPONENT_TOP" "IDLGRCOMPONENTVERSION" "HIDE" "PARENT" "IDLGRCOMPONENT_BOTTOM" "IDLGRGRAPHIC_TOP" "IDLGRGRAPHICVERSION" "ALPHACHANNEL" "CLIP_PLANES" "COLOR" "DEPTH_TEST_DISABLE" "DEPTH_TEST_FUNCTION" "DEPTH_WRITE_DISABLE" "GRAPHICFLAGS" "PALETTE" "XCOORD_CONV" "YCOORD_CONV" "ZCOORD_CONV" "XRANGE" "YRANGE" "ZRANGE" "GRAPHIC_DATA_OBJECT" "IDLGRGRAPHIC_BOTTOM" "IDLGRAXIS_TOP" "IDLGRAXISVERSION" "AM_PM" "AXIS_TYPE" "CALCFLAGS" "DAYS_OF_WEEK" "DIRECTION" "AXISFLAGS" "GRIDSTYLE" "LOCATION" "MAJOR" "MINOR" "MONTHS" "OUTRANGE" "RANGE" "SUBTICKLEN" "TEXTALIGNMENTS" "TEXTBASELINE" "TEXTUPDIR" "THICK" "TICKDIR" "TICKFORMAT" "ARRAY_TICKFORMAT" "TICKFRMTDATA" "TICKINTERVAL" "TICKLAYOUT" "TICKLEN" "TICKTEXT" "TICKUNITCODES" "TICKUNITS" "TICKVALUES" "TITLE" "CURRENT_LEVEL" "LEVEL_DATA" "STEPRANGEUNITS" "STEPRANGE" "IDLGRAXIS_BOTTOM") (inherits "IDLitComponent") (link "objects_gr3.html")) 1938 ("IDLgrAxis" (tags "IDLGRCOMPONENT_TOP" "IDLGRCOMPONENTVERSION" "HIDE" "PARENT" "IDLGRCOMPONENT_BOTTOM" "IDLGRGRAPHIC_TOP" "IDLGRGRAPHICVERSION" "ALPHACHANNEL" "CLIP_PLANES" "COLOR" "DEPTH_TEST_DISABLE" "DEPTH_TEST_FUNCTION" "DEPTH_WRITE_DISABLE" "GRAPHICFLAGS" "PALETTE" "XCOORD_CONV" "YCOORD_CONV" "ZCOORD_CONV" "XRANGE" "YRANGE" "ZRANGE" "GRAPHIC_DATA_OBJECT" "IDLGRGRAPHIC_BOTTOM" "IDLGRAXIS_TOP" "IDLGRAXISVERSION" "AM_PM" "AXIS_TYPE" "CALCFLAGS" "DAYS_OF_WEEK" "DIRECTION" "AXISFLAGS" "GRIDSTYLE" "LOCATION" "MAJOR" "MINOR" "MONTHS" "OUTRANGE" "RANGE" "SUBTICKLEN" "TEXTALIGNMENTS" "TEXTBASELINE" "TEXTUPDIR" "THICK" "TICKDIR" "TICKFORMAT" "ARRAY_TICKFORMAT" "TICKFRMTDATA" "TICKINTERVAL" "TICKLAYOUT" "TICKLEN" "TICKTEXT" "TICKUNITCODES" "TICKUNITS" "TICKVALUES" "TITLE" "CURRENT_LEVEL" "LEVEL_DATA" "STEPRANGEUNITS" "STEPRANGE" "IDLGRAXIS_BOTTOM") (inherits "IDLitComponent") (link "objects_gr3.html"))
@@ -2014,7 +2014,7 @@
2014 ("IDLjavaObject" (link "objects_misc28.html")))) 2014 ("IDLjavaObject" (link "objects_misc28.html"))))
2015 2015
2016 2016
2017(setq idlwave-executive-commands-alist '( 2017(defvar idlwave-executive-commands-alist '(
2018 ("RESET_SESSION" . "symbols8.html") 2018 ("RESET_SESSION" . "symbols8.html")
2019 ("TRACE" . "symbols15.html") 2019 ("TRACE" . "symbols15.html")
2020 ("RNEW" . "symbols10.html") 2020 ("RNEW" . "symbols10.html")
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index 7c1324c94af..cc706195cc2 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -533,9 +533,7 @@ lines which have a breakpoint. See also `idlwave-shell-mark-breakpoints'."
533 '((((class color)) (:foreground "Black" :background "Pink")) 533 '((((class color)) (:foreground "Black" :background "Pink"))
534 (t (:underline t))) 534 (t (:underline t)))
535 "Face for highlighting lines with breakpoints." 535 "Face for highlighting lines with breakpoints."
536 :group 'idlwave-shell-highlighting-and-faces) 536 :group 'idlwave-shell-highlighting-and-faces))
537 ;; backward-compatibility alias
538 (put 'idlwave-shell-bp-face 'face-alias 'idlwave-shell-bp))
539 537
540(defcustom idlwave-shell-disabled-breakpoint-face 538(defcustom idlwave-shell-disabled-breakpoint-face
541 'idlwave-shell-disabled-bp 539 'idlwave-shell-disabled-bp
@@ -553,10 +551,7 @@ lines which have a breakpoint. See also `idlwave-shell-mark-breakpoints'."
553 '((((class color)) (:foreground "Black" :background "gray")) 551 '((((class color)) (:foreground "Black" :background "gray"))
554 (t (:underline t))) 552 (t (:underline t)))
555 "Face for highlighting lines with breakpoints." 553 "Face for highlighting lines with breakpoints."
556 :group 'idlwave-shell-highlighting-and-faces) 554 :group 'idlwave-shell-highlighting-and-faces))
557 ;; backward-compatibility alias
558 (put 'idlwave-shell-disabled-bp-face 'face-alias 'idlwave-shell-disabled-bp))
559
560 555
561(defcustom idlwave-shell-expression-face 'secondary-selection 556(defcustom idlwave-shell-expression-face 'secondary-selection
562 "*The face for `idlwave-shell-expression-overlay'. 557 "*The face for `idlwave-shell-expression-overlay'.
@@ -2761,13 +2756,14 @@ Runs to the last statement and then steps 1 statement. Use the .out command."
2761 t) 2756 t)
2762 2757
2763(defun idlwave-xemacs-hack-mouse-track (event) 2758(defun idlwave-xemacs-hack-mouse-track (event)
2764 (let ((oldfunc (symbol-function 'default-mouse-track-event-is-with-button))) 2759 (if (featurep 'xemacs)
2765 (unwind-protect 2760 (let ((oldfunc (symbol-function 'default-mouse-track-event-is-with-button)))
2766 (progn 2761 (unwind-protect
2767 (fset 'default-mouse-track-event-is-with-button 2762 (progn
2768 'idlwave-default-mouse-track-event-is-with-button) 2763 (fset 'default-mouse-track-event-is-with-button
2769 (mouse-track event)) 2764 'idlwave-default-mouse-track-event-is-with-button)
2770 (fset 'default-mouse-track-event-is-with-button oldfunc)))) 2765 (mouse-track event))
2766 (fset 'default-mouse-track-event-is-with-button oldfunc)))))
2771;;; End terrible hack section 2767;;; End terrible hack section
2772 2768
2773(defun idlwave-shell-mouse-print (event) 2769(defun idlwave-shell-mouse-print (event)
diff --git a/lisp/progmodes/idlw-toolbar.el b/lisp/progmodes/idlw-toolbar.el
index 9592acb607d..08dd08335bb 100644
--- a/lisp/progmodes/idlw-toolbar.el
+++ b/lisp/progmodes/idlw-toolbar.el
@@ -44,6 +44,9 @@
44 (list 'image :type 'xpm :data image))) 44 (list 'image :type 'xpm :data image)))
45 45
46(defvar default-toolbar) 46(defvar default-toolbar)
47(defvar idlwave-toolbar)
48(defvar idlwave-toolbar-is-possible)
49
47(if (not (or (and (featurep 'xemacs) ; This is XEmacs 50(if (not (or (and (featurep 'xemacs) ; This is XEmacs
48 (featurep 'xpm) ; need xpm 51 (featurep 'xpm) ; need xpm
49 (featurep 'toolbar)) ; ... and the toolbar 52 (featurep 'toolbar)) ; ... and the toolbar
diff --git a/lisp/progmodes/ld-script.el b/lisp/progmodes/ld-script.el
index 8b378b7f0ab..a2449b6817e 100644
--- a/lisp/progmodes/ld-script.el
+++ b/lisp/progmodes/ld-script.el
@@ -39,8 +39,6 @@
39 '((t (:weight bold :inherit font-lock-builtin-face))) 39 '((t (:weight bold :inherit font-lock-builtin-face)))
40 "Face for location counter in GNU ld script." 40 "Face for location counter in GNU ld script."
41 :group 'ld-script) 41 :group 'ld-script)
42;; backward-compatibility alias
43(put 'ld-script-location-counter-face 'face-alias 'ld-script-location-counter)
44 42
45;; Syntax rules 43;; Syntax rules
46(defvar ld-script-mode-syntax-table 44(defvar ld-script-mode-syntax-table
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index f7f96130f39..aeb09927535 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -815,7 +815,7 @@ See `sh-feature'.")
815 :group 'sh-script 815 :group 'sh-script
816 :version "22.1") 816 :version "22.1")
817 817
818(defvar sh-font-lock-keywords 818(defvar sh-font-lock-keywords-var
819 '((csh sh-append shell 819 '((csh sh-append shell
820 ("\\${?[#?]?\\([A-Za-z_][A-Za-z0-9_]*\\|0\\)" 1 820 ("\\${?[#?]?\\([A-Za-z_][A-Za-z0-9_]*\\|0\\)" 1
821 font-lock-variable-name-face)) 821 font-lock-variable-name-face))
@@ -838,7 +838,7 @@ See `sh-feature'.")
838 1 font-lock-negation-char-face)) 838 1 font-lock-negation-char-face))
839 839
840 ;; The next entry is only used for defining the others 840 ;; The next entry is only used for defining the others
841 (shell sh-append executable-font-lock-keywords 841 (shell
842 ;; Using font-lock-string-face here confuses sh-get-indent-info. 842 ;; Using font-lock-string-face here confuses sh-get-indent-info.
843 ("\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\\\)$" 3 'sh-escaped-newline) 843 ("\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\\\)$" 3 'sh-escaped-newline)
844 ("\\\\[^A-Za-z0-9]" 0 font-lock-string-face) 844 ("\\\\[^A-Za-z0-9]" 0 font-lock-string-face)
@@ -850,11 +850,11 @@ See `sh-feature'.")
850 ("^\\(\\sw+\\):" 1 font-lock-variable-name-face))) 850 ("^\\(\\sw+\\):" 1 font-lock-variable-name-face)))
851 "Default expressions to highlight in Shell Script modes. See `sh-feature'.") 851 "Default expressions to highlight in Shell Script modes. See `sh-feature'.")
852 852
853(defvar sh-font-lock-keywords-1 853(defvar sh-font-lock-keywords-var-1
854 '((sh "[ \t]in\\>")) 854 '((sh "[ \t]in\\>"))
855 "Subdued level highlighting for Shell Script modes.") 855 "Subdued level highlighting for Shell Script modes.")
856 856
857(defvar sh-font-lock-keywords-2 () 857(defvar sh-font-lock-keywords-var-2 ()
858 "Gaudy level highlighting for Shell Script modes.") 858 "Gaudy level highlighting for Shell Script modes.")
859 859
860;; These are used for the syntax table stuff (derived from cperl-mode). 860;; These are used for the syntax table stuff (derived from cperl-mode).
@@ -1364,9 +1364,12 @@ with your script for an edit-interpret-debug cycle."
1364 paragraph-start (concat page-delimiter "\\|$") 1364 paragraph-start (concat page-delimiter "\\|$")
1365 paragraph-separate paragraph-start 1365 paragraph-separate paragraph-start
1366 comment-start "# " 1366 comment-start "# "
1367 comment-start-skip "#+[\t ]*"
1368 local-abbrev-table sh-mode-abbrev-table
1367 comint-dynamic-complete-functions sh-dynamic-complete-functions 1369 comint-dynamic-complete-functions sh-dynamic-complete-functions
1368 ;; we can't look if previous line ended with `\' 1370 ;; we can't look if previous line ended with `\'
1369 comint-prompt-regexp "^[ \t]*" 1371 comint-prompt-regexp "^[ \t]*"
1372 imenu-case-fold-search nil
1370 font-lock-defaults 1373 font-lock-defaults
1371 `((sh-font-lock-keywords 1374 `((sh-font-lock-keywords
1372 sh-font-lock-keywords-1 sh-font-lock-keywords-2) 1375 sh-font-lock-keywords-1 sh-font-lock-keywords-2)
@@ -1403,13 +1406,14 @@ with your script for an edit-interpret-debug cycle."
1403(defun sh-font-lock-keywords (&optional keywords) 1406(defun sh-font-lock-keywords (&optional keywords)
1404 "Function to get simple fontification based on `sh-font-lock-keywords'. 1407 "Function to get simple fontification based on `sh-font-lock-keywords'.
1405This adds rules for comments and assignments." 1408This adds rules for comments and assignments."
1406 (sh-feature sh-font-lock-keywords 1409 (sh-feature sh-font-lock-keywords-var
1407 (when (stringp (sh-feature sh-assignment-regexp)) 1410 (when (stringp (sh-feature sh-assignment-regexp))
1408 (lambda (list) 1411 (lambda (list)
1409 `((,(sh-feature sh-assignment-regexp) 1412 `((,(sh-feature sh-assignment-regexp)
1410 1 font-lock-variable-name-face) 1413 1 font-lock-variable-name-face)
1411 ,@keywords 1414 ,@keywords
1412 ,@list))))) 1415 ,@list
1416 ,@executable-font-lock-keywords)))))
1413 1417
1414(defun sh-font-lock-keywords-1 (&optional builtins) 1418(defun sh-font-lock-keywords-1 (&optional builtins)
1415 "Function to get better fontification including keywords." 1419 "Function to get better fontification including keywords."
@@ -1426,10 +1430,10 @@ This adds rules for comments and assignments."
1426 "\\>") 1430 "\\>")
1427 (2 font-lock-keyword-face nil t) 1431 (2 font-lock-keyword-face nil t)
1428 (6 font-lock-builtin-face)) 1432 (6 font-lock-builtin-face))
1429 ,@(sh-feature sh-font-lock-keywords-2))) 1433 ,@(sh-feature sh-font-lock-keywords-var-2)))
1430 (,(concat keywords "\\)\\>") 1434 (,(concat keywords "\\)\\>")
1431 2 font-lock-keyword-face) 1435 2 font-lock-keyword-face)
1432 ,@(sh-feature sh-font-lock-keywords-1))))) 1436 ,@(sh-feature sh-font-lock-keywords-var-1)))))
1433 1437
1434(defun sh-font-lock-keywords-2 () 1438(defun sh-font-lock-keywords-2 ()
1435 "Function to get better fontification including keywords and builtins." 1439 "Function to get better fontification including keywords and builtins."
@@ -1491,6 +1495,7 @@ This adds rules for comments and assignments."
1491 ("case" sh-handle-this-rc-case sh-handle-prev-rc-case)))) 1495 ("case" sh-handle-this-rc-case sh-handle-prev-rc-case))))
1492 1496
1493 1497
1498
1494(defun sh-set-shell (shell &optional no-query-flag insert-flag) 1499(defun sh-set-shell (shell &optional no-query-flag insert-flag)
1495 "Set this buffer's shell to SHELL (a string). 1500 "Set this buffer's shell to SHELL (a string).
1496When used interactively, insert the proper starting #!-line, 1501When used interactively, insert the proper starting #!-line,
@@ -1523,13 +1528,10 @@ Calls the value of `sh-set-shell-hook' if set."
1523 (if (eq tem t) 1528 (if (eq tem t)
1524 (setq require-final-newline mode-require-final-newline))) 1529 (setq require-final-newline mode-require-final-newline)))
1525 (setq 1530 (setq
1526 comment-start-skip "#+[\t ]*"
1527 local-abbrev-table sh-mode-abbrev-table
1528 mode-line-process (format "[%s]" sh-shell) 1531 mode-line-process (format "[%s]" sh-shell)
1529 sh-shell-variables nil 1532 sh-shell-variables nil
1530 sh-shell-variables-initialized nil 1533 sh-shell-variables-initialized nil
1531 imenu-generic-expression (sh-feature sh-imenu-generic-expression) 1534 imenu-generic-expression (sh-feature sh-imenu-generic-expression))
1532 imenu-case-fold-search nil)
1533 (make-local-variable 'sh-mode-syntax-table) 1535 (make-local-variable 'sh-mode-syntax-table)
1534 (let ((tem (sh-feature sh-mode-syntax-table-input))) 1536 (let ((tem (sh-feature sh-mode-syntax-table-input)))
1535 (setq sh-mode-syntax-table 1537 (setq sh-mode-syntax-table
@@ -1557,10 +1559,13 @@ Calls the value of `sh-set-shell-hook' if set."
1557 (message "Indentation setup for shell type %s" sh-shell)) 1559 (message "Indentation setup for shell type %s" sh-shell))
1558 (message "No indentation for this shell type.") 1560 (message "No indentation for this shell type.")
1559 (setq indent-line-function 'sh-basic-indent-line)) 1561 (setq indent-line-function 'sh-basic-indent-line))
1562 (when font-lock-mode
1563 (setq font-lock-set-defaults nil)
1564 (font-lock-set-defaults)
1565 (font-lock-fontify-buffer))
1560 (run-hooks 'sh-set-shell-hook)) 1566 (run-hooks 'sh-set-shell-hook))
1561 1567
1562 1568
1563
1564(defun sh-feature (alist &optional function) 1569(defun sh-feature (alist &optional function)
1565 "Index ALIST by the current shell. 1570 "Index ALIST by the current shell.
1566If ALIST isn't a list where every element is a cons, it is returned as is. 1571If ALIST isn't a list where every element is a cons, it is returned as is.
@@ -1578,39 +1583,38 @@ Else indexing follows an inheritance logic which works in two ways:
1578 one shell to be derived from another shell. 1583 one shell to be derived from another shell.
1579 The value thus determined is physically replaced into the alist. 1584 The value thus determined is physically replaced into the alist.
1580 1585
1581Optional FUNCTION is applied to the determined value and the result is cached 1586If FUNCTION is non-nil, it is called with one argument,
1582in ALIST." 1587the value thus obtained, and the result is used instead."
1583 (or (if (consp alist) 1588 (or (if (consp alist)
1589 ;; Check for something that isn't a valid alist.
1584 (let ((l alist)) 1590 (let ((l alist))
1585 (while (and l (consp (car l))) 1591 (while (and l (consp (car l)))
1586 (setq l (cdr l))) 1592 (setq l (cdr l)))
1587 (if l alist))) 1593 (if l alist)))
1588 (if function 1594
1589 (cdr (assoc (setq function (cons sh-shell function)) alist))) 1595 (let ((orig-sh-shell sh-shell))
1590 (let ((sh-shell sh-shell) 1596 (let ((sh-shell sh-shell)
1591 elt val) 1597 elt val)
1592 (while (and sh-shell 1598 (while (and sh-shell
1593 (not (setq elt (assq sh-shell alist)))) 1599 (not (setq elt (assq sh-shell alist))))
1594 (setq sh-shell (cdr (assq sh-shell sh-ancestor-alist)))) 1600 (setq sh-shell (cdr (assq sh-shell sh-ancestor-alist))))
1595 ;; If the shell is not known, treat it as sh. 1601 ;; If the shell is not known, treat it as sh.
1596 (unless elt 1602 (unless elt
1597 (setq elt (assq 'sh alist))) 1603 (setq elt (assq 'sh alist)))
1598 (if (and (consp (setq val (cdr elt))) 1604 (setq val (cdr elt))
1599 (memq (car val) '(sh-append sh-modify))) 1605 (if (and (consp val)
1600 (setcdr elt 1606 (memq (car val) '(sh-append sh-modify)))
1601 (setq val 1607 (setq val
1602 (apply (car val) 1608 (apply (car val)
1603 (let ((sh-shell (car (cdr val)))) 1609 ;; Refer to the value for a different shell,
1604 (if (assq sh-shell alist) 1610 ;; as a kind of inheritance.
1605 (sh-feature alist) 1611 (let ((sh-shell (car (cdr val))))
1606 (eval sh-shell))) 1612 (sh-feature alist))
1607 (cddr val))))) 1613 (cddr val))))
1608 (if function 1614 (if function
1609 (nconc alist 1615 (setq sh-shell orig-sh-shell
1610 (list (cons function 1616 val (funcall function val)))
1611 (setq sh-shell (car function) 1617 val))))
1612 val (funcall (cdr function) val))))))
1613 val)))
1614 1618
1615 1619
1616 1620
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 129137c32fd..7e259dfb6e4 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -736,10 +736,11 @@ Used by `sql-rename-buffer'.")
736 736
737(defvar sql-interactive-mode-map 737(defvar sql-interactive-mode-map
738 (let ((map (make-sparse-keymap))) 738 (let ((map (make-sparse-keymap)))
739 (if (functionp 'set-keymap-parent) 739 (if (fboundp 'set-keymap-parent)
740 (set-keymap-parent map comint-mode-map); Emacs 740 (set-keymap-parent map comint-mode-map); Emacs
741 (set-keymap-parents map (list comint-mode-map))); XEmacs 741 (if (fboundp 'set-keymap-parents)
742 (if (functionp 'set-keymap-name) 742 (set-keymap-parents map (list comint-mode-map)))); XEmacs
743 (if (fboundp 'set-keymap-name)
743 (set-keymap-name map 'sql-interactive-mode-map)); XEmacs 744 (set-keymap-name map 'sql-interactive-mode-map)); XEmacs
744 (define-key map (kbd "C-j") 'sql-accumulate-and-indent) 745 (define-key map (kbd "C-j") 'sql-accumulate-and-indent)
745 (define-key map (kbd "C-c C-w") 'sql-copy-column) 746 (define-key map (kbd "C-c C-w") 'sql-copy-column)
@@ -1901,16 +1902,8 @@ appended to the SQLi buffer without disturbing your SQL buffer."
1901 (describe-function 'sql-help)) 1902 (describe-function 'sql-help))
1902 1903
1903(defun sql-read-passwd (prompt &optional default) 1904(defun sql-read-passwd (prompt &optional default)
1904 "Read a password using PROMPT. 1905 "Read a password using PROMPT. Optional DEFAULT is password to start with."
1905Optional DEFAULT is password to start with. This function calls 1906 (read-passwd prompt nil default))
1906`read-passwd' if it is available. If not, function
1907`ange-ftp-read-passwd' is called. This should always be available,
1908even in old versions of Emacs."
1909 (if (fboundp 'read-passwd)
1910 (read-passwd prompt nil default)
1911 (unless (fboundp 'ange-ftp-read-passwd)
1912 (autoload 'ange-ftp-read-passwd "ange-ftp"))
1913 (ange-ftp-read-passwd prompt default)))
1914 1907
1915(defun sql-get-login (&rest what) 1908(defun sql-get-login (&rest what)
1916 "Get username, password and database from the user. 1909 "Get username, password and database from the user.
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 26d68aea50f..75f2bb56aa4 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -4,9 +4,8 @@
4 4
5;; Authors: Reto Zimmermann <reto@gnu.org> 5;; Authors: Reto Zimmermann <reto@gnu.org>
6;; Rodney J. Whitby <software.vhdl-mode@rwhitby.net> 6;; Rodney J. Whitby <software.vhdl-mode@rwhitby.net>
7;; Maintainer: Reto Zimmermann <reto@gnu.org> 7;; Maintainer: FSF (Because Reto Zimmermann seems to have disappeared)
8;; Keywords: languages vhdl 8;; Keywords: languages vhdl
9;; WWW: http://opensource.ethz.ch/emacs/vhdl-mode.html
10 9
11(defconst vhdl-version "3.32.12" 10(defconst vhdl-version "3.32.12"
12 "VHDL Mode version number.") 11 "VHDL Mode version number.")
@@ -67,13 +66,13 @@
67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
68;; Emacs Versions 67;; Emacs Versions
69 68
70;; supported: GNU Emacs 20.X/21.X, XEmacs 20.X/21.X 69;; supported: GNU Emacs 20.X/21.X/22.X, XEmacs 20.X/21.X
71;; tested on: GNU Emacs 20.4, XEmacs 21.1 (marginally) 70;; tested on: GNU Emacs 20.4, XEmacs 21.1 (marginally)
72 71
73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
74;; Installation 73;; Installation
75 74
76;; Prerequisites: GNU Emacs 20.X/21.X, XEmacs 20.X/21.X. 75;; Prerequisites: GNU Emacs 20.X/21.X/22.X, XEmacs 20.X/21.X.
77 76
78;; Put `vhdl-mode.el' into the `site-lisp' directory of your Emacs installation 77;; Put `vhdl-mode.el' into the `site-lisp' directory of your Emacs installation
79;; or into an arbitrary directory that is added to the load path by the 78;; or into an arbitrary directory that is added to the load path by the
@@ -125,9 +124,9 @@
125;; XEmacs handling 124;; XEmacs handling
126(defconst vhdl-xemacs (string-match "XEmacs" emacs-version) 125(defconst vhdl-xemacs (string-match "XEmacs" emacs-version)
127 "Non-nil if XEmacs is used.") 126 "Non-nil if XEmacs is used.")
128;; Emacs 21 handling 127;; Emacs 21+ handling
129(defconst vhdl-emacs-21 (and (= emacs-major-version 21) (not vhdl-xemacs)) 128(defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not vhdl-xemacs))
130 "Non-nil if Emacs 21 is used.") 129 "Non-nil if Emacs 21, 22, ... is used.")
131 130
132 131
133;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 132;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index c1bfc140d84..66d91dce3da 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -139,8 +139,6 @@ Zero means compute the Imenu menu regardless of size."
139 :foreground "LightSkyBlue")) 139 :foreground "LightSkyBlue"))
140 "Face used to highlight mode line function names." 140 "Face used to highlight mode line function names."
141 :group 'which-func) 141 :group 'which-func)
142;; backward-compatibility alias
143(put 'which-func-face 'face-alias 'which-func)
144 142
145(defcustom which-func-format 143(defcustom which-func-format
146 `("[" 144 `("["
diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el
index f53653a306d..d568bca5b75 100644
--- a/lisp/progmodes/xscheme.el
+++ b/lisp/progmodes/xscheme.el
@@ -33,6 +33,85 @@
33;;; Code: 33;;; Code:
34 34
35(require 'scheme) 35(require 'scheme)
36
37;;;; Internal Variables
38
39(defvar xscheme-previous-mode)
40(defvar xscheme-previous-process-state)
41(defvar xscheme-last-input-end)
42
43(defvar xscheme-process-command-line nil
44 "Command used to start the most recent Scheme process.")
45
46(defvar xscheme-process-name "scheme"
47 "Name of xscheme process that we're currently interacting with.")
48
49(defvar xscheme-buffer-name "*scheme*"
50 "Name of xscheme buffer that we're currently interacting with.")
51
52(defvar xscheme-expressions-ring-max 30
53 "*Maximum length of Scheme expressions ring.")
54
55(defvar xscheme-expressions-ring nil
56 "List of expressions recently transmitted to the Scheme process.")
57
58(defvar xscheme-expressions-ring-yank-pointer nil
59 "The tail of the Scheme expressions ring whose car is the last thing yanked.")
60
61(defvar xscheme-running-p nil
62 "This variable, if nil, indicates that the scheme process is
63waiting for input. Otherwise, it is busy evaluating something.")
64
65(defconst xscheme-control-g-synchronization-p t
66 "If non-nil, insert markers in the scheme input stream to indicate when
67control-g interrupts were signaled. Do not allow more control-g's to be
68signaled until the scheme process acknowledges receipt.")
69
70(defvar xscheme-control-g-disabled-p nil
71 "This variable, if non-nil, indicates that a control-g is being processed
72by the scheme process, so additional control-g's are to be ignored.")
73
74(defvar xscheme-string-receiver nil
75 "Procedure to send the string argument from the scheme process.")
76
77(defconst default-xscheme-runlight
78 '(": " xscheme-runlight-string)
79 "Default global (shared) xscheme-runlight modeline format.")
80
81(defvar xscheme-runlight "")
82(defvar xscheme-runlight-string nil)
83
84(defvar xscheme-process-filter-state 'idle
85 "State of scheme process escape reader state machine:
86idle waiting for an escape sequence
87reading-type received an altmode but nothing else
88reading-string reading prompt string")
89
90(defvar xscheme-allow-output-p t
91 "This variable, if nil, prevents output from the scheme process
92from being inserted into the process-buffer.")
93
94(defvar xscheme-prompt ""
95 "The current scheme prompt string.")
96
97(defvar xscheme-string-accumulator ""
98 "Accumulator for the string being received from the scheme process.")
99
100(defvar xscheme-mode-string nil)
101(setq-default scheme-mode-line-process
102 '("" xscheme-runlight))
103
104(mapcar 'make-variable-buffer-local
105 '(xscheme-expressions-ring
106 xscheme-expressions-ring-yank-pointer
107 xscheme-process-filter-state
108 xscheme-running-p
109 xscheme-control-g-disabled-p
110 xscheme-allow-output-p
111 xscheme-prompt
112 xscheme-string-accumulator
113 xscheme-mode-string
114 scheme-mode-line-process))
36 115
37(defgroup xscheme nil 116(defgroup xscheme nil
38 "Major mode for editing Scheme and interacting with MIT's C-Scheme." 117 "Major mode for editing Scheme and interacting with MIT's C-Scheme."
@@ -355,6 +434,9 @@ with no args, if that value is non-nil.
355 (if (eq (process-sentinel process) 'xscheme-process-sentinel) 434 (if (eq (process-sentinel process) 'xscheme-process-sentinel)
356 (set-process-sentinel process (cdr previous-state)))))))) 435 (set-process-sentinel process (cdr previous-state))))))))
357 436
437(defvar scheme-interaction-mode-commands-alist nil)
438(defvar scheme-interaction-mode-map nil)
439
358(defun scheme-interaction-mode-initialize () 440(defun scheme-interaction-mode-initialize ()
359 (use-local-map scheme-interaction-mode-map) 441 (use-local-map scheme-interaction-mode-map)
360 (setq major-mode 'scheme-interaction-mode) 442 (setq major-mode 'scheme-interaction-mode)
@@ -368,7 +450,7 @@ with no args, if that value is non-nil.
368 (car (cdr (car entries)))) 450 (car (cdr (car entries))))
369 (setq entries (cdr entries))))) 451 (setq entries (cdr entries)))))
370 452
371(defvar scheme-interaction-mode-commands-alist nil) 453;; Initialize the command alist
372(setq scheme-interaction-mode-commands-alist 454(setq scheme-interaction-mode-commands-alist
373 (append scheme-interaction-mode-commands-alist 455 (append scheme-interaction-mode-commands-alist
374 '(("\C-c\C-m" xscheme-send-current-line) 456 '(("\C-c\C-m" xscheme-send-current-line)
@@ -378,7 +460,7 @@ with no args, if that value is non-nil.
378 ("\ep" xscheme-yank-pop) 460 ("\ep" xscheme-yank-pop)
379 ("\en" xscheme-yank-push)))) 461 ("\en" xscheme-yank-push))))
380 462
381(defvar scheme-interaction-mode-map nil) 463;; Initialize the mode map
382(if (not scheme-interaction-mode-map) 464(if (not scheme-interaction-mode-map)
383 (progn 465 (progn
384 (setq scheme-interaction-mode-map (make-keymap)) 466 (setq scheme-interaction-mode-map (make-keymap))
@@ -411,18 +493,20 @@ Commands:
411\\{scheme-debugger-mode-map}" 493\\{scheme-debugger-mode-map}"
412 (error "Invalid entry to scheme-debugger-mode")) 494 (error "Invalid entry to scheme-debugger-mode"))
413 495
496(defvar scheme-debugger-mode-map nil)
497
414(defun scheme-debugger-mode-initialize () 498(defun scheme-debugger-mode-initialize ()
415 (use-local-map scheme-debugger-mode-map) 499 (use-local-map scheme-debugger-mode-map)
416 (setq major-mode 'scheme-debugger-mode) 500 (setq major-mode 'scheme-debugger-mode)
417 (setq mode-name "Scheme Debugger")) 501 (setq mode-name "Scheme Debugger"))
418 502
419(defun scheme-debugger-mode-commands (keymap) 503(defun scheme-debugger-mode-commands (keymap)
420 (let ((char ? )) 504 (let ((char ?\s))
421 (while (< char 127) 505 (while (< char 127)
422 (define-key keymap (char-to-string char) 'scheme-debugger-self-insert) 506 (define-key keymap (char-to-string char) 'scheme-debugger-self-insert)
423 (setq char (1+ char))))) 507 (setq char (1+ char)))))
424 508
425(defvar scheme-debugger-mode-map nil) 509;; Initialize the debugger mode map
426(if (not scheme-debugger-mode-map) 510(if (not scheme-debugger-mode-map)
427 (progn 511 (progn
428 (setq scheme-debugger-mode-map (make-keymap)) 512 (setq scheme-debugger-mode-map (make-keymap))
@@ -675,6 +759,9 @@ Useful for working with debugging Scheme under adb."
675 (interactive) 759 (interactive)
676 (process-send-string xscheme-process-name "(proceed)\n")) 760 (process-send-string xscheme-process-name "(proceed)\n"))
677 761
762(defconst xscheme-control-g-message-string
763 "Sending C-G interrupt to Scheme...")
764
678(defun xscheme-send-control-g-interrupt () 765(defun xscheme-send-control-g-interrupt ()
679 "Cause the Scheme processor to halt and flush input. 766 "Cause the Scheme processor to halt and flush input.
680Control returns to the top level rep loop." 767Control returns to the top level rep loop."
@@ -695,9 +782,6 @@ Control returns to the top level rep loop."
695 (sleep-for 0.1) 782 (sleep-for 0.1)
696 (xscheme-send-char 0))))) 783 (xscheme-send-char 0)))))
697 784
698(defconst xscheme-control-g-message-string
699 "Sending C-G interrupt to Scheme...")
700
701(defun xscheme-send-control-u-interrupt () 785(defun xscheme-send-control-u-interrupt ()
702 "Cause the Scheme process to halt, returning to previous rep loop." 786 "Cause the Scheme process to halt, returning to previous rep loop."
703 (interactive) 787 (interactive)
@@ -722,82 +806,6 @@ Control returns to the top level rep loop."
722 (if (and mark-p xscheme-control-g-synchronization-p) 806 (if (and mark-p xscheme-control-g-synchronization-p)
723 (xscheme-send-char 0))) 807 (xscheme-send-char 0)))
724 808
725;;;; Internal Variables
726
727(defvar xscheme-process-command-line nil
728 "Command used to start the most recent Scheme process.")
729
730(defvar xscheme-process-name "scheme"
731 "Name of xscheme process that we're currently interacting with.")
732
733(defvar xscheme-buffer-name "*scheme*"
734 "Name of xscheme buffer that we're currently interacting with.")
735
736(defvar xscheme-expressions-ring-max 30
737 "*Maximum length of Scheme expressions ring.")
738
739(defvar xscheme-expressions-ring nil
740 "List of expressions recently transmitted to the Scheme process.")
741
742(defvar xscheme-expressions-ring-yank-pointer nil
743 "The tail of the Scheme expressions ring whose car is the last thing yanked.")
744
745(defvar xscheme-last-input-end)
746
747(defvar xscheme-process-filter-state 'idle
748 "State of scheme process escape reader state machine:
749idle waiting for an escape sequence
750reading-type received an altmode but nothing else
751reading-string reading prompt string")
752
753(defvar xscheme-running-p nil
754 "This variable, if nil, indicates that the scheme process is
755waiting for input. Otherwise, it is busy evaluating something.")
756
757(defconst xscheme-control-g-synchronization-p t
758 "If non-nil, insert markers in the scheme input stream to indicate when
759control-g interrupts were signaled. Do not allow more control-g's to be
760signaled until the scheme process acknowledges receipt.")
761
762(defvar xscheme-control-g-disabled-p nil
763 "This variable, if non-nil, indicates that a control-g is being processed
764by the scheme process, so additional control-g's are to be ignored.")
765
766(defvar xscheme-allow-output-p t
767 "This variable, if nil, prevents output from the scheme process
768from being inserted into the process-buffer.")
769
770(defvar xscheme-prompt ""
771 "The current scheme prompt string.")
772
773(defvar xscheme-string-accumulator ""
774 "Accumulator for the string being received from the scheme process.")
775
776(defvar xscheme-string-receiver nil
777 "Procedure to send the string argument from the scheme process.")
778
779(defconst default-xscheme-runlight
780 '(": " xscheme-runlight-string)
781 "Default global (shared) xscheme-runlight modeline format.")
782
783(defvar xscheme-runlight "")
784(defvar xscheme-runlight-string nil)
785(defvar xscheme-mode-string nil)
786(setq-default scheme-mode-line-process
787 '("" xscheme-runlight))
788
789(mapcar 'make-variable-buffer-local
790 '(xscheme-expressions-ring
791 xscheme-expressions-ring-yank-pointer
792 xscheme-process-filter-state
793 xscheme-running-p
794 xscheme-control-g-disabled-p
795 xscheme-allow-output-p
796 xscheme-prompt
797 xscheme-string-accumulator
798 xscheme-mode-string
799 scheme-mode-line-process))
800
801;;;; Basic Process Control 809;;;; Basic Process Control
802 810
803(defun xscheme-start-process (command-line the-process the-buffer) 811(defun xscheme-start-process (command-line the-process the-buffer)
@@ -880,6 +888,61 @@ from being inserted into the process-buffer.")
880 "True iff the current buffer is the Scheme process buffer." 888 "True iff the current buffer is the Scheme process buffer."
881 (eq (xscheme-process-buffer) (current-buffer))) 889 (eq (xscheme-process-buffer) (current-buffer)))
882 890
891;;;; Process Filter Operations
892
893(defvar xscheme-process-filter-alist
894 '((?A xscheme-eval
895 xscheme-process-filter:string-action-noexcursion)
896 (?D xscheme-enter-debugger-mode
897 xscheme-process-filter:string-action)
898 (?E xscheme-eval
899 xscheme-process-filter:string-action)
900 (?P xscheme-set-prompt-variable
901 xscheme-process-filter:string-action)
902 (?R xscheme-enter-interaction-mode
903 xscheme-process-filter:simple-action)
904 (?b xscheme-start-gc
905 xscheme-process-filter:simple-action)
906 (?c xscheme-unsolicited-read-char
907 xscheme-process-filter:simple-action)
908 (?e xscheme-finish-gc
909 xscheme-process-filter:simple-action)
910 (?f xscheme-exit-input-wait
911 xscheme-process-filter:simple-action)
912 (?g xscheme-enable-control-g
913 xscheme-process-filter:simple-action)
914 (?i xscheme-prompt-for-expression
915 xscheme-process-filter:string-action)
916 (?m xscheme-message
917 xscheme-process-filter:string-action)
918 (?n xscheme-prompt-for-confirmation
919 xscheme-process-filter:string-action)
920 (?o xscheme-output-goto
921 xscheme-process-filter:simple-action)
922 (?p xscheme-set-prompt
923 xscheme-process-filter:string-action)
924 (?s xscheme-enter-input-wait
925 xscheme-process-filter:simple-action)
926 (?v xscheme-write-value
927 xscheme-process-filter:string-action)
928 (?w xscheme-cd
929 xscheme-process-filter:string-action)
930 (?z xscheme-display-process-buffer
931 xscheme-process-filter:simple-action))
932 "Table used to decide how to handle process filter commands.
933Value is a list of entries, each entry is a list of three items.
934
935The first item is the character that the process filter dispatches on.
936The second item is the action to be taken, a function.
937The third item is the handler for the entry, a function.
938
939When the process filter sees a command whose character matches a
940particular entry, it calls the handler with two arguments: the action
941and the string containing the rest of the process filter's input
942stream. It is the responsibility of the handler to invoke the action
943with the appropriate arguments, and to reenter the process filter with
944the remaining input.")
945
883;;;; Process Filter 946;;;; Process Filter
884 947
885(defun xscheme-process-sentinel (proc reason) 948(defun xscheme-process-sentinel (proc reason)
@@ -1037,61 +1100,6 @@ from being inserted into the process-buffer.")
1037 (rplaca (nthcdr 3 xscheme-runlight) runlight) 1100 (rplaca (nthcdr 3 xscheme-runlight) runlight)
1038 (force-mode-line-update t)) 1101 (force-mode-line-update t))
1039 1102
1040;;;; Process Filter Operations
1041
1042(defvar xscheme-process-filter-alist
1043 '((?A xscheme-eval
1044 xscheme-process-filter:string-action-noexcursion)
1045 (?D xscheme-enter-debugger-mode
1046 xscheme-process-filter:string-action)
1047 (?E xscheme-eval
1048 xscheme-process-filter:string-action)
1049 (?P xscheme-set-prompt-variable
1050 xscheme-process-filter:string-action)
1051 (?R xscheme-enter-interaction-mode
1052 xscheme-process-filter:simple-action)
1053 (?b xscheme-start-gc
1054 xscheme-process-filter:simple-action)
1055 (?c xscheme-unsolicited-read-char
1056 xscheme-process-filter:simple-action)
1057 (?e xscheme-finish-gc
1058 xscheme-process-filter:simple-action)
1059 (?f xscheme-exit-input-wait
1060 xscheme-process-filter:simple-action)
1061 (?g xscheme-enable-control-g
1062 xscheme-process-filter:simple-action)
1063 (?i xscheme-prompt-for-expression
1064 xscheme-process-filter:string-action)
1065 (?m xscheme-message
1066 xscheme-process-filter:string-action)
1067 (?n xscheme-prompt-for-confirmation
1068 xscheme-process-filter:string-action)
1069 (?o xscheme-output-goto
1070 xscheme-process-filter:simple-action)
1071 (?p xscheme-set-prompt
1072 xscheme-process-filter:string-action)
1073 (?s xscheme-enter-input-wait
1074 xscheme-process-filter:simple-action)
1075 (?v xscheme-write-value
1076 xscheme-process-filter:string-action)
1077 (?w xscheme-cd
1078 xscheme-process-filter:string-action)
1079 (?z xscheme-display-process-buffer
1080 xscheme-process-filter:simple-action))
1081 "Table used to decide how to handle process filter commands.
1082Value is a list of entries, each entry is a list of three items.
1083
1084The first item is the character that the process filter dispatches on.
1085The second item is the action to be taken, a function.
1086The third item is the handler for the entry, a function.
1087
1088When the process filter sees a command whose character matches a
1089particular entry, it calls the handler with two arguments: the action
1090and the string containing the rest of the process filter's input
1091stream. It is the responsibility of the handler to invoke the action
1092with the appropriate arguments, and to reenter the process filter with
1093the remaining input.")
1094
1095(defun xscheme-process-filter:simple-action (action) 1103(defun xscheme-process-filter:simple-action (action)
1096 (setq xscheme-process-filter-state 'idle) 1104 (setq xscheme-process-filter-state 'idle)
1097 (funcall action)) 1105 (funcall action))
@@ -1196,10 +1204,6 @@ the remaining input.")
1196(defun xscheme-prompt-for-confirmation (prompt-string) 1204(defun xscheme-prompt-for-confirmation (prompt-string)
1197 (xscheme-send-char (if (y-or-n-p prompt-string) ?y ?n))) 1205 (xscheme-send-char (if (y-or-n-p prompt-string) ?y ?n)))
1198 1206
1199(defun xscheme-prompt-for-expression (prompt-string)
1200 (xscheme-send-string-2
1201 (read-from-minibuffer prompt-string nil xscheme-prompt-for-expression-map)))
1202
1203(defvar xscheme-prompt-for-expression-map nil) 1207(defvar xscheme-prompt-for-expression-map nil)
1204(if (not xscheme-prompt-for-expression-map) 1208(if (not xscheme-prompt-for-expression-map)
1205 (progn 1209 (progn
@@ -1209,6 +1213,10 @@ the remaining input.")
1209 'xscheme-prompt-for-expression-exit 1213 'xscheme-prompt-for-expression-exit
1210 xscheme-prompt-for-expression-map))) 1214 xscheme-prompt-for-expression-map)))
1211 1215
1216(defun xscheme-prompt-for-expression (prompt-string)
1217 (xscheme-send-string-2
1218 (read-from-minibuffer prompt-string nil xscheme-prompt-for-expression-map)))
1219
1212(defun xscheme-prompt-for-expression-exit () 1220(defun xscheme-prompt-for-expression-exit ()
1213 (interactive) 1221 (interactive)
1214 (if (eq (xscheme-region-expression-p (point-min) (point-max)) 'one) 1222 (if (eq (xscheme-region-expression-p (point-min) (point-max)) 'one)