Skip to content

Instantly share code, notes, and snippets.

@xuchunyang
Created October 3, 2015 13:43
Show Gist options
  • Save xuchunyang/1eb0699cf7b78d4f8cf4 to your computer and use it in GitHub Desktop.
Save xuchunyang/1eb0699cf7b78d4f8cf4 to your computer and use it in GitHub Desktop.
Use mouse to select a window for file/buffer
(let* ((ev (read-event "Select a window with mouse: " nil))
(pos (when (consp ev) (nth 1 ev)))
(wind (when pos (posn-window pos))))
(message-box "%s - %s" (current-buffer) ev))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment