embark : need to check if project first
This commit is contained in:
parent
96af6e8ffe
commit
96181e9229
1 changed files with 11 additions and 10 deletions
21
elisp/um.el
21
elisp/um.el
|
|
@ -126,16 +126,17 @@ Since journal/ is the origin and other projects shadow it.
|
||||||
;; NOTE: Recurse down into current project directories.
|
;; NOTE: Recurse down into current project directories.
|
||||||
;; project-find-file does it fine, just don't want interactive
|
;; project-find-file does it fine, just don't want interactive
|
||||||
;; completing-read call.
|
;; completing-read call.
|
||||||
(let ((result) (tap (thing-at-point 'filename t)))
|
(when (project-current)
|
||||||
;; TODO: this is procedural thinking and not lisp-like:
|
(let ((result) (tap (thing-at-point 'filename t)))
|
||||||
(cl-loop for file in
|
;; TODO: this is procedural thinking and not lisp-like:
|
||||||
(project-files (project-current))
|
(cl-loop for file in
|
||||||
do (let ((basename (file-name-nondirectory file)))
|
(project-files (project-current))
|
||||||
(setq result (equal tap basename)))
|
do (let ((basename (file-name-nondirectory file)))
|
||||||
if result
|
(setq result (equal tap basename)))
|
||||||
;; see `embark-target-finders':
|
if result
|
||||||
return (cons 'file file)
|
;; see `embark-target-finders':
|
||||||
))
|
return (cons 'file file)
|
||||||
|
)))
|
||||||
|
|
||||||
;; all other projects
|
;; all other projects
|
||||||
(let ((result))
|
(let ((result))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue