[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/marginalia 624028c 235/241: Silence bytecode compiler w
From: |
Stefan Monnier |
Subject: |
[elpa] externals/marginalia 624028c 235/241: Silence bytecode compiler warning regarding project-roots (Fix #79) |
Date: |
Fri, 28 May 2021 20:49:34 -0400 (EDT) |
branch: externals/marginalia
commit 624028c69b55deb3387452b9eeabe9cb963bd2a4
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Silence bytecode compiler warning regarding project-roots (Fix #79)
---
marginalia.el | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/marginalia.el b/marginalia.el
index e4691c2..dfe5ac5 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -239,7 +239,6 @@ determine it."
(declare-function package-desc-version "package")
(declare-function package-version-join "package")
(declare-function project-current "project")
-(declare-function project-roots "project")
(declare-function color-rgb-to-hex "color")
(declare-function color-rgb-to-hsl "color")
@@ -672,15 +671,21 @@ These annotations are skipped for remote paths."
"%b %d %H:%M"
(file-attribute-modification-time attributes)) :face
'marginalia-date)))))
+(defmacro marginalia--project-root ()
+ "Return project root."
+ (require 'project)
+ `(when-let (proj (project-current))
+ ,(if (fboundp 'project-root)
+ '(project-root proj)
+ '(car (project-roots proj)))))
+
(defun marginalia-annotate-project-file (cand)
"Annotate file CAND with its size, modification time and other attributes."
;; TODO project-find-file can be called from outside all projects in
;; which case it prompts for a project first; we don't support that
;; case yet, since there is no current project.
- (when-let ((project (project-current))
- (root (car (project-roots project)))
- (file (expand-file-name cand root)))
- (marginalia-annotate-file file)))
+ (when-let (root (marginalia--project-root))
+ (marginalia-annotate-file (expand-file-name cand root))))
(defun marginalia-classify-by-command-name ()
"Lookup category for current command."
- [elpa] externals/marginalia f263745 201/241: marginalia-annotate-color: Use readable-foreground-color, (continued)
- [elpa] externals/marginalia f263745 201/241: marginalia-annotate-color: Use readable-foreground-color, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia b6994e0 203/241: Attempt to fix full candidate function for files (#65), Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia f3eaa1a 197/241: Add annotator for the embark-keybinding category, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 9559819 209/241: Add link to upstream bug, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia c476b6c 212/241: Track completion base position for marginalia--full-candidate, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 1120eff 210/241: Revert b6994e0ebca6488f379914a1506af833a1abd928 and 06ae3b4c466801962b7611c851e62bf0c749fbbf, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia dca1cb5 213/241: marginalia--base-position: Minor changes, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 1d3af0a 219/241: Merge branch 'base-position' into main, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 7fe1a03 218/241: Fix retrieving full paths under Selectrum, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia cd28764 232/241: marginalia-annotator-registry: Use more precise type, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 624028c 235/241: Silence bytecode compiler warning regarding project-roots (Fix #79),
Stefan Monnier <=
- [elpa] externals/marginalia ac4ab98 227/241: Implement individual cycling per completion category (Fix #73), Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 3f33b38 238/241: Prepare submission to ELPA, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia e97979a 240/241: Remove License header, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 09aaad9 159/241: Revert "fix #46: affixation suffix must not be nil, it must be a string", Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 42977b4 162/241: add comment, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 65da400 055/241: marginalia-annotate-package: show package version, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 501a3b3 056/241: simplify marginalia--align, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 4ffd1a9 071/241: add marginalia-annotate-input-method, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia 75e9e9b 070/241: add marginalia-annotate-charset, Stefan Monnier, 2021/05/28
- [elpa] externals/marginalia c940a49 236/241: Use more restricted regexp to detect remote completion, Stefan Monnier, 2021/05/28