summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/which-func.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index 4ffcddf48bf..fef159d850f 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -198,7 +198,8 @@ and off otherwise."
(or (eq which-func-modes t)
(member major-mode which-func-modes))))))
;; Turn it off
- (cancel-timer which-func-update-timer)
+ (when (timerp which-func-update-timer)
+ (cancel-timer which-func-update-timer))
(setq which-func-update-timer nil)
(dolist (buf (buffer-list))
(with-current-buffer buf (setq which-func-mode nil)))))