[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/marginalia 28defd6 014/241: Introduce new name "annotat
From: |
Stefan Monnier |
Subject: |
[elpa] externals/marginalia 28defd6 014/241: Introduce new name "annotator" for annotation functions |
Date: |
Fri, 28 May 2021 20:48:47 -0400 (EDT) |
branch: externals/marginalia
commit 28defd6ecc794abab5c8a43a537da8ec03ab9b47
Author: Omar Antolín <omar.antolin@gmail.com>
Commit: Omar Antolín <omar.antolin@gmail.com>
Introduce new name "annotator" for annotation functions
---
README.md | 2 +-
marginalia.el | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 2342af9..ff58798 100644
--- a/README.md
+++ b/README.md
@@ -29,6 +29,6 @@ specify a completion category themselves.
;; * marginalia-annotate-symbol: Annotate with the documentation string
;; * marginalia-annotate-command-binding (default): Annotate only with the
keybinding
;; * marginalia-annotate-command-full: Annotate with the keybinding and the
documentation string
- ;; (setf (alist-get 'command marginalia-annotate-alist)
#'marginalia-annotate-command-full)
+ ;; (setf (alist-get 'command marginalia-annotator-alist)
#'marginalia-annotate-command-full)
)
~~~
diff --git a/marginalia.el b/marginalia.el
index f7963bb..423ce49 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -58,7 +58,7 @@
:type 'integer
:group 'marginalia)
-(defcustom marginalia-annotate-alist
+(defcustom marginalia-annotator-alist
'((command . marginalia-annotate-command-binding)
(customize-group . marginalia-annotate-customize-group)
(variable . marginalia-annotate-variable)
@@ -203,11 +203,11 @@ Annotations are only shown if `marginalia-mode' is
enabled."
(defun marginalia--annotate-candidates (candidates)
"Annotate CANDIDATES with richer information."
(if-let* ((cat (marginalia--category-type))
- (annotate (alist-get cat marginalia-annotate-alist)))
+ (annotate (alist-get cat marginalia-annotator-alist)))
(mapcar (lambda (cand) (concat cand (funcall annotate cand))) candidates)
candidates))
-(defun marginalia--completion-metadata-get (metadata prop)
+(defun marginalia--completion-metadata-get (_metadata prop)
"Advice for `completion-metadata-get'.
Replaces the category and annotation function.
FUN is the original function.
@@ -217,7 +217,7 @@ PROP is the property which is looked up."
(pcase prop
('annotation-function
(when-let (cat (marginalia--category-type))
- (alist-get cat marginalia-annotate-alist)))
+ (alist-get cat marginalia-annotator-alist)))
('category
(and marginalia--this-command
(alist-get marginalia--this-command
marginalia-command-category-alist)))))
@@ -256,14 +256,14 @@ Remember `this-command' for annotation."
(advice-add #'completion-metadata-get :before-until
#'marginalia--completion-metadata-get)))
;;;###autoload
-(defun marginalia-set-command-annotation (cmd ann)
- "Modify marginalia configuration such that annotation function ANN is used
for command CMD."
+(defun marginalia-set-command-annotator (cmd ann)
+ "Configure marginalia so that annotator ANN is used for command CMD."
(setq marginalia-command-category-alist
(cons (cons cmd cmd)
(assq-delete-all cmd marginalia-command-category-alist)))
(setq marginalia-command-category-alist
(cons (cons cmd ann)
- (assq-delete-all cmd marginalia-annotate-alist))))
+ (assq-delete-all cmd marginalia-annotator-alist))))
(provide 'marginalia)
;;; marginalia.el ends here
- [elpa] externals/marginalia 6077206 008/241: Ignore byte-compiled files, autoloads and *-pkg.el files, (continued)
- [elpa] externals/marginalia 6077206 008/241: Ignore byte-compiled files, autoloads and *-pkg.el files, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 0c090f3 011/241: improve readme, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 80fa320 016/241: Introduce list of classifiers, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia ca21d30 029/241: fix typo in the readme, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 655f03b 035/241: introduce marginalia-annotators-(light|heavy), remove marginalia-set-command-annotator, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 4cb6d2b 039/241: marginalia-annotate-file: add modes, user and group, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia ed74ca9 040/241: add marginalia-toggle-annotators, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 57b1176 051/241: marginalia-annotate-command-binding: only store the binding in the hash table, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 6537c37 015/241: Shorten first line of docstring using our "annotator" term, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 69ec4d7 017/241: Remove unused function, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 28defd6 014/241: Introduce new name "annotator" for annotation functions,
Stefan Monnier <=
- [elpa] externals/marginalia e2af1d3 019/241: Make marginalia-prompt-categories an alist of regexps and categories, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 1c8ef02 020/241: Remove unused marginalia--metadata function, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia c05face 042/241: Improve marginalia-toggle-annotators if invoked from minibuffer, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 59d65af 018/241: Add basic classifiers: orginal category, symbols, by words in prompt, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 0f1e763 025/241: rename some variables for consistency, update readme, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia cd95c65 028/241: buffer annotation: add read-only status, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 675e680 036/241: improve annotator defcustoms, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 8be2daf 046/241: marginalia-annotate-file: remove unnecessary offset which only costs space for no reason, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia c8c3f87 045/241: Rename toggle -> cycle, improve documenation, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 1269445 049/241: marginalia-annotate-command-binding: cache key binding, Stefan Monnier, 2021/05/28