geiser-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Send s-exp to the REPL for evaluation


From: Jose A. Ortega Ruiz
Subject: Re: Send s-exp to the REPL for evaluation
Date: Thu, 06 Jun 2024 16:14:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hi Jérémy,

On Thu, Jun 06 2024, Jérémy Korwin-Zmijowski wrote:

> Dear Geiser users,
>
> I look for a way to programmatically evaluate a Guile s-exp like
> Geiser would do it when I hit `C-x C-e`.

[...]

>
> I would like it to trigger the geiser debug buffer instead.
>
> Maybe someone here can point me what I missed…

The user-level commands for evaluation are defined in geise-mode.el. If
you look at any of them (geiser-eval-last-sexp, geiser-eval-region,
etc.), you'll see they rely on geiser-debug--send-region, which is the
one popping up debugging info after evaluation. There's also
geiser-debug--send-region/wait, to make the evaluation synchronous.

I am not sure I understand what you want to do, but if the sexp is still
in the buffer, geiser-eval-last-sexp is probably good enough. If you're
massaging the code or generating some, you could put it in temp buffer
and then use there those functions, after activating geiser-mode there
(which can be tricky if you use more than one scheme), or create your
own version of geiser-debug--send-region which takes a string, the one
defined here:

https://gitlab.com/emacs-geiser/geiser/-/blob/master/elisp/geiser-debug.el#L265

Hope that helps.

Cheers,
jao
-- 
All parts should go together without forcing. You must remember that
the parts you are reassembling were disassembled by you. Therefore, if
you can’t get them together again, there must be a reason. By all
means, do not use a hammer. —IBM Manual, 1925



reply via email to

[Prev in Thread] Current Thread [Next in Thread]