diff options
| author | Eli Zaretskii | 2016-10-15 16:53:36 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2016-10-15 16:53:36 +0300 |
| commit | 528997daa15d6e864f4f7119fe073fe37ab4c685 (patch) | |
| tree | ce112e6da5c5562e25ec2ae2c79c5882ebb55e08 | |
| parent | 21300051eb28b87703745dd0979d322da68d9ed5 (diff) | |
| download | emacs-528997daa15d6e864f4f7119fe073fe37ab4c685.tar.gz emacs-528997daa15d6e864f4f7119fe073fe37ab4c685.zip | |
Keep point when switching from and to *terminal* buffer
* lisp/term.el (term-reset-size): Don't reset the size if it
didn't change. If the size did change, restore point after
adjusting the size. (Bug#24465)
| -rw-r--r-- | lisp/term.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/term.el b/lisp/term.el index f477bccbe2e..993e5803059 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -1116,12 +1116,16 @@ Entry to this mode runs the hooks on `term-mode-hook'." | |||
| 1116 | (term-update-mode-line)) | 1116 | (term-update-mode-line)) |
| 1117 | 1117 | ||
| 1118 | (defun term-reset-size (height width) | 1118 | (defun term-reset-size (height width) |
| 1119 | (setq term-height height) | 1119 | (when (or (/= height term-height) |
| 1120 | (setq term-width width) | 1120 | (/= width term-width)) |
| 1121 | (setq term-start-line-column nil) | 1121 | (let ((point (point))) |
| 1122 | (setq term-current-row nil) | 1122 | (setq term-height height) |
| 1123 | (setq term-current-column nil) | 1123 | (setq term-width width) |
| 1124 | (term-set-scroll-region 0 height)) | 1124 | (setq term-start-line-column nil) |
| 1125 | (setq term-current-row nil) | ||
| 1126 | (setq term-current-column nil) | ||
| 1127 | (term-set-scroll-region 0 height) | ||
| 1128 | (goto-char point)))) | ||
| 1125 | 1129 | ||
| 1126 | ;; Recursive routine used to check if any string in term-kill-echo-list | 1130 | ;; Recursive routine used to check if any string in term-kill-echo-list |
| 1127 | ;; matches part of the buffer before point. | 1131 | ;; matches part of the buffer before point. |