After a recent update eldoc
is turned on by default, even for emacs -Q
.
I don't appreciate the noise it generates when I'm using eval-expression
.
How do I turn it off?
Disable it globally:
(global-eldoc-mode -1)
Disable it locally - make sure that eldoc-mode
is nil
in all your buffers.
A less drastic solution would be to increase eldoc-idle-delay
.
-
-
-
Setting
eldoc-idle-delay
works, but how would I disableeldoc-mode
for minibuffer? I triedminibuffer-setup-hook
, it didn't work. – abo-abo Oct 31 '14 at 15:34 -
2It should be
(global-eldoc-mode -1)
:nil
for minor modes used to mean "toggle" but nowadays it means "enable". – Stefan Oct 31 '14 at 17:25 -
1Because "toggle" is virtually never the behavior that's needed when called non-interactively. This change fixed latent bugs for all those people who had
(add-hook 'foo-mode-hook 'bar-mode)
in their .emacs. A side-benefit is that we don't need anyturn-on-foo-mode
any more. – Stefan Oct 31 '14 at 17:32
If you want to control the behavior from the minibuffer when using eval-expression
, use eval-expression-minibuffer-setup-hook
.
For example, if you have eldoc on globally and want it off only in this one case, use:
(defun turn-off-eldoc () (eldoc-mode -1))
(add-hook 'eval-expression-minibuffer-setup-hook #'turn-off-eldoc)
This hook is new in Emacs 24.4.
-
The answer from @sds is exactly right if you do not want to use eldoc at all. However from your question it sounds like you are specifically interested in disabling eldoc when using
eval-expression
. Another option of course is to disable eldoc globally and then use hooks to selectively turn in on, e.g.(add-hook 'emacs-lisp-mode-hook #'eldoc-mode)
– glucas Nov 1 '14 at 15:58