X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/0121d32af5f58b284815da9c571f829f0f9e9186..a660037698bce151915e6e084593071134df1331:/lisp/term.el diff --git a/lisp/term.el b/lisp/term.el index 282dfe2ea8..43138fa6dd 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1,6 +1,6 @@ ;;; term.el --- general command interpreter in a window stuff -;; Copyright (C) 1988, 1990, 1992, 1994-1995, 2001-2014 Free Software +;; Copyright (C) 1988, 1990, 1992, 1994-1995, 2001-2015 Free Software ;; Foundation, Inc. ;; Author: Per Bothner @@ -1145,7 +1145,7 @@ Entry to this mode runs the hooks on `term-mode-hook'." (make-local-variable 'term-scroll-show-maximum-output) (make-local-variable 'term-ptyp) (make-local-variable 'term-exec-hook) - (make-local-variable 'term-vertical-motion) + (set (make-local-variable 'term-vertical-motion) 'vertical-motion) (set (make-local-variable 'term-pending-delete-marker) (make-marker)) (make-local-variable 'term-current-face) (term-ansi-reset) @@ -1155,6 +1155,13 @@ Entry to this mode runs the hooks on `term-mode-hook'." (set (make-local-variable 'font-lock-defaults) '(nil t)) + (add-function :filter-return + (local 'window-adjust-process-window-size-function) + (lambda (size) + (when size + (term-reset-size (cdr size) (car size))) + size)) + (easy-menu-add term-terminal-menu) (easy-menu-add term-signals-menu) (or term-input-ring @@ -1197,12 +1204,6 @@ Entry to this mode runs the hooks on `term-mode-hook'." (goto-char save-point))) found)) -(defun term-check-size (process) - (when (or (/= term-height (window-text-height)) - (/= term-width (term-window-width))) - (term-reset-size (window-text-height) (term-window-width)) - (set-process-window-size process term-height term-width))) - (defun term-send-raw-string (chars) (deactivate-mark) (let ((proc (get-buffer-process (current-buffer)))) @@ -2772,15 +2773,11 @@ See `term-prompt-regexp'." (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))) + (setf term-vertical-motion + (if (eq (window-buffer) (current-buffer)) + 'vertical-motion + 'term-buffer-vertical-motion)) + (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction @@ -3082,9 +3079,7 @@ See `term-prompt-regexp'." (eq (window-buffer selected) (current-buffer))) (term-display-line (car term-pending-frame) (cdr term-pending-frame)) - (setq term-pending-frame nil) - ;; We have created a new window, so check the window size. - (term-check-size proc)) + (setq term-pending-frame nil)) ;; Scroll each window displaying the buffer but (by default) ;; only if the point matches the process-mark we started with.