From db4b3e65bdfb957b90fa81c5c4fcdaca1859e781 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 19 Nov 2014 00:35:26 -0500 Subject: project-filename-at-point: Return nil if no file --- lisp/init-projectile.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/init-projectile.el b/lisp/init-projectile.el index 7e511cb..164ff2a 100644 --- a/lisp/init-projectile.el +++ b/lisp/init-projectile.el @@ -40,8 +40,8 @@ Interactive arguments are processed according to (defun km/project-filename-at-point () "Return file name relative to `projectile-project-root'." - (file-relative-name (thing-at-point 'filename) - (projectile-project-root))) + (--when-let (thing-at-point 'filename) + (file-relative-name it (projectile-project-root)))) (defun km/projectile-copy-project-filename-as-kill () (interactive) -- cgit v1.2.3