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

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

[elpa] externals/marginalia 6da7980 139/241: fix #39


From: Stefan Monnier
Subject: [elpa] externals/marginalia 6da7980 139/241: fix #39
Date: Fri, 28 May 2021 20:49:14 -0400 (EDT)

branch: externals/marginalia
commit 6da7980bd5e6f30c9569d1d15d2f385072329798
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    fix #39
---
 marginalia.el | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index d64cc3d..ef21f7d 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -27,8 +27,6 @@
 
 ;; Enrich existing commands with completion annotations
 
-;; Merry Christmas!
-
 ;;; Code:
 
 (require 'subr-x)
@@ -325,6 +323,8 @@ This hash table is needed to speed up 
`marginalia-annotate-binding'.")
    ((pcase (- (elt cand 0) #x100000)
       (?b "Buffer")
       (?f "File")
+      (?p "Project Buffer")
+      (?q "Project File")
       (?m "Bookmark")
       (?v "View"))
     :width -8 :face 'marginalia-documentation)))
@@ -524,8 +524,18 @@ Similar to `marginalia-annotate-symbol', but does not show 
symbol class."
                           marginalia--separator
                           (16 (:propertize mode-name face marginalia-mode)))
                         nil nil buffer))
-     ((when-let (file (buffer-file-name buffer))
-        (abbreviate-file-name file))
+     ((cond
+       ;; see ibuffer-buffer-file-name
+       ((when-let (file (buffer-file-name buffer))
+          (abbreviate-file-name file)))
+       ((when-let (proc (get-buffer-process buffer))
+          (format "(%s %s)" proc (process-status proc))))
+       ((local-variable-p 'list-buffers-directory buffer)
+        (buffer-local-value 'list-buffers-directory buffer))
+       ((when-let (dir (and (local-variable-p 'dired-directory buffer)
+                            (buffer-local-value 'dired-directory buffer)))
+         (expand-file-name (if (stringp dir) dir (car dir))
+                            (buffer-local-value 'default-directory buffer)))))
       :truncate (/ marginalia-truncate-width 2)
       :face 'marginalia-file-name))))
 



reply via email to

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