Stackoverflow! In the past few days, I have been trying to tweak my emacs a bit, and I have run into a problem that I don’t know how to approach.
What I'm trying to do is define a global key binding and ido-mode binding that will use the same keys to perform different actions.
The key binding ido mode is defined as follows:
(defun ido-my-keys ()
"Add my keybindings for ido."
(define-key ido-completion-map (kbd "M-<return>")
'ido-invoke-in-vertical-split)
)
(add-hook 'ido-setup-hook 'ido-my-keys)
And it works fine until I put the following line in my .emacs file:
(global-set-key (kbd "M-<return>") 'insert-newline-and-indent)
On this line, M-return calls insert-newline-and-indent even from ido-switch-buffer. Interestingly, when I use the global key set in interactive mode (i.e. Not from the init file, but from the Mx call), everything works as expected.
Thank you for your help. Sorry for my English.
, . , .
, ergoemacs. , .