comparison lisp/term.el @ 90133:4da4a09e8b1b

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-31 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 206-222) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 45-52) - Update from CVS - Update from CVS: texi Makefile.in CVS keyw cruft - Update from CVS: ChangeLog tweaks
author Miles Bader <miles@gnu.org>
date Thu, 31 Mar 2005 09:58:14 +0000
parents fb79180b618d 47b31fabc07f
children 02f1dbc4a199
comparison
equal deleted inserted replaced
90132:4080fe8b4f0f 90133:4da4a09e8b1b
2569 2569
2570 ;;; Move DELTA column right (or left if delta < 0 limiting at column 0). 2570 ;;; Move DELTA column right (or left if delta < 0 limiting at column 0).
2571 2571
2572 (defun term-move-columns (delta) 2572 (defun term-move-columns (delta)
2573 (setq term-current-column (max 0 (+ (term-current-column) delta))) 2573 (setq term-current-column (max 0 (+ (term-current-column) delta)))
2574 (move-to-column term-current-column t)) 2574 (let (point-at-eol)
2575 (save-excursion
2576 (end-of-line)
2577 (setq point-at-eol (point)))
2578 (move-to-column term-current-column t)
2579 ;; If move-to-column extends the current line it will use the face
2580 ;; from the last character on the line, set the face for the chars
2581 ;; to default.
2582 (when (> (point) point-at-eol)
2583 (put-text-property point-at-eol (point) 'face 'default))))
2575 2584
2576 ;; Insert COUNT copies of CHAR in the default face. 2585 ;; Insert COUNT copies of CHAR in the default face.
2577 (defun term-insert-char (char count) 2586 (defun term-insert-char (char count)
2578 (let ((old-point (point))) 2587 (let ((old-point (point)))
2579 (insert-char char count) 2588 (insert-char char count)
3024 3033
3025 ;;; Reset the terminal, delete all the content and set the face to the 3034 ;;; Reset the terminal, delete all the content and set the face to the
3026 ;;; default one. 3035 ;;; default one.
3027 (defun term-reset-terminal () 3036 (defun term-reset-terminal ()
3028 (erase-buffer) 3037 (erase-buffer)
3029 (setq term-current-row 1) 3038 (setq term-current-row 0)
3030 (setq term-current-column 1) 3039 (setq term-current-column 1)
3031 (setq term-insert-mode nil) 3040 (setq term-insert-mode nil)
3032 (setq term-current-face nil) 3041 (setq term-current-face nil)
3033 (setq term-ansi-current-underline 0) 3042 (setq term-ansi-current-underline 0)
3034 (setq term-ansi-current-bold 0) 3043 (setq term-ansi-current-bold 0)
3035 (setq term-ansi-current-reverse 0) 3044 (setq term-ansi-current-reverse 0)
3036 (setq term-ansi-current-color 0) 3045 (setq term-ansi-current-color 0)
3037 (setq term-ansi-current-invisible 0) 3046 (setq term-ansi-current-invisible 0)
3038 (setq term-ansi-face-already-done 1) 3047 (setq term-ansi-face-already-done 0)
3039 (setq term-ansi-current-bg-color 0)) 3048 (setq term-ansi-current-bg-color 0))
3040 3049
3041 ;;; New function to deal with ansi colorized output, as you can see you can 3050 ;;; New function to deal with ansi colorized output, as you can see you can
3042 ;;; have any bold/underline/fg/bg/reverse combination. -mm 3051 ;;; have any bold/underline/fg/bg/reverse combination. -mm
3043 3052
3681 ;;; Insert COUNT spaces after point, but do not change any of 3690 ;;; Insert COUNT spaces after point, but do not change any of
3682 ;;; following screen lines. Hence we may have to delete characters 3691 ;;; following screen lines. Hence we may have to delete characters
3683 ;;; at teh end of this screen line to make room. 3692 ;;; at teh end of this screen line to make room.
3684 3693
3685 (defun term-insert-spaces (count) 3694 (defun term-insert-spaces (count)
3686 (let ((save-point (point)) (save-eol)) 3695 (let ((save-point (point)) (save-eol) (point-at-eol))
3687 (term-vertical-motion 1) 3696 (term-vertical-motion 1)
3688 (if (bolp) 3697 (if (bolp)
3689 (backward-char)) 3698 (backward-char))
3690 (setq save-eol (point)) 3699 (setq save-eol (point))
3700 (save-excursion
3701 (end-of-line)
3702 (setq point-at-eol (point)))
3691 (move-to-column (+ (term-start-line-column) (- term-width count)) t) 3703 (move-to-column (+ (term-start-line-column) (- term-width count)) t)
3704 ;; If move-to-column extends the current line it will use the face
3705 ;; from the last character on the line, set the face for the chars
3706 ;; to default.
3707 (when (> (point) (point-at-eol))
3708 (put-text-property point-at-eol (point) 'face 'default))
3692 (if (> save-eol (point)) 3709 (if (> save-eol (point))
3693 (delete-region (point) save-eol)) 3710 (delete-region (point) save-eol))
3694 (goto-char save-point) 3711 (goto-char save-point)
3695 (term-insert-char ? count) 3712 (term-insert-char ? count)
3696 (goto-char save-point))) 3713 (goto-char save-point)))