From: martin rudalics <rudalics@gmx.at>
To: 17065@debbugs.gnu.org
Subject: bug#17065: 24.3.50; Revise line 5944 of window.el to use `window-width`, instead of `window-total-width`.
Date: Sat, 22 Mar 2014 10:41:00 +0100 [thread overview]
Message-ID: <532D5AAC.7020608@gmx.at> (raw)
In-Reply-To: <m261n7f25w.wl%esq@lawlist.com>
> (defun broken-example ()
> (interactive)
> (window--display-buffer
> ;; buffer
> (get-buffer-create "*test*")
> ;; window
> (split-window (selected-window) nil 'right)
> ;; type
> 'window
> ;; alist
> '((window-width . 82))
> ;; dedicated
> t)
> (message "Window Width: %s" (window-width (get-buffer-window "*test*"))) )
Conceptually, the `window-width' alist entry specifies the new total
width of the window, including fringes, scrollbars and vertical
dividers. You mean that specifiying the number of text columns is more
intuitive? I might agree, but unfortunately _all_ window resizing
functions intepret "width" in terms of the total width of a window.
Making an exception for this special case would only increase the
confusion.
The confusion has historical reasons and was not considered important,
likely so, because side-by-side windows are in use more frequently only
over the past years. If, with emacs -Q, I do
(let ((window (split-window (selected-window) -20 'right)))
(window-body-width window))
I get 16 text columns for the new window which is likely not what I
expected as someone using this function for the first time with an
explicit SIZE argument.
In any case, I will have to adjust some doc-strings and the Elisp
manual. So far the only hint is the doc-string of `split-window-right'
which says
Here, SIZE includes the width of the window's scroll bar; if there are
no scroll bars, it includes the width of the divider column to the
window's right, if any.
but I'm struggling with this issue ever since.
martin
next prev parent reply other threads:[~2014-03-22 9:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-22 1:32 bug#17065: 24.3.50; Revise line 5944 of window.el to use `window-width`, instead of `window-total-width` Keith David Bershatsky
2014-03-22 9:41 ` martin rudalics [this message]
2021-10-23 5:09 ` Stefan Kangas
2021-10-24 9:48 ` martin rudalics
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=532D5AAC.7020608@gmx.at \
--to=rudalics@gmx.at \
--cc=17065@debbugs.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.