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

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

[elpa] master 5f7c787 11/90: counsel.el (counsel-find-file-at-point): Ne


From: Oleh Krehel
Subject: [elpa] master 5f7c787 11/90: counsel.el (counsel-find-file-at-point): New defcustom
Date: Tue, 30 Jun 2015 07:28:03 +0000

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

    counsel.el (counsel-find-file-at-point): New defcustom
    
    * counsel.el (counsel-find-file): When `counsel-find-file-at-point' is
      non-nil, add the file at point to the list of candidates.
    
    Fixes #123
---
 counsel.el |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/counsel.el b/counsel.el
index aae7c72..f27095e 100644
--- a/counsel.el
+++ b/counsel.el
@@ -259,6 +259,10 @@
               :action #'counsel-git-grep-action
               :unwind #'swiper--cleanup)))
 
+(defcustom counsel-find-file-at-point nil
+  "When non-nil, add file-at-point to the list of candidates."
+  :type 'boolean)
+
 (defun counsel-find-file ()
   "Forward to `find-file'."
   (interactive)
@@ -266,7 +270,10 @@
             :matcher #'counsel--find-file-matcher
             :action
             (lambda (x)
-              (find-file (expand-file-name x ivy--directory)))))
+              (find-file (expand-file-name x ivy--directory)))
+            :preselect (when counsel-find-file-at-point
+                         (require 'ffap)
+                         (ffap-guesser))))
 
 (defcustom counsel-find-file-ignore-regexp "\\(?:\\`[#.]\\)\\|\\(?:[#~]\\'\\)"
   "A regexp of files to ignore while in `counsel-find-file'.



reply via email to

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