I use Ido mode as well as Ergoemacs mode, which binds the find-file to Co. When you browse files, you can temporarily disable Ido by pressing Cx Cf inside the minibuffer. I want to change it to Co , so I can click it twice to run find-file without Ido. How can i do this?
In ido.el I see that Ido uses the ido-init-completion-maps function, where it defines the keys by running code like
(let ((map (make-sparse-keymap))) (define-key map "\Cx\Cf" 'ido-fallback-command))
However, I'm not sure how to use this to bind ido-fallback-command to Co inside the minibuffer.
Emacs Version: 24.0.94.1
Change (03/20/12) . After discussing with Francesco, I rated: (define-key ido-file-completion-map "\Co" 'ido-fallback-command) .
Now when I press Ch k Co , I see this line: Co Fallback to non-ido version of current command .
However, when I press Co again in the minibuffer, I get this error: Debugger entered--Lisp error: (error "Command attempted to use minibuffer while in minibuffer") Cx Cf in the minibuffer still worked as a backup command.
We found out that the Ergoemacs package is associated with this. When I turn off Ergoemacs mode, both Cx Cf and Co commands work as backup commands. I tried to exchange the key cards Ido and Ergoemacs for minor-mode-map-alist using the following code:
(let ((elem (first (remove-if-not '(lambda (item) (equal 'ido-mode (car item))) minor-mode-map-alist)))) (setq minor-mode-map-alist (remove elem minor-mode-map-alist)) (add-to-list 'minor-mode-map-alist elem)) (define-key ido-file-completion-map "\Co" 'ido-fallback-command)'
Does not work.
source share