all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Patch for fit-window-to-buffer
@ 2020-03-04  3:16 Justin Burkett
  2020-03-04 17:31 ` martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Justin Burkett @ 2020-03-04  3:16 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 210 bytes --]

Hello,

I found a bug in the master and emacs-27 versions of fit-window-to-buffer.
Another window's data might be used to determine the new width. I'm
attaching a patch which I believe fixes the issue.

Justin

[-- Attachment #1.2: Type: text/html, Size: 292 bytes --]

[-- Attachment #2: 0001-lisp-window.el-fit-window-to-buffer-Don-t-use-wrong-.patch --]
[-- Type: application/octet-stream, Size: 931 bytes --]

From 02915c7c1b2b166d7dd0302bfac3f9ef880cbe59 Mon Sep 17 00:00:00 2001
From: Justin Burkett <justin@burkett.cc>
Date: Tue, 3 Mar 2020 22:01:29 -0500
Subject: [PATCH] * lisp/window.el (fit-window-to-buffer): Don't use wrong
 window data

---
 lisp/window.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/window.el b/lisp/window.el
index bd825c09e1..61c32ac72f 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -9124,7 +9124,8 @@ fit-window-to-buffer
 	       ;; wider than its frame's pixel width, its height
 	       ;; remains unaltered.
 	       (width (+ (car (window-text-pixel-size
-			       window (window-start) (point-max)
+			       window (window-start window)
+                               (with-selected-window window (point-max))
 			       (frame-pixel-width)
 			       ;; Add one line-height to assure that
 			       ;; we're on the safe side.  This
-- 
2.21.1 (Apple Git-122.3)


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-05  9:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-04  3:16 Patch for fit-window-to-buffer Justin Burkett
2020-03-04 17:31 ` martin rudalics
2020-03-04 20:49   ` Justin Burkett
2020-03-05  9:12     ` martin rudalics
2020-03-05  9:39       ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.