summaryrefslogtreecommitdiff
path: root/lisp/term.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-06-17 16:26:13 +0800
committerChong Yidong <cyd@gnu.org>2012-06-17 16:26:13 +0800
commiteb4a8a9a88652ca7f092e2c5e51b82c631f74749 (patch)
tree7d6662c53b647cec27e64d01b1aa57825dd003ed /lisp/term.el
parent310fbfa8e2c800b684425a603926b19c45c9f283 (diff)
downloademacs-eb4a8a9a88652ca7f092e2c5e51b82c631f74749.tar.gz
Fix point motion bug in term-emulate-terminal.
* lisp/term.el (term-emulate-terminal): If term-check-size is called, move point to the process mark without resetting point. Fixes: debbugs:4635
Diffstat (limited to 'lisp/term.el')
-rw-r--r--lisp/term.el17
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/term.el b/lisp/term.el
index e6a4bc15dd6..06bdd21a409 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -2710,10 +2710,8 @@ See `term-prompt-regexp'."
(str-length (length str)))
(save-selected-window
- ;; Let's handle the messages. -mm
-
- (let* ((newstr (term-handle-ansi-terminal-messages str)))
- (when (not (eq str newstr))
+ (let ((newstr (term-handle-ansi-terminal-messages str)))
+ (unless (eq str newstr)
(setq handled-ansi-message t
str newstr)))
(setq str-length (length str))
@@ -2723,18 +2721,19 @@ See `term-prompt-regexp'."
(delete-region term-pending-delete-marker (process-mark proc))
(set-marker term-pending-delete-marker nil))
+ (when (/= (point) (process-mark proc))
+ (setq save-point (point-marker)))
+
+ ;; Note if the window size has changed. We used to reset
+ ;; point too, but that gives incorrect results (Bug#4635).
(if (eq (window-buffer) (current-buffer))
(progn
(setq term-vertical-motion (symbol-function 'vertical-motion))
(term-check-size proc))
(setq term-vertical-motion
(symbol-function 'term-buffer-vertical-motion)))
-
(setq save-marker (copy-marker (process-mark proc)))
-
- (when (/= (point) (process-mark proc))
- (setq save-point (point-marker))
- (goto-char (process-mark proc)))
+ (goto-char (process-mark proc))
(save-restriction
;; If the buffer is in line mode, and there is a partial