summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2018-08-22 10:11:48 -0400
committerKyle Meyer <kyle@kyleam.com>2018-08-31 19:47:42 -0400
commit6474a25cda7585a611172320b84a137e50749cfc (patch)
treee3f24e156bad5ba6292854875318e3182776a73b
parentd83dd13307d7c17257c0c1b457fa0687dd07e482 (diff)
downloademacs.d-6474a25cda7585a611172320b84a137e50749cfc.tar.gz
Tighten km/project-filename-at-point check
(thing-at-point 'filename) will return all sorts of text as filenames.
-rw-r--r--lisp/km-projectile.el3
1 files changed, 2 insertions, 1 deletions
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)))