aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2001-03-13 11:21:52 +0000
committerKenichi Handa2001-03-13 11:21:52 +0000
commitda1cee4955559562832027cc196bc782b9c13546 (patch)
tree8edf4e3cb37f9c2360fccd2b88bde0b1b1b1d105
parent2b8e24b31306aee423b168a5aef633eede28d078 (diff)
downloademacs-da1cee4955559562832027cc196bc782b9c13546.tar.gz
emacs-da1cee4955559562832027cc196bc782b9c13546.zip
These changes are based on a patch sent from Yong Lu <lyongu@yahoo.com>.
(term-set-escape-char): Bind M-x to execute-extended-command in term-raw-escape-map. (term-move-columns): Don't try to move to negagive column. (term-emulate-terminal): Insert a string before deleting a text to overwrite.
-rw-r--r--lisp/term.el39
1 files changed, 23 insertions, 16 deletions
diff --git a/lisp/term.el b/lisp/term.el
index 452d5f29a8e..dcbcd0aacd6 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -23,6 +23,9 @@
23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24;; Boston, MA 02111-1307, USA. 24;; Boston, MA 02111-1307, USA.
25 25
26;;; Marck 13 2001
27;;; Fixes for CJK support by Yong Lu <lyongu@yahoo.com>.
28
26;;; Dir/Hostname tracking and ANSI colorization by 29;;; Dir/Hostname tracking and ANSI colorization by
27;;; Marco Melgazzi <marco@techie.com>. 30;;; Marco Melgazzi <marco@techie.com>.
28 31
@@ -1269,7 +1272,9 @@ without any interpretation."
1269 (define-key term-raw-escape-map "\C-q" 'term-pager-toggle) 1272 (define-key term-raw-escape-map "\C-q" 'term-pager-toggle)
1270 ;; The keybinding for term-char-mode is needed by the menubar code. 1273 ;; The keybinding for term-char-mode is needed by the menubar code.
1271 (define-key term-raw-escape-map "\C-k" 'term-char-mode) 1274 (define-key term-raw-escape-map "\C-k" 'term-char-mode)
1272 (define-key term-raw-escape-map "\C-j" 'term-line-mode)) 1275 (define-key term-raw-escape-map "\C-j" 'term-line-mode)
1276 ;; It's convenient to have execute-extended-command here.
1277 (define-key term-raw-escape-map [?\M-x] 'execute-extended-command))
1273 1278
1274(defun term-char-mode () 1279(defun term-char-mode ()
1275 "Switch to char (\"raw\") sub-mode of term mode. 1280 "Switch to char (\"raw\") sub-mode of term mode.
@@ -2606,10 +2611,10 @@ See `term-prompt-regexp'."
2606 (cond (term-current-column) 2611 (cond (term-current-column)
2607 ((setq term-current-column (current-column))))) 2612 ((setq term-current-column (current-column)))))
2608 2613
2609;;; Move DELTA column right (or left if delta < 0). 2614;;; Move DELTA column right (or left if delta < 0 limiting at column 0).
2610 2615
2611(defun term-move-columns (delta) 2616(defun term-move-columns (delta)
2612 (setq term-current-column (+ (term-current-column) delta)) 2617 (setq term-current-column (max 0 (+ (term-current-column) delta)))
2613 (move-to-column term-current-column t)) 2618 (move-to-column term-current-column t))
2614 2619
2615;; Insert COUNT copies of CHAR in the default face. 2620;; Insert COUNT copies of CHAR in the default face.
@@ -2786,19 +2791,21 @@ See `term-prompt-regexp'."
2786 (setq term-current-column nil) 2791 (setq term-current-column nil)
2787 (setq term-start-line-column nil))) 2792 (setq term-start-line-column nil)))
2788 (setq old-point (point)) 2793 (setq old-point (point))
2789 ;; In the common case that we're at the end of 2794
2790 ;; the buffer, we can save a little work. 2795 ;; Insert a string, check how many columns
2791 (cond ((/= (point) (point-max)) 2796 ;; we moved, then delete that many columns
2792 (if term-insert-mode 2797 ;; following point if not eob nor insert-mode.
2793 ;; Inserting spaces, then deleting them, 2798 (let ((old-column (current-column))
2794 ;; then inserting the actual text is 2799 columns pos)
2795 ;; inefficient, but it is simple, and 2800 (insert (substring str i funny))
2796 ;; the actual overhead is miniscule. 2801 (setq term-current-column (current-column)
2797 (term-insert-spaces count)) 2802 columns (- term-current-column old-column))
2798 (term-move-columns count) 2803 (when (not (or (eobp) term-insert-mode))
2799 (delete-region old-point (point))) 2804 (setq pos (point))
2800 (t (setq term-current-column (+ (term-current-column) count)))) 2805 (term-move-columns columns)
2801 (insert (substring str i funny)) 2806 (delete-region pos (point))))
2807 (setq term-current-column nil)
2808
2802 (put-text-property old-point (point) 2809 (put-text-property old-point (point)
2803 'face term-current-face) 2810 'face term-current-face)
2804 ;; If the last char was written in last column, 2811 ;; If the last char was written in last column,