Use call-with-current-project when opening unstaged files/directories in legit status#1442
Conversation
extensions/legit/peek-legit.lisp
Outdated
| file))))) | ||
| (switch-to-buffer buffer) | ||
| (editor-error "File ~a doesn't exist." file)))) | ||
| (uiop:symbol-call :lem/legit :call-with-current-project |
There was a problem hiding this comment.
Can you not use with-current-project inside this command?
There was a problem hiding this comment.
symbol-call doesn't work with macros, and peek-legit is defined before legit so I can't import it directly. Is there another way?
There was a problem hiding this comment.
so, mmh, we can surely move the macro definition in peek-legit or in a common file. I'm annoyed to see call-with-current-project being exported and this lambda.
you ok to give it a try?
There was a problem hiding this comment.
Sure, I just used symbol-call cause I saw it being used elsewhere in peek-legit, I'll try to find somewhere to move it
There was a problem hiding this comment.
let's say: if this is non trivial, if doing this pulls too many strings, we can do it later. If you find a quick solution, great.
I look at these symbol-call and I wonder if we really need this separation of packages.
There was a problem hiding this comment.
Works fine in porcelain, also kinda makes sense for it to be there. Do you prefer if I replace the calls with lem/porcelain:with-current-project or should I just use import-from?
Edit: went ahead and moved it with the explicit call.
There was a problem hiding this comment.
The use of symbol-call seems to me to be a sign of poor design.
It is also vulnerable to refactoring, which increases the possibility that changes on the lem side will break the legit.
There was a problem hiding this comment.
@cxxxr ye we're moving away from it, don't worry
Opening files/directories in legit status can sometimes yield an error if you don't have a buffer in the current project open. This changes it so we run
call-with-current-projectbefore so we have the right context.