~technomancy/fennel

2 2

Re: [PATCH fennel-mode] add var to customize location of `fennel`

Details
Message ID
<1D648C17-0B3C-4291-B3B0-F5034BB690E6@gmail.com>
DKIM signature
missing
Download raw message


On August 21, 2023 11:41:21 PM GMT+03:00, Christian Packard <christian@cpacklabs.com> wrote:
>> You can work around this issue by just ensuring that it's available
>> under both names:
>> 
>>    package.loaded.fennel = package.loaded["lib.fennel"]
>
>Sure enough I added this to my `main.lua` and proto-repl works again
>with the default `:fennel` name. Thank you for the example!

I can see this less than an ideal solution, as it means that proto-repl
isn't generic enough. Phil, do you think we can offer fennel-the-module
as a field in the ___repl___ table?  This way, the protocol will not 
be required to require anything.  Given that the REPL requires the
fennel module to work I assume it's OK to reference it in the ___repl___
WDYT?

>>> However, I still don't think that this should be solved this way - an
>>> appropriate fennel-path should be configured when starting the REPL.
>
>I can see the benefits of a standard solution. Armed with the knowledge 
>above I’d be fine using the configured path and discarding this patch.

Don't get me wrong, the solution you've proposed is a way to solve the 
problem, I just don't think it's the best way to do it.  
Of course, if Phil says we can't ship fennel in ___repl___, I would accept
this patch with some tweaking, as modifying the target app code for this
mode to work is a very big no-no point for me.  Or maybe we will come up
with another solution entirely! :)

Initially, I thought that you should be able to use 
C-u M-x fennel-proto-repl RET FENNEL_PATH="./lib/?.fnl" love . RET
but now I'm not sure if it will work, for multiple of reasons.  Maybe it needs
the launcher module to work, or maybe Emacs will try to interpret 
FENNEL_PATH as the executable.  So as of now I fear that only Phil's solution
will work.

>What originally prompted me to submit it is that there wasn’t an indication 
>that the misconfigured path was the issue. Even when setting 
>`fennel-proto-repl-log-communication` to `t` and 
>`fennel-proto-repl-kill-process-buffers` to `nil` the only message I had was 
>`fennel-proto-repl--start-server: Unable to initialize Fennel Proto REPL: timeout`;
>no other debug info or buffers were available.
>
>Is there a sanity-test function or other documentation I can add so future
>users know to check their path config if they get the same error?

This sounds like a bug in the protocol initialization process that I didn't
account for.  I'll look into it soon.

Re: [PATCH fennel-mode] add var to customize location of `fennel`

Details
Message ID
<87pm35yhbf.fsf@hagelb.org>
In-Reply-To
<1D648C17-0B3C-4291-B3B0-F5034BB690E6@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Andrey <andreyorst@gmail.com> writes:

> I can see this less than an ideal solution, as it means that proto-repl
> isn't generic enough. Phil, do you think we can offer fennel-the-module
> as a field in the ___repl___ table?  This way, the protocol will not 
> be required to require anything.  Given that the REPL requires the
> fennel module to work I assume it's OK to reference it in the ___repl___
> WDYT?

I would be fine adding the module or at least the module name to this
table if you still need it. Is it still needed or did you get this taken
care of?

-Phil

Re: [PATCH fennel-mode] add var to customize location of `fennel`

Details
Message ID
<D26D78EB-03CC-43BF-A0C1-7B64C05B2A89@gmail.com>
In-Reply-To
<87pm35yhbf.fsf@hagelb.org> (view parent)
DKIM signature
missing
Download raw message
>I would be fine adding the module or at least the module name to this
>table if you still need it. Is it still needed or did you get this taken
>care of?

Yes, I think it's done now. The protocol can be configured properly
during initialization, and we still need the variable in emacs for
completion to work, so everything is fine now.


-- 
Andrey Listopadov
Reply to thread Export thread (mbox)