[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 0e78bd5b0c 5/6: Provide affix fn for library category
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 0e78bd5b0c 5/6: Provide affix fn for library category |
Date: |
Wed, 13 Sep 2023 15:59:52 -0400 (EDT) |
branch: elpa/helm
commit 0e78bd5b0c20a8834f1a334d4610fab8a7961dfe
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Provide affix fn for library category
---
helm-mode.el | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/helm-mode.el b/helm-mode.el
index 5ee84a36ed..0f72d38b48 100644
--- a/helm-mode.el
+++ b/helm-mode.el
@@ -1013,7 +1013,10 @@ that use `helm-comp-read'. See `helm-M-x' for example."
(category . coding-system)))
(color . (metadata
(affixation-function . helm-completion-color-affixation)
- (category . color))))
+ (category . color)))
+ (library . (metadata
+ (affixation-function . helm-completion-library-affixation)
+ (category . library))))
"Extra metadata for completing-read.
Alist composed of (CATEGORY . METADATA).
@@ -1270,6 +1273,23 @@ is used."
(helm-aand (propertize rgb 'face `(:background ,rgb
:distant-foreground "black"))
(propertize " " 'display (concat sep it)))))))
+
+(defun helm-completion-library-affixation (_comps)
+ (lambda (comp)
+ (let* ((sep (make-string (1+ (- (helm-in-buffer-get-longest-candidate)
+ (length comp)))
+ ? ))
+ (path (or (assoc-default comp helm-locate-library-cache)
+ (let ((p (find-library-name comp)))
+ (push (cons comp p) helm-locate-library-cache)
+ p)))
+ (doc (or (gethash comp helm-locate-library-doc-cache)
+ (puthash comp (helm-locate-lib-get-summary path)
+ helm-locate-library-doc-cache))))
+ (list comp
+ ""
+ (helm-aand (propertize doc 'face 'font-lock-warning-face)
+ (propertize " " 'display (concat sep it)))))))
;;; Generic completing read
;;
- [nongnu] elpa/helm updated (0313ad06ae -> 6bf5f5a20f), ELPA Syncer, 2023/09/13
- [nongnu] elpa/helm deb525f291 3/6: Improve helm-basename and fix docstring of helm-basedir, ELPA Syncer, 2023/09/13
- [nongnu] elpa/helm 6bf5f5a20f 6/6: Move helm-locate-lib-get-summary to helm-lib, ELPA Syncer, 2023/09/13
- [nongnu] elpa/helm 0e78bd5b0c 5/6: Provide affix fn for library category,
ELPA Syncer <=
- [nongnu] elpa/helm ba518fda86 2/6: Forward line on empty lines in mm-search, otherwise goto eol, ELPA Syncer, 2023/09/13
- [nongnu] elpa/helm 27ff321bf3 1/6: Fix internal variable name prefix in *multi-match, ELPA Syncer, 2023/09/13
- [nongnu] elpa/helm 332f55d601 4/6: Improve helm-locate-library, ELPA Syncer, 2023/09/13