summaryrefslogtreecommitdiff
path: root/lisp/term.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-10-23 02:43:17 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-10-23 02:43:17 -0700
commit6129cd03e20a0aaee46ceb742a9ed1ae2904eab3 (patch)
treef432bbffba80979cec74cfc125a9f73abfd06a91 /lisp/term.el
parent16d126d7559c2f58c8af6cf86c9f54b6e21cceb4 (diff)
parentb73f4668ab685dfb690eced15b20ed47f90efccb (diff)
downloademacs-6129cd03e20a0aaee46ceb742a9ed1ae2904eab3.tar.gz
Merge from origin/emacs-25
b73f466 * lisp/cus-start.el (exec-path): Handle nil elements. (Bug#2... 55ebb70 Catch the imenu-unavailable error in sh-mode completion table 993acb5 ; Minor fix for last change in characters.el 30c4bb5 More char-width fixes 4eb4463 Fix char-width-table values for some Emoji 528997d Keep point when switching from and to *terminal* buffer 2130005 * INSTALL: Use correct Emacs release number 25. 10835b1 Avoid crashes due to objects read with the #n=object form 4de671d Improve doc string of 'completion-at-point-functions' ceb46f0 Fix crash in evaluating functions d8374c4 * src/filelock.c (current_lock_owner): Update comment.
Diffstat (limited to 'lisp/term.el')
-rw-r--r--lisp/term.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/term.el b/lisp/term.el
index 1adeae24098..5177ab4b921 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -1109,12 +1109,16 @@ Entry to this mode runs the hooks on `term-mode-hook'."
(term-update-mode-line))
(defun term-reset-size (height width)
- (setq term-height height)
- (setq term-width width)
- (setq term-start-line-column nil)
- (setq term-current-row nil)
- (setq term-current-column nil)
- (term-set-scroll-region 0 height))
+ (when (or (/= height term-height)
+ (/= width term-width))
+ (let ((point (point)))
+ (setq term-height height)
+ (setq term-width width)
+ (setq term-start-line-column nil)
+ (setq term-current-row nil)
+ (setq term-current-column nil)
+ (term-set-scroll-region 0 height)
+ (goto-char point))))
;; Recursive routine used to check if any string in term-kill-echo-list
;; matches part of the buffer before point.