1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-27 07:41:28 -08:00

Replace anonymous lambda timers with named functions

* lisp/emacs-lisp/eldoc.el (eldoc--update, eldoc-schedule-timer):
* lisp/jit-lock.el (jit-lock-context--update)
(jit-lock--antiblink-update): New functions broken out from...
* lisp/emacs-lisp/eldoc.el (eldoc-schedule-timer):
* lisp/jit-lock.el (jit-lock-mode, jit-lock--antiblink-post-command):
...here.  Use them as values for timers, to give them readable names
in 'M-x list-timers'.  (Bug#71354)
This commit is contained in:
Matthew Bauer 2025-03-04 02:33:15 +01:00 committed by Stefan Kangas
parent d9218651b6
commit ec517d1dcf
2 changed files with 19 additions and 16 deletions

View file

@ -267,6 +267,14 @@ See `eldoc-documentation-strategy' for more detail."
(eldoc-mode 1)))
(defun eldoc--update ()
(when (or eldoc-mode
(and global-eldoc-mode
(eldoc--supported-p)))
;; Don't ignore, but also don't full-on signal errors
(with-demoted-errors "eldoc error: %s"
(eldoc-print-current-symbol-info)) ))
(defun eldoc-schedule-timer ()
"Ensure `eldoc-timer' is running.
@ -277,13 +285,7 @@ reflect the change."
(setq eldoc-timer
(run-with-idle-timer
eldoc-idle-delay nil
(lambda ()
(when (or eldoc-mode
(and global-eldoc-mode
(eldoc--supported-p)))
;; Don't ignore, but also don't full-on signal errors
(with-demoted-errors "eldoc error: %s"
(eldoc-print-current-symbol-info)) )))))
#'eldoc--update)))
;; If user has changed the idle delay, update the timer.
(cond ((not (= eldoc-idle-delay eldoc-current-idle-delay))