문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top