unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: bruce.connor.am@gmail.com
Cc: 21100@debbugs.gnu.org
Subject: bug#21100: 25.0.50; quit-restore-window should also retore width, not just height
Date: Tue, 21 Jul 2015 19:04:08 +0200	[thread overview]
Message-ID: <55AE7B88.2070402@gmx.at> (raw)
In-Reply-To: <CAAdUY-KXiXK17kaTCADX-1GWucfnkb3Zu=e++ionCgWcaCXVSg@mail.gmail.com>

 > This was from emacs -Q. On my machine (running Ubuntu), with a
 > maximized frame,

emacs -Q doesn't start in a maximized frame.

 > increasing the font-size doesn't make the frame
 > larger. Maybe it's a difference in the OS (I think on Windows if you
 > increase font-size the frame does get enlarged).

Not if it's maximized.  I spent some time on the code handling that.

 > The point is that the combination of font-size and frame-size has to
 > be such that two windows do not fit side-by-side. In this situation,
 > Emacs usually creates temp windows below the current window (instead
 > of to the right).

I have no problem resizing my frame so it makes either a new window on
the bottom or on the right.  The problem is that you are talking about
_reusing_ a window on the bottom or the right.

 > Here's a new recipe to verify what I'm explaining
 > now.
 >
 > 0. Start emacs -Q
 > 1. Resize the frame so that it is less than 30 columns wide, and at
 > least 30 lines tall.
 > 2. Type `C-h f point RET'.
 > 3. The temp window is created below.
 >
 > Now here is an updated recipe for the original behavior I was
 > describing (the fact that windows are vertically expanded to fit the
 > help buffer).
 >
 > 0. Start emacs -Q
 > 1. Resize the frame so that it is less than 30 columns wide, and at
 > least 30 lines tall.
 > 2. Type `C-- C-5 C-x C-2', to create a tiny window below.
 > 2. Type `C-h f point RET'.
 > 3. The temp buffer is displayed in the window you had created, and the
 > windows size is increased to half the frame.

Now I understand.  This resizing is due to `even-window-heights' being
non-nil by default.  If you set that to nil, no resizing is done.  Also,
with more than two windows, you get no resizing either.  This is a very
old option, introduced some time before automatic side-by-side splitting
was introduced.

 > 4. If you hit q on that help window, it will return to the original
 > height of 5 lines.

Funny.  I never even tested that.

 >> It's just that I don't know _why_ a reused window would be expanded.
 >> Can you point me to where in the code this expansion takes place?
 >
 > Some edebugging shows me it is done by
 > `display-buffer-use-some-window', and indeed I see a `window-resize'
 > in there.

The re-resizing should occur in `quit-restore-window' on this line:

	    (window-resize window (- (nth 3 quad) (window-total-height window)))

Please check.

So what you probably want is a new option `even-window-widths' (or maybe
`even-window-sizes') which, if non-nil, does for side-by-side splits the
same thing `even-window-heights' does for a below split.  And,
obviously, `quit-restore-window' should be able to size it back (I have
written this part already).  Suggestions welcome.

martin





  reply	other threads:[~2015-07-21 17:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21  9:03 bug#21100: 25.0.50; quit-restore-window should also retore width, not just height Artur Malabarba
2015-07-21 11:07 ` martin rudalics
2015-07-21 12:31   ` Artur Malabarba
2015-07-21 12:47     ` martin rudalics
2015-07-21 13:32       ` Artur Malabarba
2015-07-21 17:04         ` martin rudalics [this message]
2015-07-21 21:33           ` Artur Malabarba
2015-07-21 22:48             ` martin rudalics
2015-07-22 10:37           ` martin rudalics
2015-07-22 12:33             ` Artur Malabarba
2015-08-24  8:16               ` 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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55AE7B88.2070402@gmx.at \
    --to=rudalics@gmx.at \
    --cc=21100@debbugs.gnu.org \
    --cc=bruce.connor.am@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).