Skip to content

Instantly share code, notes, and snippets.

@cfraizer
Created February 20, 2015 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfraizer/798447f23baf0ac0d491 to your computer and use it in GitHub Desktop.
Save cfraizer/798447f23baf0ac0d491 to your computer and use it in GitHub Desktop.
My version of glucas's functions
(require 'ace-window)
(defun ace-ido-find-file ()
"Ace ido-find-file."
(interactive)
(if (not (window-parent))
(ido-find-file-other-window)
(let ((start-window (selected-window)))
(unwind-protect
(progn
(let ((win (aw-select " Ace - Find File")))
(if (not (eq (window-frame start-window) (window-frame win)))
;; then
(select-frame-set-input-focus (window-frame win)))
(select-window win)
(ido-find-file)))
(select-frame-set-input-focus (window-frame start-window))
(aw-switch-to-window start-window)))))
(defun ace-ido-switch-buffer ()
"Ace ido-switch-buffer."
(interactive)
(if (not (window-parent))
(ido-switch-buffer-other-window)
(let ((start-window (selected-window)))
(unwind-protect
(progn
(let ((win (aw-select " Ace - Switch Buffer")))
(if (not (eq (window-frame start-window) (window-frame win)))
;; then
(select-frame-set-input-focus (window-frame win)))
(select-window win)
(ido-switch-buffer)))
(select-frame-set-input-focus (window-frame start-window))
(aw-switch-to-window start-window)))))
(provide 'ace-ido)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment