]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el: Improve "M-n"
authorOleh Krehel <ohwoeowho@gmail.com>
Mon, 4 Apr 2016 14:58:05 +0000 (16:58 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Mon, 4 Apr 2016 14:58:05 +0000 (16:58 +0200)
Now uses `ffap-file-at-point' only for 'read-file-name-internal.

ivy.el

diff --git a/ivy.el b/ivy.el
index 4f46ae451129f85f048b883ebb5cc083848d7524..86021d61710dfe0ec320065ab366bb6728db0921 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -305,7 +305,8 @@ This should eventually become a stack so that you could use
   "Return a string that corresponds to the current thing at point."
   (or
    (thing-at-point 'url)
-   (ffap-file-at-point)
+   (and (eq (ivy-state-collection ivy-last) 'read-file-name-internal)
+        (ffap-file-at-point))
    (let (s)
      (cond ((stringp (setq s (thing-at-point 'symbol)))
             (if (string-match "\\`[`']?\\(.*?\\)'?\\'" s)