diff options
| author | Kim F. Storm | 2004-09-17 21:07:12 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-09-17 21:07:12 +0000 |
| commit | 502a4ee98f96342702eb12b503a6340b2908abd8 (patch) | |
| tree | c0a03de9c55b75c75baa4d2357717300e93c246d | |
| parent | 6e3654ab66edc70bcc14c6ede58e74aa313d0d17 (diff) | |
| download | emacs-502a4ee98f96342702eb12b503a6340b2908abd8.tar.gz emacs-502a4ee98f96342702eb12b503a6340b2908abd8.zip | |
From Dan Nicolaescu <dann@ics.uci.edu>
(term-down): Perform vertical motion if DOWN is negative.
(term-exec-1): Set both TERMCAP and TERMINFO unconditionally.
(term-termcap-format): Synchronyze with the eterm terminfo entry
in etc/e/eterm.ti.
(term-handle-colors-array): If the current foreground or
background are zero (i.e. unspecified), use the foreground and
background of the default face for reverse video.
(term-ansi-at-eval-string, term-ansi-default-fg)
(term-ansi-default-bg, term-ansi-current-temp): Delete unused variable.
(term-mem): Delete ununsed function.
(term-protocol-version): Increment.
(term-current-face): Set to default.
| -rw-r--r-- | lisp/term.el | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/lisp/term.el b/lisp/term.el index 590a9b0a1d5..ffe64331d41 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -396,7 +396,7 @@ | |||
| 396 | 396 | ||
| 397 | ;; This is passed to the inferior in the EMACS environment variable, | 397 | ;; This is passed to the inferior in the EMACS environment variable, |
| 398 | ;; so it is important to increase it if there are protocol-relevant changes. | 398 | ;; so it is important to increase it if there are protocol-relevant changes. |
| 399 | (defconst term-protocol-version "0.95") | 399 | (defconst term-protocol-version "0.96") |
| 400 | 400 | ||
| 401 | (eval-when-compile | 401 | (eval-when-compile |
| 402 | (require 'ange-ftp)) | 402 | (require 'ange-ftp)) |
| @@ -457,7 +457,7 @@ | |||
| 457 | ;; we want suppressed. | 457 | ;; we want suppressed. |
| 458 | (defvar term-terminal-parameter) | 458 | (defvar term-terminal-parameter) |
| 459 | (defvar term-terminal-previous-parameter) | 459 | (defvar term-terminal-previous-parameter) |
| 460 | (defvar term-current-face 'term-default) | 460 | (defvar term-current-face 'default) |
| 461 | (defvar term-scroll-start 0) ;; Top-most line (inclusive) of scrolling region. | 461 | (defvar term-scroll-start 0) ;; Top-most line (inclusive) of scrolling region. |
| 462 | (defvar term-scroll-end) ;; Number of line (zero-based) after scrolling region. | 462 | (defvar term-scroll-end) ;; Number of line (zero-based) after scrolling region. |
| 463 | (defvar term-pager-count nil) ;; If nil, paging is disabled. | 463 | (defvar term-pager-count nil) ;; If nil, paging is disabled. |
| @@ -1365,11 +1365,14 @@ The main purpose is to get rid of the local keymap." | |||
| 1365 | (defvar term-termcap-format | 1365 | (defvar term-termcap-format |
| 1366 | "%s%s:li#%d:co#%d:cl=\\E[H\\E[J:cd=\\E[J:bs:am:xn:cm=\\E[%%i%%d;%%dH\ | 1366 | "%s%s:li#%d:co#%d:cl=\\E[H\\E[J:cd=\\E[J:bs:am:xn:cm=\\E[%%i%%d;%%dH\ |
| 1367 | :nd=\\E[C:up=\\E[A:ce=\\E[K:ho=\\E[H:pt\ | 1367 | :nd=\\E[C:up=\\E[A:ce=\\E[K:ho=\\E[H:pt\ |
| 1368 | :al=\\E[L:dl=\\E[M:DL=\\E[%%dM:AL=\\E[%%dL:cs=\\E[%%i%%d;%%dr:sf=\\n\ | 1368 | :al=\\E[L:dl=\\E[M:DL=\\E[%%dM:AL=\\E[%%dL:cs=\\E[%%i%%d;%%dr:sf=^J\ |
| 1369 | :te=\\E[2J\\E[?47l\\E8:ti=\\E7\\E[?47h\ | 1369 | :te=\\E[2J\\E[?47l\\E8:ti=\\E7\\E[?47h\ |
| 1370 | :dc=\\E[P:DC=\\E[%%dP:IC=\\E[%%d@:im=\\E[4h:ei=\\E[4l:mi:\ | 1370 | :dc=\\E[P:DC=\\E[%%dP:IC=\\E[%%d@:im=\\E[4h:ei=\\E[4l:mi:\ |
| 1371 | :so=\\E[7m:se=\\E[m:us=\\E[4m:ue=\\E[m:md=\\E[1m:mr=\\E[7m:me=\\E[m\ | 1371 | :so=\\E[7m:se=\\E[m:us=\\E[4m:ue=\\E[m:md=\\E[1m:mr=\\E[7m:me=\\E[m\ |
| 1372 | :UP=\\E[%%dA:DO=\\E[%%dB:LE=\\E[%%dD:RI=\\E[%%dC" | 1372 | :UP=\\E[%%dA:DO=\\E[%%dB:LE=\\E[%%dD:RI=\\E[%%dC\ |
| 1373 | :kl=\\EOD:kd=\\EOB:kr=\\EOC:ku=\\EOA:kN=\\E[6~:kP=\\E[5~:@7=\\E[4~:kh=\\E[1~\ | ||
| 1374 | :mk=\\E[8m:cb=\\E[1K:op=\\E[39;49m:Co#8:pa#64:AB=\\E[4%%dm:AF=\\E[3%%dm:cr=^M\ | ||
| 1375 | :bl=^G:do=^J:le=^H:ta=^I:se=\E[27m:ue=\E24m:" | ||
| 1373 | ;;; : -undefine ic | 1376 | ;;; : -undefine ic |
| 1374 | "termcap capabilities supported") | 1377 | "termcap capabilities supported") |
| 1375 | 1378 | ||
| @@ -1386,10 +1389,9 @@ The main purpose is to get rid of the local keymap." | |||
| 1386 | (nconc | 1389 | (nconc |
| 1387 | (list | 1390 | (list |
| 1388 | (format "TERM=%s" term-term-name) | 1391 | (format "TERM=%s" term-term-name) |
| 1389 | (if (and (boundp 'system-uses-terminfo) system-uses-terminfo) | 1392 | (format "TERMINFO=%s" data-directory) |
| 1390 | (format "TERMINFO=%s" data-directory) | 1393 | (format term-termcap-format "TERMCAP=" |
| 1391 | (format term-termcap-format "TERMCAP=" | 1394 | term-term-name term-height term-width) |
| 1392 | term-term-name term-height term-width)) | ||
| 1393 | ;; Breaks `./configure' of w3 and url which try to run $EMACS. | 1395 | ;; Breaks `./configure' of w3 and url which try to run $EMACS. |
| 1394 | (format "EMACS=%s (term:%s)" emacs-version term-protocol-version) | 1396 | (format "EMACS=%s (term:%s)" emacs-version term-protocol-version) |
| 1395 | (format "LINES=%d" term-height) | 1397 | (format "LINES=%d" term-height) |
| @@ -1409,18 +1411,6 @@ if [ $1 = .. ]; then shift; fi; exec \"$@\"" | |||
| 1409 | ".." | 1411 | ".." |
| 1410 | command switches))) | 1412 | command switches))) |
| 1411 | 1413 | ||
| 1412 | ;;; This should be in Emacs, but it isn't. | ||
| 1413 | (defun term-mem (item list &optional elt=) | ||
| 1414 | "Test to see if ITEM is equal to an item in LIST. | ||
| 1415 | Option comparison function ELT= defaults to equal." | ||
| 1416 | (let ((elt= (or elt= (function equal))) | ||
| 1417 | (done nil)) | ||
| 1418 | (while (and list (not done)) | ||
| 1419 | (if (funcall elt= item (car list)) | ||
| 1420 | (setq done list) | ||
| 1421 | (setq list (cdr list)))) | ||
| 1422 | done)) | ||
| 1423 | |||
| 1424 | 1414 | ||
| 1425 | ;;; Input history processing in a buffer | 1415 | ;;; Input history processing in a buffer |
| 1426 | ;;; =========================================================================== | 1416 | ;;; =========================================================================== |
| @@ -2990,6 +2980,14 @@ See `term-prompt-regexp'." | |||
| 2990 | ((eq parameter 8) | 2980 | ((eq parameter 8) |
| 2991 | (setq term-ansi-current-invisible 1)) | 2981 | (setq term-ansi-current-invisible 1)) |
| 2992 | 2982 | ||
| 2983 | ;;; Reset reverse (i.e. terminfo rmso) | ||
| 2984 | ((eq parameter 24) | ||
| 2985 | (setq term-ansi-current-reverse 0)) | ||
| 2986 | |||
| 2987 | ;;; Reset underline (i.e. terminfo rmul) | ||
| 2988 | ((eq parameter 27) | ||
| 2989 | (setq term-ansi-current-underline 0)) | ||
| 2990 | |||
| 2993 | ;;; Foreground | 2991 | ;;; Foreground |
| 2994 | ((and (>= parameter 30) (<= parameter 37)) | 2992 | ((and (>= parameter 30) (<= parameter 37)) |
| 2995 | (setq term-ansi-current-color (- parameter 29))) | 2993 | (setq term-ansi-current-color (- parameter 29))) |
| @@ -3044,9 +3042,13 @@ See `term-prompt-regexp'." | |||
| 3044 | ) | 3042 | ) |
| 3045 | (setq term-current-face | 3043 | (setq term-current-face |
| 3046 | (list :background | 3044 | (list :background |
| 3047 | (elt ansi-term-color-vector term-ansi-current-color) | 3045 | (if (= term-ansi-current-color 0) |
| 3046 | (face-foreground 'default) | ||
| 3047 | (elt ansi-term-color-vector term-ansi-current-color)) | ||
| 3048 | :foreground | 3048 | :foreground |
| 3049 | (elt ansi-term-color-vector term-ansi-current-bg-color))) | 3049 | (if (= term-ansi-current-bg-color 0) |
| 3050 | (face-background 'default) | ||
| 3051 | (elt ansi-term-color-vector term-ansi-current-bg-color)))) | ||
| 3050 | (if (= term-ansi-current-bold 1) | 3052 | (if (= term-ansi-current-bold 1) |
| 3051 | (setq term-current-face | 3053 | (setq term-current-face |
| 3052 | (append '(:weight bold) term-current-face))) | 3054 | (append '(:weight bold) term-current-face))) |
| @@ -3503,7 +3505,7 @@ all pending output has been dealt with.")) | |||
| 3503 | (if (and check-for-scroll (or term-scroll-with-delete term-pager-count)) | 3505 | (if (and check-for-scroll (or term-scroll-with-delete term-pager-count)) |
| 3504 | (setq down (term-handle-scroll down))) | 3506 | (setq down (term-handle-scroll down))) |
| 3505 | (term-adjust-current-row-cache down) | 3507 | (term-adjust-current-row-cache down) |
| 3506 | (if (/= (point) (point-max)) | 3508 | (if (or (/= (point) (point-max)) (< down 0)) |
| 3507 | (setq down (- down (term-vertical-motion down)))) | 3509 | (setq down (- down (term-vertical-motion down)))) |
| 3508 | ;; Extend buffer with extra blank lines if needed. | 3510 | ;; Extend buffer with extra blank lines if needed. |
| 3509 | (cond ((> down 0) | 3511 | (cond ((> down 0) |