Subject: Re: bug#21333: 25.0.50; window-size-change-functions not called after mini-window resize

From: martin rudalics <[email-masked]>
Date: Fri, 28 Aug 2015 15:05:35 +0200

>> I don't understand.  We don't call ‘post-command-hook’ when resizing a
 >> window gets triggered by a timer.
 >
 > Can you show me some Lisp which causes this?  I'd like to see what am
 > I missing here.

I'm not sure what you mean but put the following snippet into your
*scratch* with emacs -Q and ‘eval-buffer’.

(defvar timer nil)
(defvar foo 0)
(defvar bar 0)

(defun foo ()
   "..."
   (setq foo (1+ foo))
   (if (>= (length (window-list)) 2)
       (delete-other-windows)
     (split-window))
   (when (timerp timer)
     (cancel-timer timer))
   (setq timer (run-with-idle-timer
	       (time-add (current-idle-time) 2)
	       t 'foo))
   (message "foo: %s ... %s" foo bar))

(defun bar ()
   "..."
   (setq bar (1+ bar))
   (message "bar: %s ... %s" foo bar))

(setq timer (run-with-idle-timer 2 t 'foo))

(add-hook 'post-command-hook 'bar)

You will see that eventually only foo increases while bar remains
fixed.

martin