all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#7381: 24.0.50; Provide a hook run when a window is selected
@ 2010-11-12  0:14 Štěpán Němec
  2010-11-12  0:53 ` Lennart Borgman
                   ` (3 more replies)
  0 siblings, 4 replies; 40+ messages in thread
From: Štěpán Němec @ 2010-11-12  0:14 UTC (permalink / raw)
  To: 7381

Severity: wishlist

The subject line says it all: could we get a `window-selected-hook' or
`window-selected-functions' or something?

Use case: I wanted to make myself a command to select the last selected
window (i.e., repeating the command would toggle between two windows).

After some head-scratching, the best I could come up with is this:

(defun .goto-mru-window ()
  (interactive)
  (select-window (frame-parameter nil '.last-selected-window)))

(defadvice select-window (before .save-selected-window activate)
  (set-frame-parameter nil '.last-selected-window (selected-window)))

...which seems to work most of the time, but using an advice doesn't
feel that great, esp. with C functions.

  Štěpán





^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2019-01-12 14:58 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-12  0:14 bug#7381: 24.0.50; Provide a hook run when a window is selected Štěpán Němec
2010-11-12  0:53 ` Lennart Borgman
2010-11-12 11:26   ` Štěpán Němec
2010-11-12  8:16 ` martin rudalics
2010-11-12 11:31   ` Štěpán Němec
2010-11-12 13:05     ` martin rudalics
2010-11-12 14:53       ` Štěpán Němec
2010-11-12 16:31         ` martin rudalics
2010-11-12 17:09           ` Štěpán Němec
2010-11-12 18:09             ` martin rudalics
2010-11-12 18:40               ` Štěpán Němec
2010-11-13  8:32                 ` martin rudalics
2010-11-13 12:13                   ` Štěpán Němec
2010-11-13 13:57                     ` martin rudalics
2010-11-13 15:23                       ` Štěpán Němec
2010-11-13 16:02                         ` martin rudalics
2010-11-14 12:51                           ` The window-pub branch (was Re: bug#7381: 24.0.50; Provide a hook run when a window is selected) Štěpán Němec
2010-11-14 18:59                             ` martin rudalics
2010-11-14 20:55                               ` The window-pub branch Štěpán Němec
2010-11-15  8:00                                 ` martin rudalics
2010-11-15 12:14                                   ` Štěpán Němec
2010-11-15 13:42                                     ` martin rudalics
2010-11-15 15:44                                       ` Štěpán Němec
2010-11-15 17:01                                         ` martin rudalics
2010-11-15 19:46                                           ` Štěpán Němec
2010-11-16 16:56                                             ` martin rudalics
2010-11-16 21:13                                               ` Štěpán Němec
2010-11-17  8:00                                                 ` martin rudalics
2010-11-17 12:05                                                   ` Štěpán Němec
2010-11-13 16:03                         ` bug#7381: 24.0.50; Provide a hook run when a window is selected martin rudalics
2010-11-13 18:49                           ` Chong Yidong
2010-12-23 17:07                             ` Štěpán Němec
2010-12-24  9:31                               ` martin rudalics
2010-12-29 11:21                               ` Chong Yidong
2010-12-30 16:06                                 ` Richard Stallman
2010-11-12 20:55 ` Stefan Monnier
2019-01-12  9:15 ` martin rudalics
2019-01-12 11:46   ` Štěpán Němec
2019-01-12 14:12     ` martin rudalics
2019-01-12 14:58       ` Štěpán Němec

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.