~technomancy/fennel

fennel-mode should use split-string-shell-cmd v1 PROPOSED

Ryan Rix: 1
 fennel-mode should use split-string-shell-cmd

 1 files changed, 1 insertions(+), 1 deletions(-)
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.
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~technomancy/fennel/patches/33066/mbox | git am -3
Learn more about email & git

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

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
Ryan Rix <ryan@whatthefuck.computer> writes: