Browse files

Added select-window-by-name command.

Differs from select-window in that it requires an exact match for the
window name.  This is useful if you use completion and have windows
whose names are a prefix of others.
  • Loading branch information...
1 parent e07cf3c commit 3d153bf9df2347e7eb92192f79967ba760651a77 @dangerousben dangerousben committed Apr 4, 2010
Showing with 7 additions and 0 deletions.
  1. +7 −0 window.lisp
@@ -879,6 +879,13 @@ window. Default to the current window. if
(defcommand-alias select select-window)
+(defcommand select-window-by-name (name) ((:window-name "Select: "))
+ "Switch to the first window whose name is exactly @var{name}."
+ (let ((win (find name (group-windows (current-group))
+ :test #'string= :key #'window-name)))
+ (when win
+ (group-focus-window (current-group) win))))
(defcommand select-window-by-number (num &optional (group (current-group)))
((:window-number "Select: "))
"Find the window with the given number and focus it in its frame."

0 comments on commit 3d153bf

Please sign in to comment.