I'm generally using ido-switch-buffer, but sometimes when there are too many candidates,
helm-buffers-list is preferable. But it's a hassle to break out of ido,
call helm and re-enter the lost information.
So I wrote this code, that re-uses information entered in ido directly in helm:
(require 'helm-buffers)
(defun switch-to-helm-buffers-list ()
"Emulate `helm-buffers-list' call with ido contents as initial input."
(interactive)
(let ((str (minibuffer-contents-no-properties)))
(helm :sources '(helm-source-buffers-list
helm-source-ido-virtual-buffers
helm-source-buffer-not-found)
:buffer "*helm buffers*"
:keymap helm-buffer-map
:truncate-lines t
:input str)
;; (ido-exit-minibuffer)
))
(add-hook
'ido-setup-hook
(lambda()
(define-key ido-buffer-completion-map "\C-i"
'switch-to-helm-buffers-list)))
One problem is that ido is left to linger in the minibuffer.
When I add a call ido-exit-minibuffer before helm, it's not called.
And when I add it after, it resets the window configuration.
How can I solve this problem?
ido-exit-minibufferin a recursive minibuffer does nothing. – PythonNut Jan 8 '14 at 18:40(top-level)might do the trick: "Exit all recursive editing levels. This also exits all active minibuffers."? To just exit one level of recursive edit, perhaps something like this:(if (> (recursion-depth) 0) (throw 'exit nil))– lawlist Jan 8 '14 at 18:52