diff options
| author | Chong Yidong | 2012-06-20 17:21:06 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-06-20 17:21:06 +0800 |
| commit | 6ff7caa835cacb770d9021b73516a51bf0e2b2e9 (patch) | |
| tree | 35874d91593a29de8e7efefb6e5d6c2dadbbae59 | |
| parent | 32f7f28e027bc7f937637f05f218b8d8c5283196 (diff) | |
| download | emacs-6ff7caa835cacb770d9021b73516a51bf0e2b2e9.tar.gz emacs-6ff7caa835cacb770d9021b73516a51bf0e2b2e9.zip | |
Change term.el to use font-lock.
* term.el (term-mode): Set font-lock-defaults.
(term-move-columns, term-insert-char, term-emulate-terminal)
(term-erase-in-line, term-insert-spaces): Use font-lock-face.
Fixes: debbugs:7692
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/term.el | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d08b972c23a..cb11ea132db 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -3,7 +3,10 @@ | |||
| 3 | * term.el (term-window-width): Handle the case of a missing right | 3 | * term.el (term-window-width): Handle the case of a missing right |
| 4 | fringe (Bug#8837). | 4 | fringe (Bug#8837). |
| 5 | (term-check-size): Use window-text-height (Bug#5445). | 5 | (term-check-size): Use window-text-height (Bug#5445). |
| 6 | (term-mode): Use define-derived-mode. Minor cleanups. | 6 | (term-mode): Use define-derived-mode. Minor cleanups. Set |
| 7 | font-lock-defaults (Bug#7692). | ||
| 8 | (term-move-columns, term-insert-char, term-emulate-terminal) | ||
| 9 | (term-erase-in-line, term-insert-spaces): Use font-lock-face. | ||
| 7 | 10 | ||
| 8 | 2012-06-20 Michael Albinus <michael.albinus@gmx.de> | 11 | 2012-06-20 Michael Albinus <michael.albinus@gmx.de> |
| 9 | 12 | ||
diff --git a/lisp/term.el b/lisp/term.el index 1d56cf835a6..0dc843c5df7 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -1100,7 +1100,9 @@ Entry to this mode runs the hooks on `term-mode-hook'." | |||
| 1100 | (set (make-local-variable 'term-pending-frame) nil) | 1100 | (set (make-local-variable 'term-pending-frame) nil) |
| 1101 | ;; Cua-mode's keybindings interfere with the term keybindings, disable it. | 1101 | ;; Cua-mode's keybindings interfere with the term keybindings, disable it. |
| 1102 | (set (make-local-variable 'cua-mode) nil) | 1102 | (set (make-local-variable 'cua-mode) nil) |
| 1103 | (run-mode-hooks 'term-mode-hook) | 1103 | |
| 1104 | (set (make-local-variable 'font-lock-defaults) '(nil t)) | ||
| 1105 | |||
| 1104 | (when (featurep 'xemacs) | 1106 | (when (featurep 'xemacs) |
| 1105 | (set-buffer-menubar | 1107 | (set-buffer-menubar |
| 1106 | (append current-menubar (list term-terminal-menu)))) | 1108 | (append current-menubar (list term-terminal-menu)))) |
| @@ -2583,13 +2585,13 @@ See `term-prompt-regexp'." | |||
| 2583 | ;; from the last character on the line, set the face for the chars | 2585 | ;; from the last character on the line, set the face for the chars |
| 2584 | ;; to default. | 2586 | ;; to default. |
| 2585 | (when (> (point) point-at-eol) | 2587 | (when (> (point) point-at-eol) |
| 2586 | (put-text-property point-at-eol (point) 'face 'default)))) | 2588 | (put-text-property point-at-eol (point) 'font-lock-face 'default)))) |
| 2587 | 2589 | ||
| 2588 | ;; Insert COUNT copies of CHAR in the default face. | 2590 | ;; Insert COUNT copies of CHAR in the default face. |
| 2589 | (defun term-insert-char (char count) | 2591 | (defun term-insert-char (char count) |
| 2590 | (let ((old-point (point))) | 2592 | (let ((old-point (point))) |
| 2591 | (insert-char char count) | 2593 | (insert-char char count) |
| 2592 | (put-text-property old-point (point) 'face 'default))) | 2594 | (put-text-property old-point (point) 'font-lock-face 'default))) |
| 2593 | 2595 | ||
| 2594 | (defun term-current-row () | 2596 | (defun term-current-row () |
| 2595 | (cond (term-current-row) | 2597 | (cond (term-current-row) |
| @@ -2813,7 +2815,7 @@ See `term-prompt-regexp'." | |||
| 2813 | (setq term-current-column nil) | 2815 | (setq term-current-column nil) |
| 2814 | 2816 | ||
| 2815 | (put-text-property old-point (point) | 2817 | (put-text-property old-point (point) |
| 2816 | 'face term-current-face) | 2818 | 'font-lock-face term-current-face) |
| 2817 | ;; If the last char was written in last column, | 2819 | ;; If the last char was written in last column, |
| 2818 | ;; back up one column, but remember we did so. | 2820 | ;; back up one column, but remember we did so. |
| 2819 | ;; Thus we emulate xterm/vt100-style line-wrapping. | 2821 | ;; Thus we emulate xterm/vt100-style line-wrapping. |
| @@ -3713,7 +3715,7 @@ all pending output has been dealt with.")) | |||
| 3713 | (when wrapped | 3715 | (when wrapped |
| 3714 | (insert ? )) | 3716 | (insert ? )) |
| 3715 | (insert ?\n) | 3717 | (insert ?\n) |
| 3716 | (put-text-property saved-point (point) 'face 'default) | 3718 | (put-text-property saved-point (point) 'font-lock-face 'default) |
| 3717 | (goto-char saved-point)))) | 3719 | (goto-char saved-point)))) |
| 3718 | 3720 | ||
| 3719 | (defun term-erase-in-display (kind) | 3721 | (defun term-erase-in-display (kind) |
| @@ -3761,7 +3763,7 @@ if KIND is 1, erase from home to point; else erase from home to point-max." | |||
| 3761 | ;; from the last character on the line, set the face for the chars | 3763 | ;; from the last character on the line, set the face for the chars |
| 3762 | ;; to default. | 3764 | ;; to default. |
| 3763 | (when (>= (point) pnt-at-eol) | 3765 | (when (>= (point) pnt-at-eol) |
| 3764 | (put-text-property pnt-at-eol (point) 'face 'default)) | 3766 | (put-text-property pnt-at-eol (point) 'font-lock-face 'default)) |
| 3765 | (when (> save-eol (point)) | 3767 | (when (> save-eol (point)) |
| 3766 | (delete-region (point) save-eol)) | 3768 | (delete-region (point) save-eol)) |
| 3767 | (goto-char save-point) | 3769 | (goto-char save-point) |