[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/marginalia a0e9903 237/241: Remove marginalia--annotate
From: |
Stefan Monnier |
Subject: |
[elpa] externals/marginalia a0e9903 237/241: Remove marginalia--annotate-binding-hash (See #16) |
Date: |
Fri, 28 May 2021 20:49:34 -0400 (EDT) |
branch: externals/marginalia
commit a0e9903bdb63d70a59653f73f77082f20a669b2c
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Remove marginalia--annotate-binding-hash (See #16)
I cannot reproduce the allocation problem anymore with Vertico or Selectrum.
Maybe this was due to executing the annotators in a temporary buffer in
Selectrum back then, which lead to flushes of the where-is-internal cache?
---
marginalia.el | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/marginalia.el b/marginalia.el
index f052a0d..ffa7155 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -313,24 +313,11 @@ WIDTH is the format width. This can be specified as
alternative to FORMAT."
(marginalia--fields
(str :truncate marginalia-truncate-width :face
'marginalia-documentation))))
-(defvar-local marginalia--annotate-binding-hash nil
- "Hash table storing the keybinding of every command.
-This hash table is needed to speed up `marginalia-annotate-binding'.")
-
(defun marginalia-annotate-binding (cand)
"Annotate command CAND with keybinding."
- ;; Precomputing the keybinding of every command is faster than looking it up
every time using
- ;; `where-is-internal'. `where-is-internal' generates a lot of garbage,
leading to garbage
- ;; collecting pauses when interacting with the minibuffer. See
- ;; https://github.com/minad/marginalia/issues/16.
- (unless marginalia--annotate-binding-hash
- (setq marginalia--annotate-binding-hash (make-hash-table :size 1025))
- (mapatoms (lambda (sym)
- (when-let (key (and (commandp sym) (where-is-internal sym nil
t)))
- (puthash sym key marginalia--annotate-binding-hash)))))
(when-let* ((sym (intern-soft cand))
- (binding (gethash sym marginalia--annotate-binding-hash)))
- (propertize (format " (%s)" (key-description binding)) 'face
'marginalia-key)))
+ (key (and (commandp sym) (where-is-internal sym nil
'first-only))))
+ (propertize (format " (%s)" (key-description key)) 'face 'marginalia-key)))
(defun marginalia--annotator (cat)
"Return annotation function for category CAT."
- [elpa] externals/marginalia 12fe439 161/241: right-fringe-width - use eq instead of =, (continued)
- [elpa] externals/marginalia 12fe439 161/241: right-fringe-width - use eq instead of =, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 327ad58 165/241: use aref instead of elt, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 5d15697 169/241: marginalia-annotate-bookmark with no front context still returns filename, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 64fe724 182/241: readme: do not use drawers to prevent export, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 2387cba 186/241: marginalia-annotate-minor-mode: Support longer lighters, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 5159256 220/241: Fix external declaration for selectrum--get-full, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia a081005 215/241: marginalia-annotate-bookmark: Truncate file names (Fix #69), Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia f89974d 222/241: Remove obsolete comment, completion system updates automatically, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 3669f4d 224/241: Stop using the obsolete project-roots function, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 445d283 234/241: README: Update helper commands (Use remq instead of delq), Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia a0e9903 237/241: Remove marginalia--annotate-binding-hash (See #16),
Stefan Monnier <=
- [elpa] externals/marginalia bc8e5f2 178/241: customize group: more restrictive prompt classifier, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 6caf9f0 202/241: Add link to readme (Fix #66), Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 5ce5a0e 200/241: marginalia-annotate-color: Add component letters, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 668265a 211/241: Simplify setup, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 9ca180b 026/241: richer formatting of file and buffer annotations, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 2805127 058/241: introduce a small dsl marginalia--fields which helps with formatting, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 31ba78b 072/241: add marginalia-annotate-coding-system, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 783cb49 067/241: improve marginalia-minor-mode, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 659a550 081/241: show annotations even if no documentation is present, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 56ad689 094/241: modify marginalia-annotate-imenu regexp such that it works with consult narrowing, Stefan Monnier, 2021/05/28