diff options
Diffstat (limited to 'lisp/term.el')
| -rw-r--r-- | lisp/term.el | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lisp/term.el b/lisp/term.el index 471d7830de0..4d319c253ae 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -1221,6 +1221,7 @@ without any interpretation." | |||
| 1221 | ;; Which would be better: "\e[A" or "\eOA"? readline accepts either. | 1221 | ;; Which would be better: "\e[A" or "\eOA"? readline accepts either. |
| 1222 | ;; For my configuration it's definitely better \eOA but YMMV. -mm | 1222 | ;; For my configuration it's definitely better \eOA but YMMV. -mm |
| 1223 | ;; For example: vi works with \eOA while elm wants \e[A ... | 1223 | ;; For example: vi works with \eOA while elm wants \e[A ... |
| 1224 | ;;; (terminfo: kcuu1, kcud1, kcuf1, kcub1, khome, kend, kpp, knp, kdch1, kbs) | ||
| 1224 | (defun term-send-up () (interactive) (term-send-raw-string "\eOA")) | 1225 | (defun term-send-up () (interactive) (term-send-raw-string "\eOA")) |
| 1225 | (defun term-send-down () (interactive) (term-send-raw-string "\eOB")) | 1226 | (defun term-send-down () (interactive) (term-send-raw-string "\eOB")) |
| 1226 | (defun term-send-right () (interactive) (term-send-raw-string "\eOC")) | 1227 | (defun term-send-right () (interactive) (term-send-raw-string "\eOC")) |
| @@ -2819,7 +2820,7 @@ See `term-prompt-regexp'." | |||
| 2819 | (1- (- term-width (term-current-column))))) | 2820 | (1- (- term-width (term-current-column))))) |
| 2820 | (when (= term-width (term-current-column)) | 2821 | (when (= term-width (term-current-column)) |
| 2821 | (term-move-columns -1)))) | 2822 | (term-move-columns -1)))) |
| 2822 | ((eq char ?\r) | 2823 | ((eq char ?\r) ;; (terminfo: cr) |
| 2823 | ;; Optimize CRLF at end of buffer: | 2824 | ;; Optimize CRLF at end of buffer: |
| 2824 | (cond ((and (< (setq temp (1+ i)) str-length) | 2825 | (cond ((and (< (setq temp (1+ i)) str-length) |
| 2825 | (eq (aref str temp) ?\n) | 2826 | (eq (aref str temp) ?\n) |
| @@ -2835,7 +2836,7 @@ See `term-prompt-regexp'." | |||
| 2835 | (t ;; Not followed by LF or can't optimize: | 2836 | (t ;; Not followed by LF or can't optimize: |
| 2836 | (term-vertical-motion 0) | 2837 | (term-vertical-motion 0) |
| 2837 | (setq term-current-column term-start-line-column)))) | 2838 | (setq term-current-column term-start-line-column)))) |
| 2838 | ((eq char ?\n) | 2839 | ((eq char ?\n) ;; (terminfo: cud1, ind) |
| 2839 | (if (not (and term-kill-echo-list | 2840 | (if (not (and term-kill-echo-list |
| 2840 | (term-check-kill-echo-list))) | 2841 | (term-check-kill-echo-list))) |
| 2841 | (term-down 1 t))) | 2842 | (term-down 1 t))) |
| @@ -2846,16 +2847,15 @@ See `term-prompt-regexp'." | |||
| 2846 | ((eq char 0)) ; NUL: Do nothing | 2847 | ((eq char 0)) ; NUL: Do nothing |
| 2847 | ((eq char ?\016)) ; Shift Out - ignored | 2848 | ((eq char ?\016)) ; Shift Out - ignored |
| 2848 | ((eq char ?\017)) ; Shift In - ignored | 2849 | ((eq char ?\017)) ; Shift In - ignored |
| 2849 | ((eq char ?\^G) | 2850 | ((eq char ?\^G) ;; (terminfo: bel) |
| 2850 | (beep t)) ; Bell | 2851 | (beep t)) |
| 2851 | ((eq char ?\032) | 2852 | ((eq char ?\032) |
| 2852 | (let ((end (string-match "\r?$" str i))) | 2853 | (let ((end (string-match "\r?$" str i))) |
| 2853 | (if end | 2854 | (if end |
| 2854 | (funcall term-command-hook | 2855 | (funcall term-command-hook |
| 2855 | (prog1 (substring str (1+ i) end) | 2856 | (prog1 (substring str (1+ i) end) |
| 2856 | (setq i (match-end 0)))) | 2857 | (setq i (match-end 0)))) |
| 2857 | (setq term-terminal-parameter | 2858 | (setq term-terminal-parameter (substring str i)) |
| 2858 | (substring str i)) | ||
| 2859 | (setq term-terminal-state 4) | 2859 | (setq term-terminal-state 4) |
| 2860 | (setq i str-length)))) | 2860 | (setq i str-length)))) |
| 2861 | (t ; insert char FIXME: Should never happen | 2861 | (t ; insert char FIXME: Should never happen |
| @@ -3072,7 +3072,7 @@ See `term-prompt-regexp'." | |||
| 3072 | ((eq parameter 5) | 3072 | ((eq parameter 5) |
| 3073 | (setq term-ansi-current-bold t)) | 3073 | (setq term-ansi-current-bold t)) |
| 3074 | 3074 | ||
| 3075 | ;;; Reverse | 3075 | ;;; Reverse (terminfo: smso) |
| 3076 | ((eq parameter 7) | 3076 | ((eq parameter 7) |
| 3077 | (setq term-ansi-current-reverse t)) | 3077 | (setq term-ansi-current-reverse t)) |
| 3078 | 3078 | ||
| @@ -3080,11 +3080,11 @@ See `term-prompt-regexp'." | |||
| 3080 | ((eq parameter 8) | 3080 | ((eq parameter 8) |
| 3081 | (setq term-ansi-current-invisible t)) | 3081 | (setq term-ansi-current-invisible t)) |
| 3082 | 3082 | ||
| 3083 | ;;; Reset underline (i.e. terminfo rmul) | 3083 | ;;; Reset underline (terminfo: rmul) |
| 3084 | ((eq parameter 24) | 3084 | ((eq parameter 24) |
| 3085 | (setq term-ansi-current-underline nil)) | 3085 | (setq term-ansi-current-underline nil)) |
| 3086 | 3086 | ||
| 3087 | ;;; Reset reverse (i.e. terminfo rmso) | 3087 | ;;; Reset reverse (terminfo: rmso) |
| 3088 | ((eq parameter 27) | 3088 | ((eq parameter 27) |
| 3089 | (setq term-ansi-current-reverse nil)) | 3089 | (setq term-ansi-current-reverse nil)) |
| 3090 | 3090 | ||
| @@ -3189,7 +3189,7 @@ See `term-prompt-regexp'." | |||
| 3189 | 3189 | ||
| 3190 | (defun term-handle-ansi-escape (proc char) | 3190 | (defun term-handle-ansi-escape (proc char) |
| 3191 | (cond | 3191 | (cond |
| 3192 | ((or (eq char ?H) ; cursor motion (terminfo: cup) | 3192 | ((or (eq char ?H) ; cursor motion (terminfo: cup,home) |
| 3193 | ;; (eq char ?f) ; xterm seems to handle this sequence too, not | 3193 | ;; (eq char ?f) ; xterm seems to handle this sequence too, not |
| 3194 | ;; needed for now | 3194 | ;; needed for now |
| 3195 | ) | 3195 | ) |
| @@ -3211,7 +3211,7 @@ See `term-prompt-regexp'." | |||
| 3211 | ;; \E[B - cursor down (terminfo: cud) | 3211 | ;; \E[B - cursor down (terminfo: cud) |
| 3212 | ((eq char ?B) | 3212 | ((eq char ?B) |
| 3213 | (term-down (max 1 term-terminal-parameter) t)) | 3213 | (term-down (max 1 term-terminal-parameter) t)) |
| 3214 | ;; \E[C - cursor right (terminfo: cuf) | 3214 | ;; \E[C - cursor right (terminfo: cuf, cuf1) |
| 3215 | ((eq char ?C) | 3215 | ((eq char ?C) |
| 3216 | (term-move-columns | 3216 | (term-move-columns |
| 3217 | (max 1 | 3217 | (max 1 |
| @@ -3230,14 +3230,14 @@ See `term-prompt-regexp'." | |||
| 3230 | ;; \E[L - insert lines (terminfo: il, il1) | 3230 | ;; \E[L - insert lines (terminfo: il, il1) |
| 3231 | ((eq char ?L) | 3231 | ((eq char ?L) |
| 3232 | (term-insert-lines (max 1 term-terminal-parameter))) | 3232 | (term-insert-lines (max 1 term-terminal-parameter))) |
| 3233 | ;; \E[M - delete lines | 3233 | ;; \E[M - delete lines (terminfo: dl, dl1) |
| 3234 | ((eq char ?M) | 3234 | ((eq char ?M) |
| 3235 | (term-delete-lines (max 1 term-terminal-parameter))) | 3235 | (term-delete-lines (max 1 term-terminal-parameter))) |
| 3236 | ;; \E[P - delete chars | 3236 | ;; \E[P - delete chars (terminfo: dch, dch1) |
| 3237 | ((eq char ?P) | 3237 | ((eq char ?P) |
| 3238 | (term-delete-chars (max 1 term-terminal-parameter))) | 3238 | (term-delete-chars (max 1 term-terminal-parameter))) |
| 3239 | ;; \E[@ - insert spaces | 3239 | ;; \E[@ - insert spaces (terminfo: ich) |
| 3240 | ((eq char ?@) ;; (terminfo: ich) | 3240 | ((eq char ?@) |
| 3241 | (term-insert-spaces (max 1 term-terminal-parameter))) | 3241 | (term-insert-spaces (max 1 term-terminal-parameter))) |
| 3242 | ;; \E[?h - DEC Private Mode Set | 3242 | ;; \E[?h - DEC Private Mode Set |
| 3243 | ((eq char ?h) | 3243 | ((eq char ?h) |