mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-18 03:40:47 -08:00
Add a new variable to not recenter term on all input
* lisp/term.el (term-scroll-snap-to-bottom): New variable (bug#15744). * lisp/term.el (term-emulate-terminal): Use it.
This commit is contained in:
parent
53720a9bde
commit
c84d3c1638
2 changed files with 20 additions and 3 deletions
6
etc/NEWS
6
etc/NEWS
|
|
@ -780,6 +780,12 @@ digits.
|
||||||
|
|
||||||
** Miscellaneous
|
** Miscellaneous
|
||||||
|
|
||||||
|
---
|
||||||
|
*** New variable 'term-scroll-snap-to-bottom'
|
||||||
|
term will, by default, recenter the buffer so that the prompt on the
|
||||||
|
final line in the window. Setting this new variable to nil inhibits
|
||||||
|
this behavior.
|
||||||
|
|
||||||
*** The new library hierarchy.el has been added.
|
*** The new library hierarchy.el has been added.
|
||||||
It's a library to create, query, navigate and display hierarchy
|
It's a library to create, query, navigate and display hierarchy
|
||||||
structures.
|
structures.
|
||||||
|
|
|
||||||
15
lisp/term.el
15
lisp/term.el
|
|
@ -501,6 +501,13 @@ This variable is buffer-local."
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
:group 'term)
|
:group 'term)
|
||||||
|
|
||||||
|
(defcustom term-scroll-snap-to-bottom t
|
||||||
|
"Control whether to keep the prompt at the bottom of the window.
|
||||||
|
If non-nil, when the prompt is visible within the window, then
|
||||||
|
scroll so that the prompt is on the bottom on any input or
|
||||||
|
output."
|
||||||
|
:type 'boolean)
|
||||||
|
|
||||||
(defcustom term-scroll-show-maximum-output nil
|
(defcustom term-scroll-show-maximum-output nil
|
||||||
"Controls how interpreter output causes window to scroll.
|
"Controls how interpreter output causes window to scroll.
|
||||||
If non-nil, then show the maximum output when the window is scrolled.
|
If non-nil, then show the maximum output when the window is scrolled.
|
||||||
|
|
@ -3108,15 +3115,19 @@ See `term-prompt-regexp'."
|
||||||
(or (eq scroll 'this) (not save-point)))
|
(or (eq scroll 'this) (not save-point)))
|
||||||
(and (eq scroll 'others)
|
(and (eq scroll 'others)
|
||||||
(not (eq selected win))))
|
(not (eq selected win))))
|
||||||
|
(when term-scroll-snap-to-bottom
|
||||||
(goto-char term-home-marker)
|
(goto-char term-home-marker)
|
||||||
(recenter 0)
|
(recenter 0))
|
||||||
(goto-char (process-mark proc))
|
(goto-char (process-mark proc))
|
||||||
(if (not (pos-visible-in-window-p (point) win))
|
(if (not (pos-visible-in-window-p (point) win))
|
||||||
(recenter -1)))
|
(recenter -1)))
|
||||||
;; Optionally scroll so that the text
|
;; Optionally scroll so that the text
|
||||||
;; ends at the bottom of the window.
|
;; ends at the bottom of the window.
|
||||||
(when (and term-scroll-show-maximum-output
|
(when (and term-scroll-show-maximum-output
|
||||||
(>= (point) (process-mark proc)))
|
(>= (point) (process-mark proc))
|
||||||
|
(or term-scroll-snap-to-bottom
|
||||||
|
(not (pos-visible-in-window-p
|
||||||
|
(point-max) win))))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(recenter -1)))))
|
(recenter -1)))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue