all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Pip Cet <pipcet@gmail.com>
Cc: 21333@debbugs.gnu.org
Subject: bug#21333: 25.0.50; window-size-change-functions not called after mini-window resize
Date: Mon, 24 Aug 2015 17:35:46 +0300	[thread overview]
Message-ID: <83k2skhhz1.fsf@gnu.org> (raw)
In-Reply-To: <CAOqdjBfhVv4t-33OuZoSiApH6wAKfkrGfSxoWUvJ-h5OyoS5vA@mail.gmail.com>

> Date: Sun, 23 Aug 2015 22:06:45 +0000
> From: Pip Cet <pipcet@gmail.com>
> 
> This is possibly only a documentation issue.

Possibly.

> Recipe: eval
> (progn (push (lambda (&rest args) (message "window size changed"))
> window-size-change-functions)
>     (message (make-string 3000 ?*)))
> 
> Expected result: a "window size changed" message.
> 
> Actual result: no such message.
> 
> The symptom is that the window size change function is not run after a
> mini-window size change.

Note that resizing the mini-window involves resizing of at least one
other window on the same frame.  So this is not exactly about the
mini-window.

> So far, I can produce this behavior only when the minibuffer or echo
> area grows to several lines; when it shrinks afterwards, my window size
> change function is called.

I don't see the message even when the mini-window shrinks back.  Are
you sure the message you see is not triggered by some other event?
It's way too easy to trigger it, see below.

> I cannot reproduce the behavior with other windows.

See above: at least one other window is resized in this recipe, so the
exemption is not about the mini-window itself, it's about any window
involved in resizing in this particular scenario.

> Is this a bug? The documentation says:
> 
>     [...] to be called if the size of any window changes for any reason.
> 
> Please correct me if I'm wrong, but when the minibuffer/echo area gets
> resized (and the windows on top of it, too), that counts as a change of
> size, I would say.

I believe the original reason for this is largely historical:
window-size-change-functions exists since Emacs 19.29, whereas
automatic resizing of mini-window was introduced in Emacs 21.  Since
Emacs before 21 didn't have the mini-window resizing functionality,
Emacs 21 was careful not to gratuitously trigger these functions by
something that is purely a new redisplay feature.

That said, I wonder whether changing the code now to call these
functions due to automatic resizing would make sense.  What would be
the real-life use cases for using that?

I believe window-size-change-functions is meant for taking notice of
resizes done by the user or some Lisp code, not for automated resizes
whose sole purpose is to allow some message be read in its entirety.
If you agree, then the current behavior will make sense to you.

If anything, IMO we should _reduce_ the number of unrelated events
that trigger a call to these functions.  For example, currently any
command that reads from the minibuffer will trigger it, because when
read-from-minibuffer exits, it restores the window configuration by
calling set-window-configuration, which is documented to trigger these
functions.  That just doesn't make any sense to me, since most reads
from the minibuffer don't resize any windows!

> If this is merely a documentation issue, the exception should be noted
> in the manual.

That's easy.  Deciding what's TRT in this case is harder.

> If this behavior is deliberate, I believe it is inconsistent to set
> FRAME_WINDOW_SIZES_CHANGED (f) in `resize-mini-window-internal'.

It's consistent if we adopt the POV that this feature only catches
resizes from Lisp code.





  parent reply	other threads:[~2015-08-24 14:35 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-23 22:06 bug#21333: 25.0.50; window-size-change-functions not called after mini-window resize Pip Cet
2015-08-24  8:18 ` martin rudalics
2015-08-24 11:08   ` Pip Cet
2015-08-24 12:41     ` martin rudalics
2015-08-24 14:35 ` Eli Zaretskii [this message]
2015-08-24 18:06   ` martin rudalics
2015-08-24 18:30     ` Eli Zaretskii
2015-08-25  7:25       ` martin rudalics
2015-08-25 10:34         ` Pip Cet
2015-08-25 15:19           ` Eli Zaretskii
2015-08-26  7:08           ` martin rudalics
2015-08-25 15:11         ` Eli Zaretskii
2015-08-26  7:09           ` martin rudalics
2015-08-26 15:29             ` Eli Zaretskii
2015-08-27  7:57               ` martin rudalics
2015-08-27 15:29                 ` Eli Zaretskii
2015-08-27 17:05                   ` Pip Cet
2015-08-27 17:59                     ` martin rudalics
2015-08-27 18:04                       ` Pip Cet
2015-08-28  8:03                         ` martin rudalics
2015-08-28  8:19                           ` Pip Cet
2015-08-28  8:45                             ` Pip Cet
2015-08-27 18:35                     ` Eli Zaretskii
2015-08-27 17:58                   ` martin rudalics
2015-08-24 18:13   ` Pip Cet
2015-08-24 19:03     ` Eli Zaretskii
2015-08-25  7:25       ` martin rudalics
2015-08-25 15:12         ` Eli Zaretskii
2015-08-26  7:09           ` martin rudalics
2015-08-26 10:07             ` Pip Cet
2015-08-26 13:01               ` martin rudalics
2015-08-26 16:00                 ` Pip Cet
2015-08-27  7:59                   ` martin rudalics
2015-08-27 15:25                     ` Eli Zaretskii
2015-08-27 16:35                       ` Pip Cet
2015-08-27 17:59                         ` martin rudalics
2015-08-27 18:57                         ` Eli Zaretskii
2015-08-27 20:49                           ` Pip Cet
2015-08-28 10:02                             ` Eli Zaretskii
2015-08-28 12:34                               ` Pip Cet
2015-08-28 13:13                                 ` Eli Zaretskii
2015-08-28 13:26                                   ` Pip Cet
2015-08-26 15:36               ` Eli Zaretskii
2015-08-27  7:58                 ` martin rudalics
2015-08-27 15:24                   ` Eli Zaretskii
2015-08-27 17:58                     ` martin rudalics
2015-08-27 18:39                       ` Eli Zaretskii
2015-08-27 19:00                         ` Eli Zaretskii
2015-08-28  8:04                           ` martin rudalics
2015-08-28  8:47                             ` Eli Zaretskii
2015-08-28 10:51                               ` martin rudalics
2015-08-28 12:46                                 ` Eli Zaretskii
2015-08-28 13:05                                   ` martin rudalics
2015-08-26 15:32             ` Eli Zaretskii
2015-08-27  7:57               ` martin rudalics
2016-02-22 12:59   ` Fix `window-configuration-change-hook' and `window-size-change-functions' martin rudalics
2016-02-23 11: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

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

  git send-email \
    --in-reply-to=83k2skhhz1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=21333@debbugs.gnu.org \
    --cc=pipcet@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 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.