Hello fellow Nyxt hackers ! May i ask you how to instruct nyxt to use emacs as external editor in a Guix system ?
I’ve unsuccesfully tried to do so like this ( in both my ~/.config/nyxt/init.el and …/auto-config.lisp files) :
FYI, i’m getting Nyxt message saying :
" WARNING : the value is not of type list when binding SB-IMPL::X "
What am i missing ?
thanks, thanks thanks
Try putting this string into a list, like
That should probably fix it.
The problem is likely due to
uiop:launch-program (the function we use for external editor invokations) accepting only a list of strings. I’ve just pushed a fix on master, now a mere string should be fine too.
By the way, why
init.el instead of
init.lisp? Nyxt is written in Common Lisp, not Emacs Lisp.
@fenix Note that specifying the program as a list of strings is handy since you can also declare arguments. For instance, here’s how I set
((external-editor-program (list "emacsclient" "-c"))))
Nice to know @aadcg !
Oh, yes, … i knew. Super Nyxt browser is made not of Emacs Lisp but Common Lisp, @aartaka . Thanks for the reminder.
The default value for
(or (uiop:getenv "VISUAL") (uiop:getenv "EDITOR")). I’ve already defined these in my bash_profile as
export EDITOR="emacsclient --create-frame --tty"
export VISUAL="emacsclient --create-frame"
I then set
((external-editor-program (str:split #\space (uiop/os:getenv "VISUAL")))))
Which will set it to
(list "emacsclient" "--create-frame").
This works for me, and I don’t have to do anything special. Maybe chaging the default to
(str:split #\space (or (uiop:getenv "VISUAL") (uiop:getenv "EDITOR"))) would be beneficial.
EDIT: I should note that I’m running emacs as a server using shepherd. I have the following configuration which basically runs
emacs --fg-daemon, and that’s the key in getting
emacsclient to work properly.
I start shepherd when logging in by executing
shepherd & in my StumpWM configuration.
In my StumpWM config:
(unless (probe-file "/run/user/1000/shepherd/socket")
(run-shell-command "shepherd &"))
Which reads the following file
(use-modules (shepherd service)
((ice-9 ftw) #:select (scandir)))
;; Load all the files in the directory 'init.d' with a suffix '.scm'.
(load (string-append "init.d/" file)))
(scandir (string-append (dirname (current-filename)) "/init.d")
(string-suffix? ".scm" file))))
;; Send shepherd into the background
(action 'shepherd 'daemonize)
And this loads my emacs setup and starts emacs as a server.
(use-modules (shepherd support))
#:docstring "Starts emacs as a daemon"
#:start (lambda ()
(let ((socket (string-append %user-runtime-dir "/emacs/server")))
(unless (file-exists? socket)
(fork+exec-command (list "emacs" "--fg-daemon")))))
@simendsjo I think your observation is spot on! Would you like to open a PR?