From: Justin Burkett <justin@burkett.cc>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Patch for fit-window-to-buffer
Date: Tue, 3 Mar 2020 22:16:47 -0500 [thread overview]
Message-ID: <CAF8XuLgpJNyQOuc+jUdMSzOYs0D2ZOjDHnMxfgqshRNWyCUpPw@mail.gmail.com> (raw)
[-- 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)
next reply other threads:[~2020-03-04 3:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 3:16 Justin Burkett [this message]
2020-03-04 17:31 ` Patch for fit-window-to-buffer martin rudalics
2020-03-04 20:49 ` Justin Burkett
2020-03-05 9:12 ` martin rudalics
2020-03-05 9:39 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAF8XuLgpJNyQOuc+jUdMSzOYs0D2ZOjDHnMxfgqshRNWyCUpPw@mail.gmail.com \
--to=justin@burkett.cc \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.