Howto for hooking up emacs with nyxt

Hi,

Is there a Howto guide somewhere for hooking up emacs with nyxt that I can read?

Depends on the direction! Nyxt can receive arbitrary sexp via swank or arguments. Here’s some inspiration on Nyxt → eMacs:

https://nyxt.atlas.engineer/article/emacs-hacks.org

Hi jmercouris,

The opening of the article explains the direction I’m going in:

Nyxt can be controlled from an external program via SWANK. For instance, Emacs with SLIME makes it possible to hack Nyxt while it’s running.

Is there a basic tutorial on how to hook up SWANK with nyxt that is reproducible across GNU/Linux distros that I can follow in order to hook up emacs with nyxt?

I’m using sly. Not sure if much changes for hooking up sly (SWANK, emacs) to nyxt…

I like the idea of hacking emacs from nyxt but what I’m trying to do is more basic at this stage in my nyxt explorations.

If you can point me to an article or some public config that demonstrates the minimal config needed to hook up emacs to nyxt, it would be greatly appreciated.

Thanks for pointing me to that article though, it’s much appreciated and quite impressive!

No problem!

So all you need to do to get started in that direction is like this:

In Nyxt execute start-swank, it will default with a port of 4006, then in Emacs execute sly-connect or slime-connect and specify the port as 4006 when prompted. Now you can send any arbitrary commands to Nyxt from Emacs!

If you want, you can also describe-slot the slot remote-execution-p to see how you can just pipe arbitrary Lisp to the Nyxt socket for it to be evaluated. You could use Emacs to do so. I hope that helps!

2 Likes

Thanks,

you can also describe-slot the slot remote-execution-p

Not sure what you mean by the above. I think I have to do some more lisp learning…

Do you mean introspect a class slot (field?) called remote-execution-p to see if it is truthy or not?

ps

Now there’s a start-slynk baked in: Add start-slynk command by jgarte · Pull Request #2431 · atlas-engineer/nyxt · GitHub

woohoo!

Introspection works too, but what @jmercouris meant was probably “execute describe-slot command (Should be f1-c in CUA & VI and C-h c in Emacs bindings) and choose remote-execution-p in its menu, so that it shows you the documentation and class it belongs to”.

The following github repo has code for communicating both ways between emacs and nyxt.

It currently is only for Nyxt version 2. Nyxt version 3 has some significant changes, that will need adapting to:

  • web-mode has been replaced by hint.lisp.
  • Getting the name(s) of a buffers mode, has changed.
1 Like

Might be TMI.

Connecting emacs is as simple as steps 7 and 8 from charje:

or the following in sequence

In nyxt

C-space start-slynk

In emacs

sly-connect choose port 4006