]> code.delx.au - gnu-emacs/commitdiff
Cancel the eldoc timer when switching off eldoc mode
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 29 Apr 2016 20:06:37 +0000 (22:06 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 29 Apr 2016 20:06:37 +0000 (22:06 +0200)
* 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).

lisp/emacs-lisp/eldoc.el

index d5e7178b2265a1045a924529a5cf468650deac3b..bc5a78bd086a56382c85e6f26e8308911e05e4ab 100644 (file)
@@ -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