GNU bug report logs -
#54438
27.2; inconsistent-behavior-global-vs-local-hook
Previous Next
Full log
View this message in rfc822 format
> About the 'restoring mechanism'; the global hook seems not to restore the
> window selected before running the hook.
Right. You can easily test that yourself by calling
'run-window-configuration-change-hook' directly.
> So the 'restoring mechanism' works like you explained for the local hook
> but not for the global hook
> (where after calling 'test', the pop-up buffer will be selected).
Right. Because for running the global hook, Emacs does not enter the
(costly) window selection rigmarole. But I think that even for the
global hook you might be able to run into troubles when the current
buffer and that of the selected window differ. A case for the expert
only though.
> Also, I would expect that a hook just calls the hook function, and it would
> not 'restore the window
> selected before the hook'. I would say the restoring is undesired behavior.
The idea is probably that a function on that hook should be allowed to
inadvertently select some other window and have the hook runner fix
that. Maybe Stefan can tell us more.
In either case you can avoid these problems by running whatever you have
in mind on 'window-state-change-hook' with the following caveat:
• Window change functions should not create or delete windows or
change the buffer, size or selection status of any window because
there is no guarantee that the information about such a change will
be propagated to other window change functions. If at all, any
such change should be executed only by the last function listed by
the default value of ‘window-state-change-hook’.
martin
This bug report was last modified 3 years and 89 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.