From: Lars Ingebrigtsen Date: Fri, 29 Apr 2016 20:06:37 +0000 (+0200) Subject: Cancel the eldoc timer when switching off eldoc mode X-Git-Tag: emacs-26.0.90~2105 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b9d69380a110a86076b4f5b66c7ecdcb790d822d;p=emacs.git Cancel the eldoc timer when switching off eldoc mode * lisp/emacs-lisp/eldoc.el (eldoc-mode): Cancel the eldoc timer when switching off eldoc mode. It will be restarted again if needed (bug#17582). --- diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index d5e7178b226..bc5a78bd086 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -197,7 +197,10 @@ expression point is on." (t (kill-local-variable 'eldoc-message-commands) (remove-hook 'post-command-hook 'eldoc-schedule-timer t) - (remove-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area t)))) + (remove-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area t) + (when eldoc-timer + (cancel-timer eldoc-timer) + (setq eldoc-timer nil))))) ;;;###autoload (define-minor-mode global-eldoc-mode