(eldoc-mode 1)))
\f
+(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.
(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))
\f
;;; JIT lock mode
+(defun jit-lock-context--update ()
+ (unless jit-lock--antiblink-grace-timer
+ (jit-lock-context-fontify)))
+
(defun jit-lock-mode (arg)
"Toggle Just-in-time Lock mode.
Turn Just-in-time Lock mode on if and only if ARG is non-nil.
(when (eq jit-lock-contextually t)
(unless jit-lock-context-timer
(setq jit-lock-context-timer
- (run-with-idle-timer jit-lock-context-time t
- (lambda ()
- (unless jit-lock--antiblink-grace-timer
- (jit-lock-context-fontify))))))
+ (run-with-idle-timer jit-lock-context-time t #'jit-lock-context--update)))
(add-hook 'post-command-hook #'jit-lock--antiblink-post-command nil t)
(setq jit-lock-context-unfontify-pos
(or jit-lock-context-unfontify-pos (point-max))))
;; buffer, only jit-lock-context-* will re-fontify it.
(min jit-lock-context-unfontify-pos jit-lock-start))))))
+(defun jit-lock--antiblink-update ()
+ (jit-lock-context-fontify)
+ (setq jit-lock--antiblink-grace-timer nil))
+
(defun jit-lock--antiblink-post-command ()
(let* ((new-l-b-p (copy-marker (syntax--lbp)))
(l-b-p-2 (syntax--lbp 2))
(and same-line
(null jit-lock--antiblink-string-or-comment) new-s-o-c)
(setq jit-lock--antiblink-grace-timer
- (run-with-idle-timer jit-lock-antiblink-grace nil
- (lambda ()
- (jit-lock-context-fontify)
- (setq jit-lock--antiblink-grace-timer
- nil)))))
+ (run-with-idle-timer jit-lock-antiblink-grace nil #'jit-lock--antiblink-update)))
(;; Closed an unterminated multiline string.
(and same-line
(null new-s-o-c) jit-lock--antiblink-string-or-comment)