diff options
| author | Anders Lindgren | 2016-04-26 20:58:52 +0200 |
|---|---|---|
| committer | Anders Lindgren | 2016-04-27 23:28:07 +0200 |
| commit | ff7e201ed87d206334afedd4366deebba440efde (patch) | |
| tree | 5d49a00bcb70bf5443748d69bac1da2581e4a57c | |
| parent | 71fb0e06e7e04d8300be10feffd3d314a76b4d27 (diff) | |
| download | emacs-ff7e201ed87d206334afedd4366deebba440efde.tar.gz emacs-ff7e201ed87d206334afedd4366deebba440efde.zip | |
Fix bug#22891: wrong terminal width when a fringe width is zero.
When either fringe width is zero, Emacs reserved one column for a
continuation glyph. Terminal windows does not take this into
account when the frame is resized.
* lisp/window.el (window-adjust-process-window-size): Use
`window-max-chars-per-line' instead of `window-body-width'.
* lisp/term.el (term-window-width): Remove function. (It does the
same as `window-max-chars-per-line' but without recent bug fixes.)
(term-mode): Use `window-max-chars-per-line' instead of
`term-window-width'.
Backport
(cherry picked from commit 5b5403289888efe8783ae6a405845b925f544ec1)
| -rw-r--r-- | lisp/term.el | 15 | ||||
| -rw-r--r-- | lisp/window.el | 4 |
2 files changed, 3 insertions, 16 deletions
diff --git a/lisp/term.el b/lisp/term.el index 8cdf0c0e77c..7e44c57228e 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -915,19 +915,6 @@ is buffer-local." | |||
| 915 | 915 | ||
| 916 | (term-set-escape-char (or term-escape-char ?\C-c)) | 916 | (term-set-escape-char (or term-escape-char ?\C-c)) |
| 917 | 917 | ||
| 918 | (defvar overflow-newline-into-fringe) | ||
| 919 | |||
| 920 | (defun term-window-width () | ||
| 921 | (if (and (not (featurep 'xemacs)) | ||
| 922 | (display-graphic-p) | ||
| 923 | overflow-newline-into-fringe | ||
| 924 | ;; Subtract 1 from the width when any fringe has zero width, | ||
| 925 | ;; not just the right fringe. Bug#18601. | ||
| 926 | (/= (frame-parameter nil 'left-fringe) 0) | ||
| 927 | (/= (frame-parameter nil 'right-fringe) 0)) | ||
| 928 | (window-body-width) | ||
| 929 | (1- (window-body-width)))) | ||
| 930 | |||
| 931 | 918 | ||
| 932 | (put 'term-mode 'mode-class 'special) | 919 | (put 'term-mode 'mode-class 'special) |
| 933 | 920 | ||
| @@ -1014,7 +1001,7 @@ Entry to this mode runs the hooks on `term-mode-hook'." | |||
| 1014 | (setq buffer-display-table term-display-table) | 1001 | (setq buffer-display-table term-display-table) |
| 1015 | (set (make-local-variable 'term-home-marker) (copy-marker 0)) | 1002 | (set (make-local-variable 'term-home-marker) (copy-marker 0)) |
| 1016 | (set (make-local-variable 'term-height) (1- (window-height))) | 1003 | (set (make-local-variable 'term-height) (1- (window-height))) |
| 1017 | (set (make-local-variable 'term-width) (term-window-width)) | 1004 | (set (make-local-variable 'term-width) (window-max-chars-per-line)) |
| 1018 | (set (make-local-variable 'term-last-input-start) (make-marker)) | 1005 | (set (make-local-variable 'term-last-input-start) (make-marker)) |
| 1019 | (set (make-local-variable 'term-last-input-end) (make-marker)) | 1006 | (set (make-local-variable 'term-last-input-end) (make-marker)) |
| 1020 | (set (make-local-variable 'term-last-input-match) "") | 1007 | (set (make-local-variable 'term-last-input-match) "") |
diff --git a/lisp/window.el b/lisp/window.el index fd0fcc975be..0d7dbd844e7 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -8495,10 +8495,10 @@ WINDOWS is a list of windows associated with PROCESS. REDUCER is | |||
| 8495 | a two-argument function used to combine the widths and heights of | 8495 | a two-argument function used to combine the widths and heights of |
| 8496 | the given windows." | 8496 | the given windows." |
| 8497 | (when windows | 8497 | (when windows |
| 8498 | (let ((width (window-body-width (car windows))) | 8498 | (let ((width (window-max-chars-per-line (car windows))) |
| 8499 | (height (window-body-height (car windows)))) | 8499 | (height (window-body-height (car windows)))) |
| 8500 | (dolist (window (cdr windows)) | 8500 | (dolist (window (cdr windows)) |
| 8501 | (setf width (funcall reducer width (window-body-width window))) | 8501 | (setf width (funcall reducer width (window-max-chars-per-line window))) |
| 8502 | (setf height (funcall reducer height (window-body-height window)))) | 8502 | (setf height (funcall reducer height (window-body-height window)))) |
| 8503 | (cons width height)))) | 8503 | (cons width height)))) |
| 8504 | 8504 | ||