aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2004-09-26 18:39:10 +0000
committerDan Nicolaescu2004-09-26 18:39:10 +0000
commitaecde54d18fa9b6d9addbe116899dcb65708da7e (patch)
tree29684836b0e1089c114222c8fcd59e7b358cd454
parent143e9e6aa1313fb1cbc33314464416d1a6d54e72 (diff)
downloademacs-aecde54d18fa9b6d9addbe116899dcb65708da7e.tar.gz
emacs-aecde54d18fa9b6d9addbe116899dcb65708da7e.zip
(term-ansi-at-eval-string, term-ansi-default-fg)
(term-ansi-default-bg, term-ansi-current-temp): Delete unused vars. (map): Bind S-prior, S-next and S-insert. (term-mode): Set `indent-tabs-mode\' to nil. (term-paste): New function to be bound to S-insert. (term-send-del, term-send-backspace): Change the strings sent. (term-termcap-format): Synchronyze with etc/e/eterm.ti. (term-handle-colors-array): Fix handling of underline and reverse. (term-handle-ansi-escape): Do not handle smcup/rmcup. Add comments. (term-erase-in-line): Fix comparison. (term-emulate-terminal): Fix line wrap handling. (term-start-output-log): Rename from `term-set-output-log\'. (term-stop-output-log): Rename from `term-stop-photo\'. (term-switch-to-alternate-sub-buffer): Comment out, unused. From Stefan <monnier@iro.umontreal.ca> (term-display-table): New variable. (term-mode): Use it. (term-exec-1): Set the coding system to binary. (term-emulate-terminal): Decode the string before inserting it.
-rw-r--r--lisp/term.el167
1 files changed, 103 insertions, 64 deletions
diff --git a/lisp/term.el b/lisp/term.el
index 0fbe5b2f154..e71163a822c 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -1,6 +1,6 @@
1;;; term.el --- general command interpreter in a window stuff 1;;; term.el --- general command interpreter in a window stuff
2 2
3;;; Copyright (C) 1988, 1990, 1992, 1994, 1995 Free Software Foundation, Inc. 3;;; Copyright (C) 1988, 1990, 1992, 1994, 1995, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Per Bothner <bothner@cygnus.com> 5;; Author: Per Bothner <bothner@cygnus.com>
6;; Based on comint mode written by: Olin Shivers <shivers@cs.cmu.edu> 6;; Based on comint mode written by: Olin Shivers <shivers@cs.cmu.edu>
@@ -676,7 +676,6 @@ Buffer local variable.")
676(defvar term-terminal-menu) 676(defvar term-terminal-menu)
677 677
678;;; Let's silence the byte-compiler -mm 678;;; Let's silence the byte-compiler -mm
679(defvar term-ansi-at-eval-string nil)
680(defvar term-ansi-at-host nil) 679(defvar term-ansi-at-host nil)
681(defvar term-ansi-at-dir nil) 680(defvar term-ansi-at-dir nil)
682(defvar term-ansi-at-user nil) 681(defvar term-ansi-at-user nil)
@@ -692,9 +691,6 @@ Buffer local variable.")
692(defvar term-ansi-current-highlight 0) 691(defvar term-ansi-current-highlight 0)
693(defvar term-ansi-current-reverse 0) 692(defvar term-ansi-current-reverse 0)
694(defvar term-ansi-current-invisible 0) 693(defvar term-ansi-current-invisible 0)
695(defvar term-ansi-default-fg 0)
696(defvar term-ansi-default-bg 0)
697(defvar term-ansi-current-temp 0)
698 694
699;;; Four should be enough, if you want more, just add. -mm 695;;; Four should be enough, if you want more, just add. -mm
700(defvar term-terminal-more-parameters 0) 696(defvar term-terminal-more-parameters 0)
@@ -917,6 +913,9 @@ is buffer-local.")
917 (define-key term-raw-map [backspace] 'term-send-backspace) 913 (define-key term-raw-map [backspace] 'term-send-backspace)
918 (define-key term-raw-map [home] 'term-send-home) 914 (define-key term-raw-map [home] 'term-send-home)
919 (define-key term-raw-map [end] 'term-send-end) 915 (define-key term-raw-map [end] 'term-send-end)
916 (define-key term-raw-map [S-prior] 'scroll-down)
917 (define-key term-raw-map [S-next] 'scroll-up)
918 (define-key term-raw-map [S-insert] 'term-paste)
920 (define-key term-raw-map [prior] 'term-send-prior) 919 (define-key term-raw-map [prior] 'term-send-prior)
921 (define-key term-raw-map [next] 'term-send-next))) 920 (define-key term-raw-map [next] 'term-send-next)))
922 921
@@ -932,6 +931,27 @@ is buffer-local.")
932 931
933(put 'term-mode 'mode-class 'special) 932(put 'term-mode 'mode-class 'special)
934 933
934
935;;; Use this variable as a display table for `term-mode'.
936(defvar term-display-table
937 (let ((dt (or (copy-sequence standard-display-table)
938 (make-display-table)))
939 i)
940 ;; avoid changing the display table for ^J
941 (setq i 0)
942 (while (< i 10)
943 (aset dt i (vector i))
944 (setq i (1+ i)))
945 (setq i 11)
946 (while (< i 32)
947 (aset dt i (vector i))
948 (setq i (1+ i)))
949 (setq i 128)
950 (while (< i 256)
951 (aset dt i (vector i))
952 (setq i (1+ i)))
953 dt))
954
935(defun term-mode () 955(defun term-mode ()
936 "Major mode for interacting with an inferior interpreter. 956 "Major mode for interacting with an inferior interpreter.
937The interpreter name is same as buffer name, sans the asterisks. 957The interpreter name is same as buffer name, sans the asterisks.
@@ -981,6 +1001,9 @@ Entry to this mode runs the hooks on `term-mode-hook'."
981 (setq major-mode 'term-mode) 1001 (setq major-mode 'term-mode)
982 (setq mode-name "Term") 1002 (setq mode-name "Term")
983 (use-local-map term-mode-map) 1003 (use-local-map term-mode-map)
1004 ;; we do not want indent to sneak in any tabs
1005 (setq indent-tabs-mode nil)
1006 (setq buffer-display-table term-display-table)
984 (make-local-variable 'term-home-marker) 1007 (make-local-variable 'term-home-marker)
985 (setq term-home-marker (copy-marker 0)) 1008 (setq term-home-marker (copy-marker 0))
986 (make-local-variable 'term-saved-home-marker) 1009 (make-local-variable 'term-saved-home-marker)
@@ -1184,6 +1207,11 @@ without any interpretation."
1184 ((eq arg '-) -1) 1207 ((eq arg '-) -1)
1185 (t (1- arg))))))) 1208 (t (1- arg)))))))
1186 1209
1210(defun term-paste ()
1211 "Insert the last stretch of killed text at point."
1212 (interactive)
1213 (term-send-raw-string (current-kill 0)))
1214
1187;; Which would be better: "\e[A" or "\eOA"? readline accepts either. 1215;; Which would be better: "\e[A" or "\eOA"? readline accepts either.
1188;; For my configuration it's definitely better \eOA but YMMV. -mm 1216;; For my configuration it's definitely better \eOA but YMMV. -mm
1189;; For example: vi works with \eOA while elm wants \e[A ... 1217;; For example: vi works with \eOA while elm wants \e[A ...
@@ -1195,8 +1223,8 @@ without any interpretation."
1195(defun term-send-end () (interactive) (term-send-raw-string "\e[4~")) 1223(defun term-send-end () (interactive) (term-send-raw-string "\e[4~"))
1196(defun term-send-prior () (interactive) (term-send-raw-string "\e[5~")) 1224(defun term-send-prior () (interactive) (term-send-raw-string "\e[5~"))
1197(defun term-send-next () (interactive) (term-send-raw-string "\e[6~")) 1225(defun term-send-next () (interactive) (term-send-raw-string "\e[6~"))
1198(defun term-send-del () (interactive) (term-send-raw-string "\C-?")) 1226(defun term-send-del () (interactive) (term-send-raw-string "\e[3~"))
1199(defun term-send-backspace () (interactive) (term-send-raw-string "\C-H")) 1227(defun term-send-backspace () (interactive) (term-send-raw-string "\C-?"))
1200 1228
1201(defun term-char-mode () 1229(defun term-char-mode ()
1202 "Switch to char (\"raw\") sub-mode of term mode. 1230 "Switch to char (\"raw\") sub-mode of term mode.
@@ -1366,14 +1394,15 @@ The main purpose is to get rid of the local keymap."
1366 "%s%s:li#%d:co#%d:cl=\\E[H\\E[J:cd=\\E[J:bs:am:xn:cm=\\E[%%i%%d;%%dH\ 1394 "%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\ 1395: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=^J\ 1396: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\
1370:dc=\\E[P:DC=\\E[%%dP:IC=\\E[%%d@:im=\\E[4h:ei=\\E[4l:mi:\ 1397: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\ 1398: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\ 1399: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~\ 1400: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\ 1401: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:" 1402:bl=^G:do=^J:le=^H:ta=^I:se=\E[27m:ue=\E24m\
1403:kb=^?:kD=^[[3~:sc=\E7:rc=\E8:"
1376;;; : -undefine ic 1404;;; : -undefine ic
1405;;; don't define :te=\\E[2J\\E[?47l\\E8:ti=\\E7\\E[?47h\
1377 "termcap capabilities supported") 1406 "termcap capabilities supported")
1378 1407
1379;;; This auxiliary function cranks up the process for term-exec in 1408;;; This auxiliary function cranks up the process for term-exec in
@@ -1400,9 +1429,10 @@ The main purpose is to get rid of the local keymap."
1400 (process-connection-type t) 1429 (process-connection-type t)
1401 ;; We should suppress conversion of end-of-line format. 1430 ;; We should suppress conversion of end-of-line format.
1402 (inhibit-eol-conversion t) 1431 (inhibit-eol-conversion t)
1403 ;; inhibit-eol-conversion doesn't seem to do the job, but this does. 1432 ;; The process's output contains not just chars but also binary
1404 (coding-system-for-read 'unknown-unix) 1433 ;; escape codes, so we need to see the raw output. We will have to
1405 ) 1434 ;; do the decoding by hand on the parts that are made of chars.
1435 (coding-system-for-read 'binary))
1406 (apply 'start-process name buffer 1436 (apply 'start-process name buffer
1407 "/bin/sh" "-c" 1437 "/bin/sh" "-c"
1408 (format "stty -nl echo rows %d columns %d sane 2>/dev/null;\ 1438 (format "stty -nl echo rows %d columns %d sane 2>/dev/null;\
@@ -2693,7 +2723,12 @@ See `term-prompt-regexp'."
2693 (if (not funny) (setq funny str-length)) 2723 (if (not funny) (setq funny str-length))
2694 (cond ((> funny i) 2724 (cond ((> funny i)
2695 (cond ((eq term-terminal-state 1) 2725 (cond ((eq term-terminal-state 1)
2696 (term-move-columns 1) 2726 ;; We are in state 1, we need to wrap
2727 ;; around. Go to the beginning of
2728 ;; the next line and switch to state
2729 ;; 0.
2730 (term-down 1)
2731 (term-move-columns (- (term-current-column)))
2697 (setq term-terminal-state 0))) 2732 (setq term-terminal-state 0)))
2698 (setq count (- funny i)) 2733 (setq count (- funny i))
2699 (setq temp (- (+ (term-horizontal-column) count) 2734 (setq temp (- (+ (term-horizontal-column) count)
@@ -2702,6 +2737,7 @@ See `term-prompt-regexp'."
2702 ((> count temp) ;; Some chars fit. 2737 ((> count temp) ;; Some chars fit.
2703 ;; This iteration, handle only what fits. 2738 ;; This iteration, handle only what fits.
2704 (setq count (- count temp)) 2739 (setq count (- count temp))
2740 (setq temp 0)
2705 (setq funny (+ count i))) 2741 (setq funny (+ count i)))
2706 ((or (not (or term-pager-count 2742 ((or (not (or term-pager-count
2707 term-scroll-with-delete)) 2743 term-scroll-with-delete))
@@ -2722,7 +2758,7 @@ See `term-prompt-regexp'."
2722 ;; following point if not eob nor insert-mode. 2758 ;; following point if not eob nor insert-mode.
2723 (let ((old-column (current-column)) 2759 (let ((old-column (current-column))
2724 columns pos) 2760 columns pos)
2725 (insert (substring str i funny)) 2761 (insert (decode-coding-string (substring str i funny) locale-coding-system))
2726 (setq term-current-column (current-column) 2762 (setq term-current-column (current-column)
2727 columns (- term-current-column old-column)) 2763 columns (- term-current-column old-column))
2728 (when (not (or (eobp) term-insert-mode)) 2764 (when (not (or (eobp) term-insert-mode))
@@ -2741,7 +2777,7 @@ See `term-prompt-regexp'."
2741 (setq term-terminal-state 1))) 2777 (setq term-terminal-state 1)))
2742 (setq i (1- funny))) 2778 (setq i (1- funny)))
2743 ((and (setq term-terminal-state 0) 2779 ((and (setq term-terminal-state 0)
2744 (eq char ?\^I)) ; TAB 2780 (eq char ?\^I)) ; TAB (terminfo: ht)
2745 ;; FIXME: Does not handle line wrap! 2781 ;; FIXME: Does not handle line wrap!
2746 (setq count (term-current-column)) 2782 (setq count (term-current-column))
2747 (setq count (+ count 8 (- (mod count 8)))) 2783 (setq count (+ count 8 (- (mod count 8))))
@@ -2768,7 +2804,7 @@ See `term-prompt-regexp'."
2768 (if (not (and term-kill-echo-list 2804 (if (not (and term-kill-echo-list
2769 (term-check-kill-echo-list))) 2805 (term-check-kill-echo-list)))
2770 (term-down 1 t))) 2806 (term-down 1 t)))
2771 ((eq char ?\b) 2807 ((eq char ?\b) ;; (terminfo: cub1)
2772 (term-move-columns -1)) 2808 (term-move-columns -1))
2773 ((eq char ?\033) ; Escape 2809 ((eq char ?\033) ; Escape
2774 (setq term-terminal-state 2)) 2810 (setq term-terminal-state 2))
@@ -2818,13 +2854,13 @@ See `term-prompt-regexp'."
2818 ((eq char ?M) ;; scroll reversed 2854 ((eq char ?M) ;; scroll reversed
2819 (term-insert-lines 1) 2855 (term-insert-lines 1)
2820 (setq term-terminal-state 0)) 2856 (setq term-terminal-state 0))
2821 ((eq char ?7) ;; Save cursor 2857 ((eq char ?7) ;; Save cursor (terminfo: sc)
2822 (term-handle-deferred-scroll) 2858 (term-handle-deferred-scroll)
2823 (setq term-saved-cursor 2859 (setq term-saved-cursor
2824 (cons (term-current-row) 2860 (cons (term-current-row)
2825 (term-horizontal-column))) 2861 (term-horizontal-column)))
2826 (setq term-terminal-state 0)) 2862 (setq term-terminal-state 0))
2827 ((eq char ?8) ;; Restore cursor 2863 ((eq char ?8) ;; Restore cursor (terminfo: rc)
2828 (if term-saved-cursor 2864 (if term-saved-cursor
2829 (term-goto (car term-saved-cursor) 2865 (term-goto (car term-saved-cursor)
2830 (cdr term-saved-cursor))) 2866 (cdr term-saved-cursor)))
@@ -2976,13 +3012,13 @@ See `term-prompt-regexp'."
2976 ((eq parameter 8) 3012 ((eq parameter 8)
2977 (setq term-ansi-current-invisible 1)) 3013 (setq term-ansi-current-invisible 1))
2978 3014
2979;;; Reset reverse (i.e. terminfo rmso) 3015;;; Reset underline (i.e. terminfo rmul)
2980 ((eq parameter 24) 3016 ((eq parameter 24)
2981 (setq term-ansi-current-reverse 0)) 3017 (setq term-ansi-current-underline 0))
2982 3018
2983;;; Reset underline (i.e. terminfo rmul) 3019;;; Reset reverse (i.e. terminfo rmso)
2984 ((eq parameter 27) 3020 ((eq parameter 27)
2985 (setq term-ansi-current-underline 0)) 3021 (setq term-ansi-current-reverse 0))
2986 3022
2987;;; Foreground 3023;;; Foreground
2988 ((and (>= parameter 30) (<= parameter 37)) 3024 ((and (>= parameter 30) (<= parameter 37))
@@ -3097,7 +3133,7 @@ See `term-prompt-regexp'."
3097 (term-goto 3133 (term-goto
3098 (1- term-terminal-previous-parameter) 3134 (1- term-terminal-previous-parameter)
3099 (1- term-terminal-parameter))) 3135 (1- term-terminal-parameter)))
3100 ;; \E[A - cursor up 3136 ;; \E[A - cursor up (terminfo: cuu1)
3101 ((eq char ?A) 3137 ((eq char ?A)
3102 (term-handle-deferred-scroll) 3138 (term-handle-deferred-scroll)
3103 (term-down (- (max 1 term-terminal-parameter)) t)) 3139 (term-down (- (max 1 term-terminal-parameter)) t))
@@ -3110,13 +3146,13 @@ See `term-prompt-regexp'."
3110 ;; \E[D - cursor left 3146 ;; \E[D - cursor left
3111 ((eq char ?D) 3147 ((eq char ?D)
3112 (term-move-columns (- (max 1 term-terminal-parameter)))) 3148 (term-move-columns (- (max 1 term-terminal-parameter))))
3113 ;; \E[J - clear to end of screen 3149 ;; \E[J - clear to end of screen (terminfo: ed, clear)
3114 ((eq char ?J) 3150 ((eq char ?J)
3115 (term-erase-in-display term-terminal-parameter)) 3151 (term-erase-in-display term-terminal-parameter))
3116 ;; \E[K - clear to end of line 3152 ;; \E[K - clear to end of line (terminfo: el, el1)
3117 ((eq char ?K) 3153 ((eq char ?K)
3118 (term-erase-in-line term-terminal-parameter)) 3154 (term-erase-in-line term-terminal-parameter))
3119 ;; \E[L - insert lines 3155 ;; \E[L - insert lines (terminfo: il, il1)
3120 ((eq char ?L) 3156 ((eq char ?L)
3121 (term-insert-lines (max 1 term-terminal-parameter))) 3157 (term-insert-lines (max 1 term-terminal-parameter)))
3122 ;; \E[M - delete lines 3158 ;; \E[M - delete lines
@@ -3130,19 +3166,22 @@ See `term-prompt-regexp'."
3130 (term-insert-spaces (max 1 term-terminal-parameter))) 3166 (term-insert-spaces (max 1 term-terminal-parameter)))
3131 ;; \E[?h - DEC Private Mode Set 3167 ;; \E[?h - DEC Private Mode Set
3132 ((eq char ?h) 3168 ((eq char ?h)
3133 (cond ((eq term-terminal-parameter 4) 3169 (cond ((eq term-terminal-parameter 4) ;; (terminfo: smir)
3134 (setq term-insert-mode t)) 3170 (setq term-insert-mode t))
3135 ((eq term-terminal-parameter 47) 3171 ;; ((eq term-terminal-parameter 47) ;; (terminfo: smcup)
3136 (term-switch-to-alternate-sub-buffer t)))) 3172 ;; (term-switch-to-alternate-sub-buffer t))
3173 ))
3137 ;; \E[?l - DEC Private Mode Reset 3174 ;; \E[?l - DEC Private Mode Reset
3138 ((eq char ?l) 3175 ((eq char ?l)
3139 (cond ((eq term-terminal-parameter 4) 3176 (cond ((eq term-terminal-parameter 4) ;; (terminfo: rmir)
3140 (setq term-insert-mode nil)) 3177 (setq term-insert-mode nil))
3141 ((eq term-terminal-parameter 47) 3178 ;; ((eq term-terminal-parameter 47) ;; (terminfo: rmcup)
3142 (term-switch-to-alternate-sub-buffer nil)))) 3179 ;; (term-switch-to-alternate-sub-buffer nil))
3180 ))
3143 3181
3144;;; Modified to allow ansi coloring -mm 3182;;; Modified to allow ansi coloring -mm
3145 ;; \E[m - Set/reset standard mode 3183 ;; \E[m - Set/reset modes, set bg/fg
3184 ;;(terminfo: smso,rmso,smul,rmul,rev,bold,sgr0,invis,op,setab,setaf)
3146 ((eq char ?m) 3185 ((eq char ?m)
3147 (when (= term-terminal-more-parameters 1) 3186 (when (= term-terminal-more-parameters 1)
3148 (if (>= term-terminal-previous-parameter-4 0) 3187 (if (>= term-terminal-previous-parameter-4 0)
@@ -3186,32 +3225,32 @@ The top-most line is line 0."
3186 (not (and (= term-scroll-start 0) 3225 (not (and (= term-scroll-start 0)
3187 (= term-scroll-end term-height)))))) 3226 (= term-scroll-end term-height))))))
3188 3227
3189(defun term-switch-to-alternate-sub-buffer (set) 3228;; (defun term-switch-to-alternate-sub-buffer (set)
3190 ;; If asked to switch to (from) the alternate sub-buffer, and already (not) 3229;; ;; If asked to switch to (from) the alternate sub-buffer, and already (not)
3191 ;; using it, do nothing. This test is needed for some programs (including 3230;; ;; using it, do nothing. This test is needed for some programs (including
3192 ;; Emacs) that emit the ti termcap string twice, for unknown reason. 3231;; ;; Emacs) that emit the ti termcap string twice, for unknown reason.
3193 (term-handle-deferred-scroll) 3232;; (term-handle-deferred-scroll)
3194 (if (eq set (not (term-using-alternate-sub-buffer))) 3233;; (if (eq set (not (term-using-alternate-sub-buffer)))
3195 (let ((row (term-current-row)) 3234;; (let ((row (term-current-row))
3196 (col (term-horizontal-column))) 3235;; (col (term-horizontal-column)))
3197 (cond (set 3236;; (cond (set
3198 (goto-char (point-max)) 3237;; (goto-char (point-max))
3199 (if (not (eq (preceding-char) ?\n)) 3238;; (if (not (eq (preceding-char) ?\n))
3200 (term-insert-char ?\n 1)) 3239;; (term-insert-char ?\n 1))
3201 (setq term-scroll-with-delete t) 3240;; (setq term-scroll-with-delete t)
3202 (setq term-saved-home-marker (copy-marker term-home-marker)) 3241;; (setq term-saved-home-marker (copy-marker term-home-marker))
3203 (set-marker term-home-marker (point))) 3242;; (set-marker term-home-marker (point)))
3204 (t 3243;; (t
3205 (setq term-scroll-with-delete 3244;; (setq term-scroll-with-delete
3206 (not (and (= term-scroll-start 0) 3245;; (not (and (= term-scroll-start 0)
3207 (= term-scroll-end term-height)))) 3246;; (= term-scroll-end term-height))))
3208 (set-marker term-home-marker term-saved-home-marker) 3247;; (set-marker term-home-marker term-saved-home-marker)
3209 (set-marker term-saved-home-marker nil) 3248;; (set-marker term-saved-home-marker nil)
3210 (setq term-saved-home-marker nil) 3249;; (setq term-saved-home-marker nil)
3211 (goto-char term-home-marker))) 3250;; (goto-char term-home-marker)))
3212 (setq term-current-column nil) 3251;; (setq term-current-column nil)
3213 (setq term-current-row 0) 3252;; (setq term-current-row 0)
3214 (term-goto row col)))) 3253;; (term-goto row col))))
3215 3254
3216;; Default value for the symbol term-command-hook. 3255;; Default value for the symbol term-command-hook.
3217 3256
@@ -3521,11 +3560,11 @@ all pending output has been dealt with."))
3521 (if (not (bolp)) (insert-before-markers ?\n))) 3560 (if (not (bolp)) (insert-before-markers ?\n)))
3522 3561
3523(defun term-erase-in-line (kind) 3562(defun term-erase-in-line (kind)
3524 (if (> kind 1) ;; erase left of point 3563 (if (= kind 1) ;; erase left of point
3525 (let ((cols (term-horizontal-column)) (saved-point (point))) 3564 (let ((cols (term-horizontal-column)) (saved-point (point)))
3526 (term-vertical-motion 0) 3565 (term-vertical-motion 0)
3527 (delete-region (point) saved-point) 3566 (delete-region (point) saved-point)
3528 (term-insert-char ?\n cols))) 3567 (term-insert-char ? cols)))
3529 (if (not (eq kind 1)) ;; erase right of point 3568 (if (not (eq kind 1)) ;; erase right of point
3530 (let ((saved-point (point)) 3569 (let ((saved-point (point))
3531 (wrapped (and (zerop (term-horizontal-column)) 3570 (wrapped (and (zerop (term-horizontal-column))
@@ -3624,7 +3663,7 @@ Should only be called when point is at the start of a screen line."
3624 (term-insert-char ?\n lines) 3663 (term-insert-char ?\n lines)
3625 (goto-char start))) 3664 (goto-char start)))
3626 3665
3627(defun term-set-output-log (name) 3666(defun term-start-output-log (name)
3628 "Record raw inferior process output in a buffer." 3667 "Record raw inferior process output in a buffer."
3629 (interactive (list (if term-log-buffer 3668 (interactive (list (if term-log-buffer
3630 nil 3669 nil
@@ -3646,10 +3685,10 @@ Should only be called when point is at the start of a screen line."
3646 (message "Recording terminal emulator output into buffer \"%s\"" 3685 (message "Recording terminal emulator output into buffer \"%s\""
3647 (buffer-name term-log-buffer)))) 3686 (buffer-name term-log-buffer))))
3648 3687
3649(defun term-stop-photo () 3688(defun term-stop-output-log ()
3650 "Discontinue raw inferior process logging." 3689 "Discontinue raw inferior process logging."
3651 (interactive) 3690 (interactive)
3652 (term-set-output-log nil)) 3691 (term-start-output-log nil))
3653 3692
3654(defun term-show-maximum-output () 3693(defun term-show-maximum-output ()
3655 "Put the end of the buffer at the bottom of the window." 3694 "Put the end of the buffer at the bottom of the window."