[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f9f2c8c 251/348: counsel.el (counsel-bookmark-avoid-dired)
From: |
Oleh Krehel |
Subject: |
[elpa] master f9f2c8c 251/348: counsel.el (counsel-bookmark-avoid-dired): Add |
Date: |
Sat, 8 Apr 2017 11:04:07 -0400 (EDT) |
branch: master
commit f9f2c8c42d677682cbc37333a0d4991a89c50049
Author: Justin Burkett <address@hidden>
Commit: Justin Burkett <address@hidden>
counsel.el (counsel-bookmark-avoid-dired): Add
When non-nil and a directory is selected from counsel-bookmark, forward the
choice to counsel-find-file instead of opening a dired buffer.
Fixes #813
---
counsel.el | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/counsel.el b/counsel.el
index 09570e7..2f32162 100644
--- a/counsel.el
+++ b/counsel.el
@@ -616,6 +616,13 @@ input corresponding to the chosen variable."
(declare-function bookmark-all-names "bookmark")
+(defcustom counsel-bookmark-avoid-dired nil
+ "If non-nil, choosing a directory in `counsel-bookmark'
+forwards the choice to `counsel-find-file' instead of opening a
+dired buffer."
+ :type 'boolean
+ :group 'ivy)
+
;;;###autoload
(defun counsel-bookmark ()
"Forward to `bookmark-jump' or `bookmark-set' if bookmark doesn't exist."
@@ -624,10 +631,17 @@ input corresponding to the chosen variable."
(ivy-read "Create or jump to bookmark: "
(bookmark-all-names)
:action (lambda (x)
- (if (member x (bookmark-all-names))
- (with-ivy-window
- (bookmark-jump x))
- (bookmark-set x)))
+ (cond ((and counsel-bookmark-avoid-dired
+ (member x (bookmark-all-names))
+ (file-directory-p (bookmark-location x)))
+ (with-ivy-window
+ (let ((default-directory (bookmark-location x)))
+ (counsel-find-file))))
+ ((member x (bookmark-all-names))
+ (with-ivy-window
+ (bookmark-jump x)))
+ (t
+ (bookmark-set x))))
:caller 'counsel-bookmark))
(ivy-set-actions
- [elpa] master 3e651a3 116/348: Make swiper-all use point positions instead of line positions, (continued)
- [elpa] master 3e651a3 116/348: Make swiper-all use point positions instead of line positions, Oleh Krehel, 2017/04/08
- [elpa] master ef3f010 128/348: ivy.el (ivy--insert-prompt): Improve the extra "\n" logic, Oleh Krehel, 2017/04/08
- [elpa] master 870112e 176/348: counsel.el (counsel-ag-function): Use sync on remote, Oleh Krehel, 2017/04/08
- [elpa] master 1914ecd 203/348: counsel.el (counsel-recoll-function): Add shell-quote-argument, Oleh Krehel, 2017/04/08
- [elpa] master f0e49d5 213/348: Improve recursive minibuffers with two emacsclients, Oleh Krehel, 2017/04/08
- [elpa] master df9ad89 220/348: counsel.el (counsel-rpm): New command, Oleh Krehel, 2017/04/08
- [elpa] master aea4919 225/348: Shrink ivy back to ivy-height after dispatching actions., Oleh Krehel, 2017/04/08
- [elpa] master 88bf299 228/348: counsel.el (counsel-recentf): Remove properties from recentf-list, Oleh Krehel, 2017/04/08
- [elpa] master 576a1e3 232/348: Revert "ivy.el (ivy-call): setq default-directory instead of let", Oleh Krehel, 2017/04/08
- [elpa] master 50bb6b3 250/348: ivy.el (ivy-call): Call the action in ivy-state-buffer, Oleh Krehel, 2017/04/08
- [elpa] master f9f2c8c 251/348: counsel.el (counsel-bookmark-avoid-dired): Add,
Oleh Krehel <=
- [elpa] master 123f9e1 258/348: swiper-all should consider magit stash buffers too, Oleh Krehel, 2017/04/08
- [elpa] master 4dd650c 257/348: Make counsel-ag prompt for extra args when using prefix arg., Oleh Krehel, 2017/04/08
- [elpa] master a77a265 263/348: Set `outline-regexp' directory local, Oleh Krehel, 2017/04/08
- [elpa] master 109170b 264/348: Remap `backward-delete-char-untabify' to `ivy-backward-delete-char', Oleh Krehel, 2017/04/08
- [elpa] master 039c58a 254/348: counsel.el: added three new counsel commands., Oleh Krehel, 2017/04/08
- [elpa] master 5b66c18 267/348: Update copyright year, Oleh Krehel, 2017/04/08
- [elpa] master 1870f41 272/348: counsel.el: Fix counsel-command-history, Oleh Krehel, 2017/04/08
- [elpa] master c2b0d30 284/348: Add missing parameter for ag, Oleh Krehel, 2017/04/08
- [elpa] master 58372db 281/348: Add command `counsel-mark-ring', Oleh Krehel, 2017/04/08
- [elpa] master 5f732cd 297/348: Add compatibility with evil-ex-search., Oleh Krehel, 2017/04/08