* Is there a hook when current window or buffer changes?
@ 2013-04-02 19:15 Steven Degutis
0 siblings, 0 replies; 5+ messages in thread
From: Steven Degutis @ 2013-04-02 19:15 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 251 bytes --]
Advising functions is limited. For example, if you select a window with
your mouse, no function is called interactively, it just changes the window.
Maybe I can use the same hook modeline uses to know how to color itself
active or inactive?
-Steven
[-- Attachment #2: Type: text/html, Size: 327 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is there a hook when current window or buffer changes?
[not found] <mailman.23326.1364930131.855.help-gnu-emacs@gnu.org>
@ 2013-04-02 19:43 ` Lowell Gilbert
2013-04-02 21:08 ` Michael Heerdegen
2013-04-02 21:32 ` Michael Heerdegen
2 siblings, 0 replies; 5+ messages in thread
From: Lowell Gilbert @ 2013-04-02 19:43 UTC (permalink / raw)
To: help-gnu-emacs
Steven Degutis <sbdegutis@gmail.com> writes:
> Advising functions is limited. For example, if you select a window with
> your mouse, no function is called interactively, it just changes the window.
mouse-leave-buffer-hook?
mouse-select-window?
mouse-drag-region?
> Maybe I can use the same hook modeline uses to know how to color itself
> active or inactive?
Not a good idea. A lot of the modeline handling isn't done in lisp.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is there a hook when current window or buffer changes?
[not found] <mailman.23326.1364930131.855.help-gnu-emacs@gnu.org>
2013-04-02 19:43 ` Is there a hook when current window or buffer changes? Lowell Gilbert
@ 2013-04-02 21:08 ` Michael Heerdegen
2013-04-02 21:28 ` Steven Degutis
2013-04-02 21:32 ` Michael Heerdegen
2 siblings, 1 reply; 5+ messages in thread
From: Michael Heerdegen @ 2013-04-02 21:08 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: help-gnu-emacs
Steven Degutis <sbdegutis@gmail.com> writes:
> Advising functions is limited. For example, if you select a window
> with your mouse, no function is called interactively, it just changes
> the window.
No, `mouse-set-point' is called.
> Maybe I can use the same hook modeline uses to know how to color
> itself active or inactive?
What do you want to do, at the end?
Regards,
Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is there a hook when current window or buffer changes?
2013-04-02 21:08 ` Michael Heerdegen
@ 2013-04-02 21:28 ` Steven Degutis
0 siblings, 0 replies; 5+ messages in thread
From: Steven Degutis @ 2013-04-02 21:28 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 570 bytes --]
I created a thread `auto-dim-other-windows` about it.
-Steven
On Tue, Apr 2, 2013 at 4:08 PM, Michael Heerdegen
<michael_heerdegen@web.de>wrote:
> Steven Degutis <sbdegutis@gmail.com> writes:
>
> > Advising functions is limited. For example, if you select a window
> > with your mouse, no function is called interactively, it just changes
> > the window.
>
> No, `mouse-set-point' is called.
>
> > Maybe I can use the same hook modeline uses to know how to color
> > itself active or inactive?
>
> What do you want to do, at the end?
>
>
> Regards,
>
> Michael.
>
>
[-- Attachment #2: Type: text/html, Size: 1069 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is there a hook when current window or buffer changes?
[not found] <mailman.23326.1364930131.855.help-gnu-emacs@gnu.org>
2013-04-02 19:43 ` Is there a hook when current window or buffer changes? Lowell Gilbert
2013-04-02 21:08 ` Michael Heerdegen
@ 2013-04-02 21:32 ` Michael Heerdegen
2 siblings, 0 replies; 5+ messages in thread
From: Michael Heerdegen @ 2013-04-02 21:32 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: help-gnu-emacs
Hi again,
to your original question: no, there is no hook and no trivial
substitute AFAIK.
The reason may be that Emacs often temporarily selects different windows
in the background. An example is `walk-windows', which explicitly calls
`select-window'. So, if there was a hook, it would presumably be called
all the time in situations where you wouldn't expect it.
The solution to your problem depends on what you want to do.
`post-command-hook' could be an option.
Regards,
Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-04-02 21:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.23326.1364930131.855.help-gnu-emacs@gnu.org>
2013-04-02 19:43 ` Is there a hook when current window or buffer changes? Lowell Gilbert
2013-04-02 21:08 ` Michael Heerdegen
2013-04-02 21:28 ` Steven Degutis
2013-04-02 21:32 ` Michael Heerdegen
2013-04-02 19:15 Steven Degutis
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).