]> code.delx.au - gnu-emacs/commitdiff
Fix bug#22891: wrong terminal width when a fringe width is zero.
authorAnders Lindgren <andlind@gmail.com>
Tue, 26 Apr 2016 18:58:52 +0000 (20:58 +0200)
committerAnders Lindgren <andlind@gmail.com>
Wed, 27 Apr 2016 21:28:07 +0000 (23:28 +0200)
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)

lisp/term.el
lisp/window.el

index 8cdf0c0e77c44c4a5558475213e1d3f7b8c10e3e..7e44c57228e6f5fdd964bc2af2d83ce14c31e365 100644 (file)
@@ -915,19 +915,6 @@ is buffer-local."
 
 (term-set-escape-char (or term-escape-char ?\C-c))
 
-(defvar overflow-newline-into-fringe)
-
-(defun term-window-width ()
-  (if (and (not (featurep 'xemacs))
-          (display-graphic-p)
-          overflow-newline-into-fringe
-          ;; Subtract 1 from the width when any fringe has zero width,
-          ;; not just the right fringe.  Bug#18601.
-          (/= (frame-parameter nil 'left-fringe) 0)
-          (/= (frame-parameter nil 'right-fringe) 0))
-      (window-body-width)
-    (1- (window-body-width))))
-
 \f
 (put 'term-mode 'mode-class 'special)
 
@@ -1014,7 +1001,7 @@ Entry to this mode runs the hooks on `term-mode-hook'."
   (setq buffer-display-table term-display-table)
   (set (make-local-variable 'term-home-marker) (copy-marker 0))
   (set (make-local-variable 'term-height) (1- (window-height)))
-  (set (make-local-variable 'term-width) (term-window-width))
+  (set (make-local-variable 'term-width) (window-max-chars-per-line))
   (set (make-local-variable 'term-last-input-start) (make-marker))
   (set (make-local-variable 'term-last-input-end) (make-marker))
   (set (make-local-variable 'term-last-input-match) "")
index fd0fcc975bea2f125259f690e79a98892223b567..0d7dbd844e798c3e16cdcab5fd6b11f37d8fb44f 100644 (file)
@@ -8495,10 +8495,10 @@ WINDOWS is a list of windows associated with PROCESS.  REDUCER is
 a two-argument function used to combine the widths and heights of
 the given windows."
   (when windows
-    (let ((width (window-body-width (car windows)))
+    (let ((width (window-max-chars-per-line (car windows)))
           (height (window-body-height (car windows))))
       (dolist (window (cdr windows))
-        (setf width (funcall reducer width (window-body-width window)))
+        (setf width (funcall reducer width (window-max-chars-per-line window)))
         (setf height (funcall reducer height (window-body-height window))))
       (cons width height))))