GNU bug report logs - #7381
24.0.50; Provide a hook run when a window is selected

Previous Next

Package: emacs;

Reported by: Štěpán Němec <stepnem <at> gmail.com>

Date: Fri, 12 Nov 2010 00:12:02 UTC

Severity: wishlist

Merged with 16436

Found in version 24.0.50

Fixed in version 27.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #87 received at 7381 <at> debbugs.gnu.org (full text, mbox):

From: Štěpán Němec <stepnem <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>, 7381 <at> debbugs.gnu.org
Subject: Re: bug#7381: 24.0.50; Provide a hook run when a window is selected
Date: Sat, 12 Jan 2019 15:58:12 +0100
On Sat, 12 Jan 2019 15:12:13 +0100
martin rudalics wrote:

>  >> (defun .update-old-selected-window (frame)
>  >>     (unless (eq .update-old-selected-window old-selected-window)
>  >>       (setq .old-selected-window (old-selected-window))))
>  >
>  > It seems to me this was meant to read
>  >
>  >   (defun .update-old-selected-window (frame)
>  >      (unless (eq .old-selected-window (old-selected-window))
>  >        (setq .old-selected-window (old-selected-window))))
>
> Indeed.  I posted the example to make the point that
>
> (defun .update-old-selected-window (frame)
>    (setq .old-selected-window (old-selected-window)))
>
> is a bad idea since it would overwrite the last selected window that
> was different from the currently selected one.

Of course.

> BTW, did you ever try something like
>
> (defun .goto-mru-window ()
>    (interactive)
>    (select-window (get-mru-window nil nil t)))

I don't remember, but given that I do have a `.get-mru-window' function
of my own, as well as the fact that e.g. evil-mode's `evil-window-mru'
definition doesn't use `get-mru-window' either, makes me think that it
either wasn't available at the time or doesn't do what I or evil authors
wanted.

  Thanks again,

  Štěpán




This bug report was last modified 6 years and 136 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.