Unable to define start-slynk

I tried to define the start-slynk command according to the instructions, but the “my-slynk.lisp” file never loads. I actually did

(load-after-system :slynk (nyxt-init-file "my-slynk.lisp"))

and put the command definition for start-slynk in my-slynk.lisp.

I then tried to define the start-slynk command directly in the lisp-repl in nyxt, but I get the following error:

WARN - Warning: Error on separate thread: Package SLYNK does not
exist. Stream: #<dynamic-extent STRING-INPUT-STREAM (unavailable)
from "(define-...">

Here is my system information:

Nyxt version: 2.1.0
Renderer version: GI-GTK
Operating system kernel: Linux 5.12.8-arch1-1
Lisp implementation: SBCL 2.1.1
Features: (WEBKIT2 WEBKIT2-2.32 WEBKIT2-PASTE-PLAINTEXT WEBKIT2-TRACKING WEBKIT2-MUTE
 WEBKIT2-EMOJI WEBKIT2-MEDIA WEBKIT2-SANDBOXING GTK-3-22 GTK-3-20 GTK-3-18
 GTK-3-16 GTK-3-14 GTK-3-12 GTK-3-10 GTK-3-8 GTK-3-6 GTK-3-4 GTK GDK-3-22
 GDK-3-20 GDK-3-18 GDK-3-16 GDK-3-14 GDK-3-12 GDK-3-10 GDK-3-8 GDK-3-6 GDK-3-4
 CAIRO-1-10 CAIRO-1-12 GDK-PIXBUF GLIB-2-30 GLIB-2-32 GLIB-2-34 GLIB-2-36
 GLIB-2-38 GLIB-2-40 GLIB-2-42 GLIB-2-44 GLIB-2-46 GLIB-2-48 GLIB-2-50
 GLIB-2-52 GLIB-2-54 GLIB-2-56 GLIB-2-58 GLIB NYXT-2 FSET-EXT-STRINGS
 CUSTOM-HASH-TABLE-NATIVE SWANK PLUMP-UTF-32 CL-PPCRE-UNICODE GLOBAL-VARS
 DECLARE-TYPES PARENSCRIPT SBCL+SAFE-STANDARD-READTABLE NAMED-READTABLES
 21BIT-CHARS CHUNGA GRAY-STREAMS FAST-IO-SV FAST-IO SBCL-USES-SB-ROTATE-BYTE
 ASDF-SYSTEM-CONNECTIONS CLOSER-MOP SPLIT-SEQUENCE CL-UNICODE FLEXI-STREAMS
 CL-PPCRE CL-JSON-DOUBLE-FLOAT-IS-SUBSUMED CL-JSON-SINGLE-FLOAT-IS-SUBSUMED
 CL-JSON-CLOS CL-JSON BORDEAUX-THREADS THREAD-SUPPORT FLAT-NAMESPACE X86-64
 UNIX CFFI FLAT-NAMESPACE SEQUENCE-EMPTYP QUICKLISP ASDF3.3 ASDF3.2 ASDF3.1
 ASDF3 ASDF2 ASDF OS-UNIX NON-BASE-CHARS-EXIST-P ASDF-UNICODE X86-64 GENCGC
 64-BIT ANSI-CL COMMON-LISP ELF IEEE-FLOATING-POINT LINUX LITTLE-ENDIAN
 PACKAGE-LOCAL-NICKNAMES SB-CORE-COMPRESSION SB-LDB SB-PACKAGE-LOCKS SB-THREAD
 SB-UNICODE SBCL UNIX)

ASDF version: 3.3.1
Critical dependencies: (/home/karthik/.config/trizen/sources/nyxt/src/nyxt/_build/submodules/cl-cffi-gtk/gtk/cl-cffi-gtk.asd
 /home/karthik/.config/trizen/sources/nyxt/src/nyxt/_build/quicklisp-client/dists/quicklisp/software/cl-gobject-introspection-20210124-git/cl-gobject-introspection.asd
 /home/karthik/.config/trizen/sources/nyxt/src/nyxt/_build/submodules/cl-webkit/webkit2/cl-webkit2.asd)

Quicklisp dist version: 2021-05-31
Quicklisp client version: 2020-01-04
Local project directories: (/home/karthik/.config/trizen/sources/nyxt/src/nyxt/_build/submodules/
 /home/karthik/.config/trizen/sources/nyxt/src/nyxt/_build/quicklisp-client/local-projects/)
Critical dependencies(#<SYSTEM cl-cffi-gtk / cl-cffi-gtk-20201220-git / quicklisp 2021-05-31>
 #<SYSTEM cl-gobject-introspection / cl-gobject-introspection-20210124-git / quicklisp 2021-05-31>
 #<SYSTEM cl-webkit2 / cl-webkit-20210531-git / quicklisp 2021-05-31>)

I installed nyxt from the Arch AUR. SBCL was installed as a binary from the official Arch repos, and nyxt was built from source.

$ sbcl --version
SBCL 2.1.1

Are you using your distro’s package or a local build?

I’ve had the same problem in the past, and Pierre has been kind enough to guide me through this. Packaged versions of Nyxt don’t pull CL packages from Quicklisp, you need to install them yourself.

What I do here is I create a symlink from ~/.local/share/nyxt/extensions/slynk/ to the location of the the Slynk directory in ~/.config/emacs/. It then gets loaded by (load-after-system).

SBCL is from the distro, nyxt was built from source using an arch PKGBUILD. I remember the install process pulling CL packages from Quicklisp.

However, the directory ~/.local/share/nyxt/extensions/ did not exist for me. I followed your recipe and now slynk is being loaded. I successfully connected to the slynk server using sly-connect from Emacs. :+1:

BTW, how do I discover commands/namespaces from sly? I tried (list-buffers) but it errored out, I had to do (nyxt/buffer-listing-mode:list-buffers).

I’m glad it worked. I also use an AUR package. I’m afraid I can’t help you about your question, as my knowledge of Slynk and CL is very superficial.

The only thing I can think of is this:

in Emacs Sly/Slime REPL, you can press “,” and then type in-package, RET, and then select packages with some prefix. You could type in nyxt and you would have a list of all of the Nyxt packages. From there, you could see what symbols exist in each package. I don’t know if this is a good way to explore the source code. I think it would probably be easier to just download it directly :smiley: and look!