unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: joostkremers@fastmail.fm, 22009@debbugs.gnu.org
Subject: bug#22009: PATCH: Use `window-total-width' in `window-splittable-p'
Date: Thu, 26 Nov 2015 19:06:07 +0100	[thread overview]
Message-ID: <56574A0F.101@gmx.at> (raw)
In-Reply-To: <8337vsvfj6.fsf@gnu.org>

 >> Note that ‘window-splittable-p’ is exclusively used by ‘display-buffer’
 >> and the probability is very high that the new window will not be used
 >> for displaying the buffer of the original window.  The new window will
 >> very likely have its own margins and header line.
 >
 > Is it forbidden to call that function from any other Lisp?  If so,
 > disregard what I wrote.  But if not, window-splittable-p should do a
 > correct job no matter who calls it, do you agree?

Presently ‘window-splittable-p’ is misnamed and I think that's the main
cause of the confusion.  But its doc-string clearly names
‘split-window-sensibly’ as the caller (which is misnamed as well but all
of these were written before ‘display-buffer’ was reorganized).  In any
case both functions belong exclusively to ‘display-buffer’ and are not
related to C-x 3.

 > My text that you quoted here talks about the "normal" case, where the
 > margins stay put upon splitting windows.  I'm saying that in such a
 > situation a decision made using the total width could be terribly
 > wrong.

But the "normal" case where this happens is C-x 3 and there the mode
that created the large margins should adapt.

 >> ‘window-min-width’ (and all related variables and functions) refer to
 >> the total width of windows.  Changing its semantics would constitute
 >> quite some effort.
 >
 > If it's complicated, let's do that on master.  But do it we must, IMO.

Basically it would amount to ‘split-window-horizontally’ telling us that
it can't split the window.  Which might not be the intention of the user
who expects the margins (whose sole purpose is to center the text in the
window) to shrink accordingly.

But honestly I don't know which implications changing the semantics of
‘window-min-width’ could have.  I could imagine adding a new option say
‘window-min-text-width’ and have the resizing routines respect this as
far as possible.

But sanitizing window sizes when, for example, making a frame very
small, would have to ignore such an option anyway.  The text area is the
only part I can freely shrink and enlarge down to one line and two
columns.  I cannot restore previous fringes, margins and scroll bars
once I have shrunk them because I don't remember their previous size.
And adding for every window a slot, say previous_left_fringe_width,
remembering it in window configurations, setting it when a user sets
‘set-window-fringes’ in between is something I'm not inclined to do.

 >>   > The modes that triggered this are special in that they adapt their
 >>   > margins to the split, but how would window-splittable-p know that?
 >>   > Perhaps such modes should override that function, or maybe we should
 >>   > provide a hook for them?
 >>
 >> This is not mode-triggered.
 >
 > In my text, "this" referred to this bug report.

If you mean that a mode introducing large margins should override
‘split-window-sensibly’ then this is not TRT.  ‘split-window-sensibly’
is user territory and ‘window-splittable-p’ too.

martin






  reply	other threads:[~2015-11-26 18:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 13:07 bug#22009: PATCH: Use `window-total-width' in `window-splittable-p' Joost Kremers
2015-11-25 17:48 ` martin rudalics
2015-11-25 18:04   ` Eli Zaretskii
2015-11-25 18:14     ` martin rudalics
2015-11-25 19:15       ` Eli Zaretskii
2015-11-26  8:23         ` martin rudalics
2015-11-26 15:46           ` Eli Zaretskii
2015-11-26 16:58             ` martin rudalics
2015-11-26 17:25               ` Eli Zaretskii
2015-11-26 18:06                 ` martin rudalics [this message]
2015-11-26 18:36                   ` Eli Zaretskii
2015-11-27  8:27                     ` martin rudalics
2015-11-27 20:51                       ` Eli Zaretskii
2015-11-28 10:26                         ` martin rudalics
2015-11-28 14:49                           ` Eli Zaretskii
2015-11-28 15:49                             ` martin rudalics
2015-12-01 12:47                           ` Joost Kremers
2015-11-27  1:16 ` Joost Kremers
2015-11-27  8:28   ` martin rudalics
2015-12-01 14:11     ` Joost Kremers
2015-11-27 20:56   ` Eli Zaretskii
2015-12-01 12:59     ` Joost Kremers
2015-12-01 15:44       ` Eli Zaretskii
2015-12-01 17:31         ` Joost Kremers
2020-09-07 16:48 ` Lars Ingebrigtsen
2020-09-08  8:50   ` Joost Kremers
2020-09-08 10:05     ` Lars Ingebrigtsen

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=56574A0F.101@gmx.at \
    --to=rudalics@gmx.at \
    --cc=22009@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=joostkremers@fastmail.fm \
    /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).