emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/marginalia 5f0698b004: Teach marginalia-classify-by-com


From: ELPA Syncer
Subject: [elpa] externals/marginalia 5f0698b004: Teach marginalia-classify-by-command-name about aliases (#156)
Date: Wed, 15 Mar 2023 10:58:06 -0400 (EDT)

branch: externals/marginalia
commit 5f0698b00416022531c235aeb4da88e9c581807e
Author: Tassilo Horn <tsdh@gnu.org>
Commit: GitHub <noreply@github.com>

    Teach marginalia-classify-by-command-name about aliases (#156)
---
 CHANGELOG.org | 5 +++++
 marginalia.el | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.org b/CHANGELOG.org
index ab03d6b136..07d90e5453 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -2,6 +2,11 @@
 #+author: Omar AntolĂ­n Camarena, Daniel Mendler
 #+language: en
 
+* Development
+
+- =marginalia-classify-by-command-name=: Resolve function aliases and use the 
name
+  of the original command to determine the completion category.
+
 * Version 1.1 (2023-02-17)
 
 - Require the =compat= library.
diff --git a/marginalia.el b/marginalia.el
index 1b02e85810..eaedef63d6 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -1113,7 +1113,10 @@ These annotations are skipped for remote paths."
 (defun marginalia-classify-by-command-name ()
   "Lookup category for current command."
   (and marginalia--command
-       (alist-get marginalia--command marginalia-command-categories)))
+       (or (alist-get marginalia--command marginalia-command-categories)
+           ;; The command can be an alias, e.g., `recentf' -> `recentf-open'.
+           (alist-get (car (last (function-alias-p marginalia--command)))
+                      marginalia-command-categories))))
 
 (defun marginalia-classify-original-category ()
   "Return original category reported by completion metadata."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]