[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/marginalia cca0d4f 153/241: add marginalia-annotate-boo
From: |
Stefan Monnier |
Subject: |
[elpa] externals/marginalia cca0d4f 153/241: add marginalia-annotate-bookmark |
Date: |
Fri, 28 May 2021 20:49:17 -0400 (EDT) |
branch: externals/marginalia
commit cca0d4f6fa61df2ebe88981830a5175412de76a6
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
add marginalia-annotate-bookmark
---
marginalia.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/marginalia.el b/marginalia.el
index 2c6d7df..fb54037 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -87,6 +87,7 @@ only with the annotations that come with Emacs) without
disabling
(charset . marginalia-annotate-charset)
(package . marginalia-annotate-package)
(imenu . marginalia-annotate-imenu)
+ (bookmark . marginalia-annotate-bookmark)
(virtual-buffer . marginalia-annotate-virtual-buffer-class))
"Lightweight annotator functions.
Associates completion categories with annotation functions.
@@ -126,6 +127,7 @@ determine it."
'(("\\<group\\>" . customize-group)
("\\<M-x\\>" . command)
("\\<package\\>" . package)
+ ("\\<bookmark\\>" . bookmark)
("\\<face\\>" . face)
("\\<environment variable\\>" . environment-variable)
("\\<variable\\>" . variable)
@@ -335,6 +337,7 @@ This hash table is needed to speed up
`marginalia-annotate-binding'.")
(pcase (- (elt cand 0) #x100000)
((or ?b ?h ?p) (marginalia-annotate-buffer (substring cand 1)))
((or ?f ?q) (marginalia-annotate-file (substring cand 1)))
+ (?m (marginalia-annotate-bookmark (substring cand 1)))
(_ (marginalia-annotate-virtual-buffer-class cand))))
(defconst marginalia--advice-regexp
@@ -499,6 +502,14 @@ Similar to `marginalia-annotate-symbol', but does not show
symbol class."
(t (propertize (or (package-desc-status desc) "orphan") 'face
'marginalia-installed))) :width 10)
((package-desc-summary desc) :truncate marginalia-truncate-width :face
'marginalia-documentation))))
+(defun marginalia-annotate-bookmark (cand)
+ "Annotate bookmark CAND with its file name and front context string."
+ (let ((front (bookmark-get-front-context-string cand)))
+ (marginalia--fields
+ ((bookmark-get-filename cand) :width 40 :face 'marginalia-file-name)
+ ((if (or (not front) (string= front "")) "" (concat front "…"))
+ :width 20 :face 'marginalia-documentation))))
+
(defun marginalia-annotate-customize-group (cand)
"Annotate customization group CAND with its documentation string."
(marginalia--documentation (documentation-property (intern cand)
'group-documentation)))
- [elpa] externals/marginalia e41d939 206/241: Revert "Go back and use full minibuffer-contents for marginalia--full-file", (continued)
- [elpa] externals/marginalia e41d939 206/241: Revert "Go back and use full minibuffer-contents for marginalia--full-file", Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 95c0bb3 205/241: Go back and use full minibuffer-contents for marginalia--full-file, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 0c2735e 214/241: Selectrum advice is unnecessary - post-command-hook performs the update, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 1a100ba 216/241: Add mail address to header, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 470e278 231/241: Restore obsolete variables, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia b6ca937 115/241: shorter mode name, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia cca8f9c 116/241: readme typo, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia d37e9a5 129/241: fix #33, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia c76b9d8 132/241: partially rewrite buffer annotator using format-mode-line, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 6da7980 139/241: fix #39, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia cca0d4f 153/241: add marginalia-annotate-bookmark,
Stefan Monnier <=
- [elpa] externals/marginalia 4a727cd 158/241: fix #46: affixation suffix must not be nil, it must be a string, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 218881e 172/241: Replace consult-buffer annotator with consult-multi annotator, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 436cd05 175/241: consult--multi preserves the original candidate, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 548bf39 012/241: more explicit name for marginalia-command-annotate, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia bcb6bbb 022/241: Correct slight imprecision in docstring, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 642e25d 057/241: replace marginalia-separator-width by marginalia-separator, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia cb64b10 135/241: add comment, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia aa41183 156/241: treat bookmarks as normal alists, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 62ed158 183/241: Version 0.3, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia d2b43ed 189/241: Use project-roots (project-root is Emacs 28), Stefan Monnier, 2021/05/28