diff options
| author | Chong Yidong | 2012-06-17 16:26:13 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-06-17 16:26:13 +0800 |
| commit | eb4a8a9a88652ca7f092e2c5e51b82c631f74749 (patch) | |
| tree | 7d6662c53b647cec27e64d01b1aa57825dd003ed | |
| parent | 310fbfa8e2c800b684425a603926b19c45c9f283 (diff) | |
| download | emacs-eb4a8a9a88652ca7f092e2c5e51b82c631f74749.tar.gz emacs-eb4a8a9a88652ca7f092e2c5e51b82c631f74749.zip | |
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
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/term.el | 17 |
2 files changed, 13 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 30bdefac5bf..ae67fac2f4c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-06-17 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * term.el (term-emulate-terminal): If term-check-size is called, | ||
| 4 | move point to the process mark without resetting point (Bug#4635). | ||
| 5 | |||
| 1 | 2012-06-13 Glenn Morris <rgm@gnu.org> | 6 | 2012-06-13 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * international/mule-cmds.el (mule-menu-keymap) | 8 | * international/mule-cmds.el (mule-menu-keymap) |
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'." | |||
| 2710 | (str-length (length str))) | 2710 | (str-length (length str))) |
| 2711 | (save-selected-window | 2711 | (save-selected-window |
| 2712 | 2712 | ||
| 2713 | ;; Let's handle the messages. -mm | 2713 | (let ((newstr (term-handle-ansi-terminal-messages str))) |
| 2714 | 2714 | (unless (eq str newstr) | |
| 2715 | (let* ((newstr (term-handle-ansi-terminal-messages str))) | ||
| 2716 | (when (not (eq str newstr)) | ||
| 2717 | (setq handled-ansi-message t | 2715 | (setq handled-ansi-message t |
| 2718 | str newstr))) | 2716 | str newstr))) |
| 2719 | (setq str-length (length str)) | 2717 | (setq str-length (length str)) |
| @@ -2723,18 +2721,19 @@ See `term-prompt-regexp'." | |||
| 2723 | (delete-region term-pending-delete-marker (process-mark proc)) | 2721 | (delete-region term-pending-delete-marker (process-mark proc)) |
| 2724 | (set-marker term-pending-delete-marker nil)) | 2722 | (set-marker term-pending-delete-marker nil)) |
| 2725 | 2723 | ||
| 2724 | (when (/= (point) (process-mark proc)) | ||
| 2725 | (setq save-point (point-marker))) | ||
| 2726 | |||
| 2727 | ;; Note if the window size has changed. We used to reset | ||
| 2728 | ;; point too, but that gives incorrect results (Bug#4635). | ||
| 2726 | (if (eq (window-buffer) (current-buffer)) | 2729 | (if (eq (window-buffer) (current-buffer)) |
| 2727 | (progn | 2730 | (progn |
| 2728 | (setq term-vertical-motion (symbol-function 'vertical-motion)) | 2731 | (setq term-vertical-motion (symbol-function 'vertical-motion)) |
| 2729 | (term-check-size proc)) | 2732 | (term-check-size proc)) |
| 2730 | (setq term-vertical-motion | 2733 | (setq term-vertical-motion |
| 2731 | (symbol-function 'term-buffer-vertical-motion))) | 2734 | (symbol-function 'term-buffer-vertical-motion))) |
| 2732 | |||
| 2733 | (setq save-marker (copy-marker (process-mark proc))) | 2735 | (setq save-marker (copy-marker (process-mark proc))) |
| 2734 | 2736 | (goto-char (process-mark proc)) | |
| 2735 | (when (/= (point) (process-mark proc)) | ||
| 2736 | (setq save-point (point-marker)) | ||
| 2737 | (goto-char (process-mark proc))) | ||
| 2738 | 2737 | ||
| 2739 | (save-restriction | 2738 | (save-restriction |
| 2740 | ;; If the buffer is in line mode, and there is a partial | 2739 | ;; If the buffer is in line mode, and there is a partial |