~technomancy/fennel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH] fennel-mode should use split-string-shell-cmd

Details
Message ID
<8735g4xj4f.fsf@whatthefuck.computer>
DKIM signature
missing
Download raw message
Patch: +1 -1
This allows one to do Dumb Things like literately program inside of ~/org/ with a nix-shell that has a Fennel and custom Lua distribution like so:

#+begin_src emacs-lisp
(setq fennel-program "nix-shell /home/rrix/Code/koreader-to-org/shell.nix --run \"fennel --repl\"")
(fennel-repl nil)
#+end_src

https://nixos.wiki/wiki/Development_environment_with_nix-shell

Without this patch the final two arguments to make-comint are "fennel" "--repl" rather than a single argument the shell provides and nix-shell expects.

---
 fennel-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fennel-mode.el b/fennel-mode.el
index f0abc15..fcb8843 100644
--- a/fennel-mode.el
+++ b/fennel-mode.el
@@ -186,7 +186,7 @@ the prompt."
  (if (not (comint-check-proc fennel-repl--buffer))
      (let* ((cmd (or (and ask-for-command? (read-from-minibuffer "Command: "))
                      fennel-program))
             (cmdlist (split-string cmd)))
             (cmdlist (split-string-shell-command cmd)))
        (set-buffer (apply #'make-comint "Fennel REPL" (car cmdlist) nil (cdr cmdlist)))
        (fennel-repl-mode)
        (setq-local fennel-program cmd)
-- 
2.36.1
Details
Message ID
<87iloz46hw.fsf@whirlwind>
In-Reply-To
<8735g4xj4f.fsf@whatthefuck.computer> (view parent)
DKIM signature
missing
Download raw message
Ryan Rix <ryan@whatthefuck.computer> writes:

> This allows one to do Dumb Things like literately program inside of
> ~/org/ with a nix-shell that has a Fennel and custom Lua distribution
> like so:

Thanks for this change.

Unfortunately my emacs doesn't have this function. It looks like it must
have been added after 27? I don't think we're ready to drop support for
27 quite yet.

-Phil
Details
Message ID
<87h74jfbxu.fsf@gmail.com>
In-Reply-To
<87iloz46hw.fsf@whirlwind> (view parent)
DKIM signature
missing
Download raw message
> Unfortunately my emacs doesn't have this function. It looks like it must
> have been added after 27? I don't think we're ready to drop support for
> 27 quite yet.
>

I believe `split-string-shell-command` was added somewhere in 28.1. But
we can support both variants, by checking whether it's available by
`fboundp` and it will work for both old and new versions.

--
Andrey Listopadov
Details
Message ID
<4edd1dc1-ece2-414b-89aa-9e2fad9e8a6a@www.fastmail.com>
In-Reply-To
<87h74jfbxu.fsf@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Ah, sorry, I didn't think to check when it was added! describe-function sez:   Probably introduced at or before Emacs version 28.1.

I am happy to modify the patch this weekend.

On Fri, Jun 17, 2022, at 10:14 AM, Andrey Listopadov wrote:
>> Unfortunately my emacs doesn't have this function. It looks like it must
>> have been added after 27? I don't think we're ready to drop support for
>> 27 quite yet.
>>
>
> I believe `split-string-shell-command` was added somewhere in 28.1. But
> we can support both variants, by checking whether it's available by
> `fboundp` and it will work for both old and new versions.
>
> --
> Andrey Listopadov
Reply to thread Export thread (mbox)