emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 4d1e4a4893: Fix 'window-max-chars-per-line' when there are no f


From: Eli Zaretskii
Subject: emacs-29 4d1e4a4893: Fix 'window-max-chars-per-line' when there are no fringes
Date: Sat, 17 Dec 2022 07:05:16 -0500 (EST)

branch: emacs-29
commit 4d1e4a48938be8a08e294b4a5711a2c8ce941a5a
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix 'window-max-chars-per-line' when there are no fringes
    
    * lisp/window.el (window-max-chars-per-line): Fix the way we
    account for the fringes by calling 'window-fringes'.  (Bug#59963)
---
 lisp/window.el | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/lisp/window.el b/lisp/window.el
index 7d8ee48635..a4a8421881 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -2162,17 +2162,14 @@ the font."
     (let* ((window-width (window-body-width window t))
           (font-width (window-font-width window face))
           (ncols (- (/ window-width font-width)
-                     (ceiling (line-number-display-width 'columns)))))
+                     (ceiling (line-number-display-width 'columns))))
+           (fringes (window-fringes window))
+           (lfringe (car fringes))
+           (rfringe (nth 1 fringes)))
       (if (and (display-graphic-p)
               overflow-newline-into-fringe
-               (not
-                (or (eq left-fringe-width 0)
-                    (and (null left-fringe-width)
-                         (= (frame-parameter nil 'left-fringe) 0))))
-               (not
-                (or (eq right-fringe-width 0)
-                    (and (null right-fringe-width)
-                         (= (frame-parameter nil 'right-fringe) 0)))))
+               (not (eq lfringe 0))
+               (not (eq rfringe 0)))
          ncols
         ;; FIXME: This should remove 1 more column when there are no
         ;; fringes, lines are truncated, and the window is hscrolled,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]