[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1a4ebda 048/184: Allow virtual-buffers customization
From: |
Oleh Krehel |
Subject: |
[elpa] master 1a4ebda 048/184: Allow virtual-buffers customization |
Date: |
Wed, 16 Oct 2019 13:14:46 -0400 (EDT) |
branch: master
commit 1a4ebdaff8cf67faa69f412e6fa9ed2743c6bc92
Author: gusbrs <address@hidden>
Commit: Oleh Krehel <address@hidden>
Allow virtual-buffers customization
Allow to choose between recent files, bookmarks or both to compose
ivy-switch-buffer's virtual-buffers.
Fixes #2169
Fixes #2172
---
ivy.el | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/ivy.el b/ivy.el
index 3427cdb..396d145 100644
--- a/ivy.el
+++ b/ivy.el
@@ -222,8 +222,15 @@ Only \"./\" and \"../\" apply here. They appear in
reverse order."
(const :tag "Current Directory" "./"))))
(defcustom ivy-use-virtual-buffers nil
- "When non-nil, add recent files and bookmarks to `ivy-switch-buffer'."
- :type 'boolean)
+ "When non-nil, add recent files and/or bookmarks to `ivy-switch-buffer'.
+The value `recentf' includes only recent files to the virtual
+buffers list, whereas the value `bookmarks' does the same for
+bookmarks. Any other non-nil value includes both."
+ :type '(choice
+ (const :tag "Don't use virtual buffers" nil)
+ (const :tag "Recent files" recentf)
+ (const :tag "Bookmarks" bookmarks)
+ (const :tag "All virtual buffers" t)))
(defvar ivy-display-function nil
"Determine where to display candidates.
@@ -3826,12 +3833,19 @@ CANDS is a list of strings."
(require 'bookmark)
(unless recentf-mode
(recentf-mode 1))
- (let (virtual-buffers)
- (bookmark-maybe-load-default-file)
- (dolist (head (append recentf-list
- (delete " - no file -"
- (delq nil (mapcar #'bookmark-get-filename
- bookmark-alist)))))
+ (bookmark-maybe-load-default-file)
+ (let* ((vb-bkm (delete " - no file -"
+ (delq nil (mapcar #'bookmark-get-filename
+ bookmark-alist))))
+ (vb-list (cond ((eq ivy-use-virtual-buffers 'recentf)
+ recentf-list)
+ ((eq ivy-use-virtual-buffers 'bookmarks)
+ vb-bkm)
+ (ivy-use-virtual-buffers
+ (append recentf-list vb-bkm))
+ (t nil)))
+ virtual-buffers)
+ (dolist (head vb-list)
(let* ((file-name (if (stringp head)
head
(cdr head)))
- [elpa] master c7ffd06 016/184: swiper.el (swiper-isearch-action): Make ivy-previous-line-or-history work, (continued)
- [elpa] master c7ffd06 016/184: swiper.el (swiper-isearch-action): Make ivy-previous-line-or-history work, Oleh Krehel, 2019/10/16
- [elpa] master b4c4a7f 011/184: swiper.el (swiper--isearch-next-item): Extract, Oleh Krehel, 2019/10/16
- [elpa] master b9f3e3b 017/184: swiper.el (swiper-isearch-action): Simplify, Oleh Krehel, 2019/10/16
- [elpa] master 38b5d83 015/184: swiper.el (swiper--isearch-filter-ignore-order): Extract, Oleh Krehel, 2019/10/16
- [elpa] master 5f99723 019/184: counsel.el (counsel--async-last-command): Add for ease of debugging, Oleh Krehel, 2019/10/16
- [elpa] master fb486d8 024/184: ivy.el (ivy-immediate-done): Add copy-sequence to fix read-directory-name, Oleh Krehel, 2019/10/16
- [elpa] master f71f89a 029/184: ivy-test.el (ivy-swiper-wgrep): Expect fail on <=24.3, Oleh Krehel, 2019/10/16
- [elpa] master 230137b 047/184: ivy.el (ivy-restrict-to-matches): Work for dynamic collection, Oleh Krehel, 2019/10/16
- [elpa] master c3bd60c 041/184: ivy.el (ivy--occur-press-update-window): Don't error if buffer was killed, Oleh Krehel, 2019/10/16
- [elpa] master 6bf2cba 053/184: ivy.el (ivy-read-action-ivy): Don't recur, Oleh Krehel, 2019/10/16
- [elpa] master 1a4ebda 048/184: Allow virtual-buffers customization,
Oleh Krehel <=
- [elpa] master b4af1a6 040/184: swiper.el (swiper-recenter-top-bottom): Works for swiper-isearch, Oleh Krehel, 2019/10/16
- [elpa] master 327dbd6 058/184: counsel.el (counsel-rg-base-command): Don't include directory on non-Windows, Oleh Krehel, 2019/10/16
- [elpa] master 5140127 046/184: ivy.el: Run ispell-comments-and-strings, Oleh Krehel, 2019/10/16
- [elpa] master 2ecbd7d 054/184: ivy.el (ivy-read-action-ivy): Show the selected item in the prompt, Oleh Krehel, 2019/10/16
- [elpa] master ae70443 060/184: counsel.el (counsel-major): Add, Oleh Krehel, 2019/10/16
- [elpa] master f66eec5 059/184: Add counsel-buffer-or-recentf, Oleh Krehel, 2019/10/16
- [elpa] master 1303e10 061/184: counsel.el (counsel-M-x-action): Extract, Oleh Krehel, 2019/10/16
- [elpa] master ca5040d 078/184: counsel.el (counsel-rg-base-command): Remove "-S" flag, Oleh Krehel, 2019/10/16
- [elpa] master 20d604c 069/184: ivy.el (ivy-restrict-to-matches): Fix for ivy-resume, Oleh Krehel, 2019/10/16
- [elpa] master c307ae9 055/184: swiper.el (swiper--re-builder): Fix symbol bounds with char-fold-to-regexp, Oleh Krehel, 2019/10/16