1

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?

2 Answers 2

1

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.

11
  • 1
    Nope, doesn't work.
    – abo-abo
    Oct 31, 2014 at 15:18
  • check buffer-local values of eldoc-mode.
    – sds
    Oct 31, 2014 at 15:23
  • Setting eldoc-idle-delay works, but how would I disable eldoc-mode for minibuffer? I tried minibuffer-setup-hook, it didn't work.
    – abo-abo
    Oct 31, 2014 at 15:34
  • 2
    It should be (global-eldoc-mode -1): nil for minor modes used to mean "toggle" but nowadays it means "enable".
    – Stefan
    Oct 31, 2014 at 17:25
  • 1
    Because "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 any turn-on-foo-mode any more.
    – Stefan
    Oct 31, 2014 at 17:32
4

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.

1
  • 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, 2014 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.