diff options
author | Kyle Meyer <kyle@kyleam.com> | 2018-08-22 10:11:48 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2018-08-31 19:47:42 -0400 |
commit | 6474a25cda7585a611172320b84a137e50749cfc (patch) | |
tree | e3f24e156bad5ba6292854875318e3182776a73b | |
parent | d83dd13307d7c17257c0c1b457fa0687dd07e482 (diff) | |
download | emacs.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.el | 3 |
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))) |