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

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

[elpa] master b06daca 040/167: ivy.el (ivy-virtual-abbreviate): New defc


From: Oleh Krehel
Subject: [elpa] master b06daca 040/167: ivy.el (ivy-virtual-abbreviate): New defcustom
Date: Tue, 08 Dec 2015 10:49:46 +0000

branch: master
commit b06daca74bd7b09116b9d4f3bd9a93b2c11a5272
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy-virtual-abbreviate): New defcustom
    
    * ivy.el (ivy--virtual-buffers): Update.
    
    Fixes #255
---
 ivy.el |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/ivy.el b/ivy.el
index 7228acb..02b6c73 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1786,6 +1786,14 @@ CANDS is a list of strings."
 (defface ivy-virtual '((t :inherit font-lock-builtin-face))
   "Face used by Ivy for matching virtual buffer names.")
 
+(defcustom ivy-virtual-abbreviate 'name
+  "The mode of abbreviation for virtual buffer names."
+  :type '(choice
+          (const :tag "Only name" 'name)
+          (const :tag "Full path" 'full)
+          ;; eventually, uniquify
+          ))
+
 (defun ivy--virtual-buffers ()
   "Adapted from `ido-add-virtual-buffers-to-list'."
   (unless recentf-mode
@@ -1799,7 +1807,10 @@ CANDS is a list of strings."
                            (delq nil (mapcar (lambda (bookmark)
                                                (cdr (assoc 'filename 
bookmark)))
                                              bookmarks)))))
-      (setq name (file-name-nondirectory head))
+      (setq name
+            (if (eq ivy-virtual-abbreviate 'name)
+                (file-name-nondirectory head)
+              (expand-file-name head)))
       (when (equal name "")
         (setq name (file-name-nondirectory (directory-file-name head))))
       (when (equal name "")



reply via email to

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