From 6474a25cda7585a611172320b84a137e50749cfc Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 22 Aug 2018 10:11:48 -0400 Subject: Tighten km/project-filename-at-point check (thing-at-point 'filename) will return all sorts of text as filenames. --- lisp/km-projectile.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/km-projectile.el b/lisp/km-projectile.el index 9107af7..f37de22 100644 --- a/lisp/km-projectile.el +++ b/lisp/km-projectile.el @@ -77,7 +77,8 @@ names separated by a space." (org-element-property :path el)) (and (derived-mode-p 'dired-mode) (dired-get-marked-files 'nodir nil)) - (thing-at-point 'filename)))) + (--when-let (thing-at-point 'filename) + (and (file-exists-p it) it))))) (when fname (mapconcat `(lambda (f) (file-relative-name f ,(projectile-project-root))) -- cgit v1.2.3