aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2002-06-10 06:20:33 +0000
committerMiles Bader2002-06-10 06:20:33 +0000
commit8b1d2946a2f9e6779c405ee81f0162470d2eb79b (patch)
tree32841ad01ca094492f70b20167eec6f2e61b0b29
parent4abe16b531dc2596efe075fc612949d2b492da68 (diff)
downloademacs-8b1d2946a2f9e6779c405ee81f0162470d2eb79b.tar.gz
emacs-8b1d2946a2f9e6779c405ee81f0162470d2eb79b.zip
(comint-send-input, comint-output-filter): Use the `font-lock-face'
property instead of `face'. Don't check the highlight-enabling variables anymore. (comint-highlight-input, comint-highlight-prompt): Variables removed.
-rw-r--r--lisp/comint.el66
1 files changed, 27 insertions, 39 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index aa5dfdfc846..ca6f2e6f018 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1,6 +1,6 @@
1;;; comint.el --- general command interpreter in a window stuff 1;;; comint.el --- general command interpreter in a window stuff
2 2
3;; Copyright (C) 1988, 90, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 3;; Copyright (C) 1988, 90, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Olin Shivers <shivers@cs.cmu.edu> 6;; Author: Olin Shivers <shivers@cs.cmu.edu>
@@ -204,26 +204,14 @@ This variable is buffer-local."
204 (other :tag "on" t)) 204 (other :tag "on" t))
205 :group 'comint) 205 :group 'comint)
206 206
207(defcustom comint-highlight-input t
208 "*If non-nil, highlight input; also allow choosing previous input with a mouse.
209The face used is `comint-highlight-input'."
210 :type 'boolean
211 :group 'comint)
212
213(defface comint-highlight-input '((t (:weight bold))) 207(defface comint-highlight-input '((t (:weight bold)))
214 "Face to use to highlight input when `comint-highlight-input' is non-nil." 208 "Face to use to highlight user input."
215 :group 'comint)
216
217(defcustom comint-highlight-prompt t
218 "*If non-nil, highlight program prompts.
219The face used is `comint-highlight-prompt'."
220 :type 'boolean
221 :group 'comint) 209 :group 'comint)
222 210
223(defface comint-highlight-prompt 211(defface comint-highlight-prompt
224 '((((background dark)) (:foreground "cyan")) 212 '((((background dark)) (:foreground "cyan"))
225 (t (:foreground "dark blue"))) 213 (t (:foreground "dark blue")))
226 "Face to use to highlight prompt when `comint-highlight-prompt' is non-nil." 214 "Face to use to highlight prompts."
227 :group 'comint) 215 :group 'comint)
228 216
229(defcustom comint-input-ignoredups nil 217(defcustom comint-input-ignoredups nil
@@ -521,6 +509,8 @@ Entry to this mode runs the hooks on `comint-mode-hook'."
521 (make-local-variable 'comint-file-name-chars) 509 (make-local-variable 'comint-file-name-chars)
522 (make-local-variable 'comint-file-name-quote-list) 510 (make-local-variable 'comint-file-name-quote-list)
523 (set (make-local-variable 'comint-accum-marker) (make-marker)) 511 (set (make-local-variable 'comint-accum-marker) (make-marker))
512 (set (make-local-variable 'font-lock-defaults)
513 '(nil t nil nil nil (font-lock-core-only . t)))
524 ;; This behavior is not useful in comint buffers, and is annoying 514 ;; This behavior is not useful in comint buffers, and is annoying
525 (set (make-local-variable 'next-line-add-newlines) nil)) 515 (set (make-local-variable 'next-line-add-newlines) nil))
526 516
@@ -1469,13 +1459,12 @@ Similarly for Soar, Scheme, etc."
1469 ;; `boundary' field to make cursor movement between input 1459 ;; `boundary' field to make cursor movement between input
1470 ;; and output fields smoother. 1460 ;; and output fields smoother.
1471 (overlay-put over 'field 'input)) 1461 (overlay-put over 'field 'input))
1472 (when comint-highlight-input 1462 (overlay-put over 'font-lock-face 'comint-highlight-input)
1473 (overlay-put over 'face 'comint-highlight-input) 1463 (overlay-put over 'mouse-face 'highlight)
1474 (overlay-put over 'mouse-face 'highlight) 1464 (overlay-put over
1475 (overlay-put over 1465 'help-echo
1476 'help-echo 1466 "mouse-2: insert after prompt as new input")
1477 "mouse-2: insert after prompt as new input") 1467 (overlay-put over 'evaporate t)))
1478 (overlay-put over 'evaporate t))))
1479 (unless comint-use-prompt-regexp-instead-of-fields 1468 (unless comint-use-prompt-regexp-instead-of-fields
1480 ;; Make an overlay for the terminating newline 1469 ;; Make an overlay for the terminating newline
1481 (let ((over (make-overlay end (1+ end) nil t nil))) 1470 (let ((over (make-overlay end (1+ end) nil t nil)))
@@ -1698,23 +1687,22 @@ This function should be in the list `comint-output-filter-functions'."
1698 (overlay-put over 'evaporate t) 1687 (overlay-put over 'evaporate t)
1699 (setq comint-last-output-overlay over)))) 1688 (setq comint-last-output-overlay over))))
1700 1689
1701 (when comint-highlight-prompt 1690 ;; Highlight the prompt, where we define `prompt' to mean
1702 ;; Highlight the prompt, where we define `prompt' to mean 1691 ;; the most recent output that doesn't end with a newline.
1703 ;; the most recent output that doesn't end with a newline. 1692 (unless (and (bolp) (null comint-last-prompt-overlay))
1704 (unless (and (bolp) (null comint-last-prompt-overlay)) 1693 ;; Need to create or move the prompt overlay (in the case
1705 ;; Need to create or move the prompt overlay (in the case 1694 ;; where there is no prompt ((bolp) == t), we still do
1706 ;; where there is no prompt ((bolp) == t), we still do 1695 ;; this if there's already an existing overlay).
1707 ;; this if there's already an existing overlay). 1696 (let ((prompt-start (save-excursion (forward-line 0) (point))))
1708 (let ((prompt-start (save-excursion (forward-line 0) (point)))) 1697 (if comint-last-prompt-overlay
1709 (if comint-last-prompt-overlay 1698 ;; Just move an existing overlay
1710 ;; Just move an existing overlay 1699 (move-overlay comint-last-prompt-overlay
1711 (move-overlay comint-last-prompt-overlay 1700 prompt-start (point))
1712 prompt-start (point)) 1701 ;; Need to create the overlay
1713 ;; Need to create the overlay 1702 (setq comint-last-prompt-overlay
1714 (setq comint-last-prompt-overlay 1703 (make-overlay prompt-start (point)))
1715 (make-overlay prompt-start (point))) 1704 (overlay-put comint-last-prompt-overlay
1716 (overlay-put comint-last-prompt-overlay 1705 'font-lock-face 'comint-highlight-prompt))))
1717 'face 'comint-highlight-prompt)))))
1718 1706
1719 (goto-char saved-point) 1707 (goto-char saved-point)
1720 1708