From 96181e9229fb91865482a61a549b92336a5c97dd Mon Sep 17 00:00:00 2001 From: bth Date: Thu, 22 Aug 2024 22:21:35 -0700 Subject: [PATCH] embark : need to check if project first --- elisp/um.el | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/elisp/um.el b/elisp/um.el index e1912e4..5481b76 100644 --- a/elisp/um.el +++ b/elisp/um.el @@ -126,16 +126,17 @@ Since journal/ is the origin and other projects shadow it. ;; NOTE: Recurse down into current project directories. ;; project-find-file does it fine, just don't want interactive ;; completing-read call. - (let ((result) (tap (thing-at-point 'filename t))) - ;; TODO: this is procedural thinking and not lisp-like: - (cl-loop for file in - (project-files (project-current)) - do (let ((basename (file-name-nondirectory file))) - (setq result (equal tap basename))) - if result - ;; see `embark-target-finders': - return (cons 'file file) - )) + (when (project-current) + (let ((result) (tap (thing-at-point 'filename t))) + ;; TODO: this is procedural thinking and not lisp-like: + (cl-loop for file in + (project-files (project-current)) + do (let ((basename (file-name-nondirectory file))) + (setq result (equal tap basename))) + if result + ;; see `embark-target-finders': + return (cons 'file file) + ))) ;; all other projects (let ((result))