Pregunta

I use abbrev-mode, smex, and ido-mode. How do I turn off abbrev-mode in the minibuffer for when I smex a command?

¿Fue útil?

Solución

This piece of code disables abbrev when you enter the minibuffer, then enables it again when you leave it.

(defun conditionally-disable-abbrev ()
  ""
  (if (string-match "smex-" (format "%s" this-command))
      (abbrev-mode -1)))

(add-hook 'minibuffer-setup-hook 'conditionally-disable-abbrev)
(add-hook 'minibuffer-exit-hook (lambda () (abbrev-mode 1)))

Added the fix by juanleon.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top