[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 874632e 098/348: Name bookmarked directories using the boo
From: |
Oleh Krehel |
Subject: |
[elpa] master 874632e 098/348: Name bookmarked directories using the bookmark name |
Date: |
Sat, 8 Apr 2017 11:03:36 -0400 (EDT) |
branch: master
commit 874632ee7a4e97b98dd918f6572f640e6664fdc0
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Name bookmarked directories using the bookmark name
* ivy.el (ivy--virtual-buffers): Update.
Previously, "foo/src" and "bar/src" would be both named "src" when
(eq ivy-virtual-abbreviate 'name).
Now, they're named after their bookmarks, e.g. "source of foo" or "bar
project".
---
ivy.el | 41 ++++++++++++++++++++++++-----------------
1 file changed, 24 insertions(+), 17 deletions(-)
diff --git a/ivy.el b/ivy.el
index c09ed4a..4a02fcd 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2687,25 +2687,32 @@ CANDS is a list of strings."
(recentf-mode 1))
(let ((bookmarks (and (boundp 'bookmark-alist)
bookmark-alist))
- virtual-buffers name)
+ virtual-buffers)
(dolist (head (append
recentf-list
- (delete " - no file -"
- (delq nil (mapcar (lambda (bookmark)
- (cdr (assoc 'filename
bookmark)))
- bookmarks)))))
- (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 "")
- (setq name head))
- (and (not (equal name ""))
- (null (get-file-buffer head))
- (not (assoc name virtual-buffers))
- (push (cons name head) virtual-buffers)))
+ (delq nil (mapcar (lambda (bookmark)
+ (let (file)
+ (when (setq file (assoc 'filename
bookmark))
+ (unless (string= (cdr file) " -
no file -")
+ (cons (car bookmark)
+ (cdr file))))))
+ bookmarks))))
+ (let ((file-name (if (stringp head)
+ head
+ (cdr head)))
+ name)
+ (setq name
+ (if (eq ivy-virtual-abbreviate 'name)
+ (file-name-nondirectory file-name)
+ (expand-file-name file-name)))
+ (when (equal name "")
+ (if (consp head)
+ (setq name (car head))
+ (setq name (file-name-nondirectory (directory-file-name
file-name)))))
+ (and (not (equal name ""))
+ (null (get-file-buffer file-name))
+ (not (assoc name virtual-buffers))
+ (push (cons name file-name) virtual-buffers))))
(when virtual-buffers
(dolist (comp virtual-buffers)
(put-text-property 0 (length (car comp))
- [elpa] master 9118fa1 093/348: Separate readme into distinct ivy/counsel/swiper sections, (continued)
- [elpa] master 9118fa1 093/348: Separate readme into distinct ivy/counsel/swiper sections, Oleh Krehel, 2017/04/08
- [elpa] master 64b385d 107/348: Don't quit counsel-linux-app on bad data, Oleh Krehel, 2017/04/08
- [elpa] master 2be454c 104/348: Remove ivy-height from the example configuration., Oleh Krehel, 2017/04/08
- [elpa] master d83567e 073/348: counsel.el (counsel-locate-options): Remove obsolete var, Oleh Krehel, 2017/04/08
- [elpa] master e89f250 072/348: Add option for swiper line number to be searchable, Oleh Krehel, 2017/04/08
- [elpa] master 06d5cf5 078/348: counsel.el (counsel-rhythmbox): Require dbus, Oleh Krehel, 2017/04/08
- [elpa] master 469a4ab 081/348: Add ivy-push-view and ivy-pop-view, Oleh Krehel, 2017/04/08
- [elpa] master c009b28 080/348: ivy.el: Breaking change for alist type collection actions, Oleh Krehel, 2017/04/08
- [elpa] master 8df5a67 089/348: counsel.el (counsel-semantic): New command, Oleh Krehel, 2017/04/08
- [elpa] master af5d2c1 097/348: Don't crash if default-directory is nil., Oleh Krehel, 2017/04/08
- [elpa] master 874632e 098/348: Name bookmarked directories using the bookmark name,
Oleh Krehel <=
- [elpa] master 9e6bf2d 112/348: Makefile (plain): Fix target, Oleh Krehel, 2017/04/08
- [elpa] master c43de47 120/348: counsel.el (counsel-dired-jump): Fix up, Oleh Krehel, 2017/04/08
- [elpa] master 5fe3cef 122/348: counsel.el (counsel-file-jump): Allow spaces in path, Oleh Krehel, 2017/04/08
- [elpa] master f27a1f0 124/348: swiper.el (swiper-all-function): Add a ">0 cands -> 0 cands" fix, Oleh Krehel, 2017/04/08
- [elpa] master b3ca5e3 119/348: Add counsel commands for jumping to files, Oleh Krehel, 2017/04/08
- [elpa] master 46a5346 121/348: counsel.el (counsel-file-jump): Skip ".git/", Oleh Krehel, 2017/04/08
- [elpa] master 3c20b2c 126/348: counsel.el (counsel-git-grep): Fix prompt, Oleh Krehel, 2017/04/08
- [elpa] master fe92b1b 133/348: ivy.el: Fix the "C-m" not working for last commit, Oleh Krehel, 2017/04/08
- [elpa] master 230ae1a 132/348: Implement unique index for alist completion, Oleh Krehel, 2017/04/08
- [elpa] master 413bf7f 135/348: ivy.el: Prevent region expanding to prompt, Oleh Krehel, 2017/04/08