[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master bf7d95f 143/272: Move read-file-name to :display-transform
From: |
Oleh Krehel |
Subject: |
[elpa] master bf7d95f 143/272: Move read-file-name to :display-transformer-fn |
Date: |
Mon, 25 Apr 2016 10:13:22 +0000 |
branch: master
commit bf7d95f7b2b052c5cf8c590e63706ab35f1d2dae
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Move read-file-name to :display-transformer-fn
* ivy.el (ivy-set-display-transformer): Set 'read-file-name-internal to
'ivy-read-file-transformer.
(ivy-read-file-transformer): New defun.
(ivy--format): Simplify.
---
ivy.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/ivy.el b/ivy.el
index d500b8e..9767332 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2387,6 +2387,14 @@ SEPARATOR is used to join the candidates."
(cl-incf i))))))
str))
+(ivy-set-display-transformer
+ 'read-file-name-internal 'ivy-read-file-transformer)
+
+(defun ivy-read-file-transformer (str)
+ (if (string-match-p "/\\'" str)
+ (propertize str 'face 'ivy-subdir)
+ str))
+
(defun ivy--format (cands)
"Return a string for CANDS suitable for display in the minibuffer.
CANDS is a list of strings."
@@ -2402,12 +2410,6 @@ CANDS is a list of strings."
(cands (cl-subseq cands start end))
(index (- ivy--index start))
transformer-fn)
- (cond (ivy--directory
- (setq cands (mapcar (lambda (x)
- (if (string-match-p "/\\'" x)
- (propertize x 'face 'ivy-subdir)
- x))
- cands))))
(setq ivy--current (copy-sequence (nth index cands)))
(when (setq transformer-fn (ivy-state-display-transformer-fn ivy-last))
(with-ivy-window
- [elpa] master 591c8fe 167/272: ivy.el (ivy-expand-file-if-directory): Fix "/ssh:" regression, (continued)
- [elpa] master 591c8fe 167/272: ivy.el (ivy-expand-file-if-directory): Fix "/ssh:" regression, Oleh Krehel, 2016/04/25
- [elpa] master 6817381 068/272: Allow to compose static collections with `counsel--async-command', Oleh Krehel, 2016/04/25
- [elpa] master 212a4b8 098/272: Update the documentation and the manual, Oleh Krehel, 2016/04/25
- [elpa] master b400fcc 108/272: counsel.el: Shuffle functions and rename headings, Oleh Krehel, 2016/04/25
- [elpa] master 63688c6 267/272: Add a couple tests for ivy-read with alists, Oleh Krehel, 2016/04/25
- [elpa] master cf2c7bc 067/272: Modify "M-n" prediction when region is active, Oleh Krehel, 2016/04/25
- [elpa] master b3f4db7 268/272: ivy.el (ivy--format-minibuffer-line): Update, Oleh Krehel, 2016/04/25
- [elpa] master e9e8ec0 112/272: counsel.el: Shuffle functions, Oleh Krehel, 2016/04/25
- [elpa] master d7561d2 203/272: counsel.el: Reduce counsel-grep char req to 2, Oleh Krehel, 2016/04/25
- [elpa] master 94a7b0f 140/272: * ivy.el (ivy-format-function-line): Remove `extra' parameter., Oleh Krehel, 2016/04/25
- [elpa] master bf7d95f 143/272: Move read-file-name to :display-transformer-fn,
Oleh Krehel <=
- [elpa] master 80825a6 082/272: ivy.el: Fixup face docs, Oleh Krehel, 2016/04/25
- [elpa] master 44856a3 219/272: ivy.el (ivy-read): Revert abf880f, Oleh Krehel, 2016/04/25
- [elpa] master 0afb000 077/272: Fix default-directory for ivy-occur + counsel-git-grep, Oleh Krehel, 2016/04/25
- [elpa] master a6cd189 192/272: counsel.el (counsel-linux-apps-list): Skip spaces around =, Oleh Krehel, 2016/04/25
- [elpa] master e8f516e 182/272: counsel.el (counsel-ag): Add transformer, Oleh Krehel, 2016/04/25
- [elpa] master 6a8da39 206/272: counsel.el (counsel-grep-action): Reveal outlines, Oleh Krehel, 2016/04/25
- [elpa] master 2bd092d 222/272: ivy.el (ivy--minibuffer-setup): Ensure inhibit-field-text-motion is nil, Oleh Krehel, 2016/04/25
- [elpa] master 2ac1d2d 256/272: ivy.el (ivy-occur-press): Set counsel-grep-last-line to nil, Oleh Krehel, 2016/04/25
- [elpa] master 4ebf0b4 215/272: ivy.el: Add `counsel-find-file' transformer., Oleh Krehel, 2016/04/25
- [elpa] master 615dd90 241/272: counsel.el (counsel-grep-action): Work better from ivy-occur, Oleh Krehel, 2016/04/25