mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
elisp-mode: Cache 'help-echo' function results (bug#80948)
This ensures we only compute the 'help-echo' string once per symbol in a certain position. * lisp/progmodes/elisp-mode.el (elisp--annotate-symbol-with-help-echo): Add caching for when the symbol role's :help property is a function.
This commit is contained in:
parent
288f8d0b05
commit
5789621632
1 changed files with 6 additions and 1 deletions
|
|
@ -575,7 +575,12 @@ This option has effect only if `elisp-fontify-semantically' is non-nil."
|
|||
;; HLP is either a string, or a function that takes SYM as an
|
||||
;; additional argument on top of the usual WINDOW, OBJECT and POS
|
||||
;; that `help-echo' functions takes.
|
||||
(if (stringp hlp) hlp (apply-partially hlp sym)))))
|
||||
(if (stringp hlp) hlp
|
||||
(let ((cache 'unset))
|
||||
(lambda (win obj pos)
|
||||
(if (eq cache 'unset)
|
||||
(setq cache (funcall hlp sym win obj pos))
|
||||
cache)))))))
|
||||
|
||||
(defvar font-lock-beg)
|
||||
(defvar font-lock-end)
|
||||
|
|
|
|||
Loading…
Reference in a new issue