Skip to content

Instantly share code, notes, and snippets.

@jollm
Created July 8, 2010 20:09
Show Gist options
  • Save jollm/468533 to your computer and use it in GitHub Desktop.
Save jollm/468533 to your computer and use it in GitHub Desktop.
(defun ido-bury-buffer-at-head ()
"Bury the buffer at the head of `ido-matches'.
If cursor is not at the end of the user input, delete to end of input."
(interactive)
(if (not (eobp))
(delete-region (point) (line-end-position))
(let ((enable-recursive-minibuffers t)
(buf (ido-name (car ido-matches))))
(when buf
(bury-buffer buf)
(setq ido-cur-list (append (remove (car ido-matches) ido-cur-list) (list (car ido-matches))))
(setq ido-rescan t)))))
(define-key ido-buffer-completion-map "\C-c\y" 'ido-bury-buffer-at-head)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment