unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'martin rudalics'" <rudalics@gmx.at>
Cc: 6385@debbugs.gnu.org
Subject: bug#6385: A slightly less aggressive fit-window-to-buffer
Date: Sun, 13 Jun 2010 09:33:47 -0700	[thread overview]
Message-ID: <BEAEE3EC739D4967AAFCE189C98617E9@us.oracle.com> (raw)
In-Reply-To: <4C14EC69.5000608@gmx.at>

>  > There doesn't seem to be a problem before Emacs 23. Maybe 
>  > there is a problem, theoretically, but I haven't
>  > encountered one. What about returning to the pre-23 code?
> 
> Please post a recipe for reproducing the problem.  I never had any
> problem with this in practice so I can't tell.

Huh? You yourself said this:

>> I don't know of a simple way to prevent deletion of windows when using
>> `enlarge-window'.  The problems with `fit-window-to-buffer' are just a
>> special case of that.

Any you said this:

>>> Deleting other windows when resizing was a misguided feature.

That "misguided feature" is precisely the problem.  You recognize it, so you
must have sufficient recipes to produce it.

I have not seen that problem arise in releases before Emacs 23, personally.  The
code (e.g. for `fit-window-to-buffer') was changed considerably in Emacs 23.  I
have supposed that at least part of that code change introduced this "misguided
feature".  Perhaps I'm mistaken about that, but as I say, I do see no such
problem prior to Emacs 23.

Were you involved with the code changes for this from Emacs 22 to 23?  Did those
changes in fact introduce this "misguided feature", or was it already present?  

As I say, I myself see no such "misguided feature" manifest itself prior to 23.
Even if the "misguided feature" is theoretically present also before 23, in my
own, practical experience it shows up only with Emacs 23.

Also, if you have some private code that removes this "misguided feature", why
does vanilla Emacs itself still suffer from it?  Is your fix not applicable in
general?  Does it have a downside that prevents you from applying it to vanilla
Emacs?

>  > What are your thoughts about let-binding 
>  > `min-window-height'?  What are the cases
>  > where that won't fix the problem?
> 
> Let-binding `window-min-height' (I suppose that's the variable you mean)

Yes, that's the variable I meant.

> can be used to make a window less than `window-min-height' 
> high.  Doing this can eventually cause the deletion of that
> window after the binding has been exited.

Obviously, if it is only that binding that prevents its deletion, then when the
binding is no longer in effect nothing will prevent its deletion.

As I said, I'm interested in the context of a popup window such as
*Completions*.  I want that window to fit its buffer as much as possible, but
without deleting any other windows.  Such a window has limited lifespan; when it
is deleted the other windows will naturally reclaim the space, and the variable
will no longer be bound (e.g. to 1).

I guess you are confirming that, so long as the binding (e.g. to 1) is in
effect, it will effectively always prevent window deletion?  That was my
question.  I wondered if this was always the case or if there were some cases
where it did not hold.

> This is not a speciality of `fit-window-to-buffer' but
> a consequence of the fact that Emacs can delete windows that 
> are smaller than `window-min-height' high.

It is the prevention that I'm interested in.  Whether the code causing the
problem is in `fit-window-to-buffer' itself or elsewhere is not very important
to me.  The problem manifests itself for me when I use `fit-window-to-buffer'.
It might also manifest itself for others in other contexts (dunno), but it is
`fit-window-to-buffer' that is, in effect, problematic for me (in Emacs 23+).

So my question still is: if `window-min-height' is 1, then is deletion (due to
enlarging or shrinking another window) always prevented?

If not, what are the situations where such a binding is not enough to prevent
deletion?  And is there, for such situations, another good prevention recipe?

I'm looking for good ways to deal practically with this "misguided feature" as
it manifests itself in `fit-window-to-buffer'.  Thx.






  parent reply	other threads:[~2010-06-13 16:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-09 18:56 bug#6385: A slightly less aggressive fit-window-to-buffer Lennart Borgman
2010-06-11 13:21 ` martin rudalics
2010-06-11 17:15   ` Lennart Borgman
2010-06-12  8:00     ` martin rudalics
2010-06-12 13:03       ` Lennart Borgman
2010-06-12 14:16         ` martin rudalics
2010-06-12 14:24           ` Lennart Borgman
2010-06-13  7:51             ` martin rudalics
2010-06-13 15:23               ` Lennart Borgman
2010-06-12 15:21       ` Drew Adams
2010-06-13  7:51         ` martin rudalics
2010-06-13 12:39           ` Drew Adams
2010-06-13 14:34             ` martin rudalics
2010-06-13 15:20               ` Lennart Borgman
2010-06-13 17:44                 ` martin rudalics
2010-06-13 17:48                   ` Lennart Borgman
2010-06-13 16:33               ` Drew Adams [this message]
2010-06-13 17:45                 ` martin rudalics
2010-06-13 18:21                   ` Drew Adams
2010-06-13 20:04                     ` Stefan Monnier
2010-06-14  6:49                     ` martin rudalics
2010-06-14  6:57                       ` Drew Adams
2011-10-11  9:31 ` 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=BEAEE3EC739D4967AAFCE189C98617E9@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=6385@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /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).