bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#7381: 24.0.50; Provide a hook run when a window is selected


From: martin rudalics
Subject: bug#7381: 24.0.50; Provide a hook run when a window is selected
Date: Sat, 12 Jan 2019 15:12:13 +0100

>> (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.

BTW, did you ever try something like

(defun .goto-mru-window ()
  (interactive)
  (select-window (get-mru-window nil nil t)))

(global-set-key [(control .)] '.goto-mru-window)

It should provide the same service for older Emacsen.

martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]