[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/marginalia 17fffc6857: marginalia-annotate-theme: Simpl
From: |
ELPA Syncer |
Subject: |
[elpa] externals/marginalia 17fffc6857: marginalia-annotate-theme: Simplify |
Date: |
Sat, 5 Aug 2023 06:58:06 -0400 (EDT) |
branch: externals/marginalia
commit 17fffc685731a1459fb5faa9e376b75ebe225d5c
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
marginalia-annotate-theme: Simplify
---
marginalia.el | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/marginalia.el b/marginalia.el
index df56f419da..e00f6e9a53 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -1033,9 +1033,8 @@ These annotations are skipped for remote paths."
(marginalia-annotate-file (expand-file-name cand root)))))
(defvar-local marginalia--library-cache nil)
-(defun marginalia--library-cache (library-path)
- "Return hash table from library name to library file.
-LIBRARY-PATH is the library search path."
+(defun marginalia--library-cache ()
+ "Return hash table from library name to library file."
(with-current-buffer
(if-let (win (active-minibuffer-window))
(window-buffer win)
@@ -1044,8 +1043,9 @@ LIBRARY-PATH is the library search path."
;; annotator. Therefore we compute all the library paths first.
(unless marginalia--library-cache
(setq marginalia--library-cache (make-hash-table :test #'equal))
- ;; Search in reverse because of shadowing
- (dolist (dir (reverse library-path))
+ (dolist (dir (delete-dups
+ (reverse ;; Reverse because of shadowing
+ (append load-path (custom-theme--load-path))))) ;;
Include themes
(dolist (file (ignore-errors
(directory-files dir 'full
"\\.el\\(?:\\.gz\\)?\\'")))
@@ -1090,15 +1090,12 @@ LIBRARY-PATH is the library search path."
(defun marginalia-annotate-theme (cand)
"Annotate theme CAND with documentation and path."
- (marginalia-annotate-library (concat cand "-theme")
- (custom-theme--load-path)))
+ (marginalia-annotate-library (concat cand "-theme")))
-(defun marginalia-annotate-library (cand &optional library-path)
- "Annotate library CAND with documentation and path.
-LIBRARY-PATH is the library search path."
+(defun marginalia-annotate-library (cand)
+ "Annotate library CAND with documentation and path."
(setq cand (marginalia--library-name cand))
- (when-let (file (gethash cand (marginalia--library-cache
- (or library-path load-path))))
+ (when-let (file (gethash cand (marginalia--library-cache)))
(marginalia--fields
;; Display if the corresponding feature is loaded.
;; feature/=library file, but better than nothing.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/marginalia 17fffc6857: marginalia-annotate-theme: Simplify,
ELPA Syncer <=