]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/window.el (fit-window-to-buffer): Fix width calculation
authorMorgan Smith <Morgan.J.Smith@outlook.com>
Sun, 12 May 2024 13:19:30 +0000 (09:19 -0400)
committerEshel Yaron <me@eshelyaron.com>
Thu, 23 May 2024 07:42:08 +0000 (09:42 +0200)
When PIXELWISE is nil, we still calculate width in pixels and
then convert it to columns.  However, part of the calculation
was using columns where it should have used pixels.  (Bug#70894)

(cherry picked from commit 42d444114d8df0ffddf1e80891a386c0edcbd976)

lisp/window.el

index 4adad916f475a189870f6574b15752f339bb5c5b..0da64bb5d7f39f7fc267a825184d7e578e958687 100644 (file)
@@ -9922,8 +9922,8 @@ accessible position."
                               ;; the bottom is wider than the window.
                               (* (window-body-height window pixelwise)
                                  (if pixelwise 1 char-height))))
-                         (- total-width
-                            (window-body-width window pixelwise)))))
+                         (- (* total-width (if pixelwise 1 char-width))
+                            (window-body-width window t)))))
          (unless pixelwise
            (setq width (/ (+ width char-width -1) char-width)))
           (setq width (max min-width (min max-width width)))