GNU bug report logs -
#7381
24.0.50; Provide a hook run when a window is selected
Previous Next
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
View this message in rfc822 format
martin rudalics <rudalics <at> gmx.at> writes:
>> Could `window-use-time' and `get-mru-window' (or at least the former) be
>> included in the trunk?
>
> Could you submit the trivial patch for `window-use-time'? I hardly ever
> use the trunk these days, so I'm a bit reluctant to install anything for
> it at the moment.
Sure. At the end of this mail is what I have in my local trunk copy
now.
> If you have enough space on your disk, testing window-pub would be
> obviously a perfect alternative.
Well, I did checkout that branch (I'm using the Git mirror), but it
seems to include much more changes than `window-use-time' and
`get-mru-window', and the last merge from trunk is from 30. October. You
mean you'd like to merge it into the trunk as a whole in the near
future, so you're looking for more testers?
-- 8< --
Subject: Add a `window-use-time' function.
From: Martin Rudalics <rudalics <at> gmx.at>
diff --git a/src/window.c b/src/window.c
index 7591401..414354c 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2420,6 +2420,17 @@ check_all_windows (void)
window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt);
}
+DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0,
+ doc: /* Return WINDOW's use time.
+WINDOW defaults to the selected window. The window with the highest use
+time is the most recently selected one. The window with the lowest use
+time is the least recently selected one. */)
+ (window)
+ Lisp_Object window;
+{
+ return decode_window (window)->use_time;
+}
+
DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 2, 0,
doc: /* Return the window least recently selected or used for display.
\(LRU means Least Recently Used.)
@@ -7216,6 +7227,7 @@ frame to be redrawn only if it is a tty frame. */);
defsubr (&Snext_window);
defsubr (&Sprevious_window);
defsubr (&Sother_window);
+ defsubr (&Swindow_use_time);
defsubr (&Sget_lru_window);
defsubr (&Sget_largest_window);
defsubr (&Sget_buffer_window);
--
Š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.