emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Van den Langenbergh <tmt_vdl@gmx.com>
To: Felipe Lema <felipelema@mortemale.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] update ob-scheme to latest changes in geiser package
Date: Sat, 23 Apr 2022 15:29:56 +0200	[thread overview]
Message-ID: <874k2k0vtw.fsf@terra.tmtvl.info> (raw)
In-Reply-To: 878rrw0w3x.fsf@terra.tmtvl.info

[-- Attachment #1: Type: text/plain, Size: 489 bytes --]

Felipe,

I have taken the liberty of reformatting the patch you created for ob-scheme.
You can find it enclosed.

If it is fine with you and the org-mode maintainers it can be applied as-is,
particularly since it is a tiny change.
I have also added some additional information to the commit message, such as
when the `geiser-eval-region/wait' function was introduced.

Please feel free to contact me in regards to any comments or questions you may
have.

Vale,

- Tim Van den Langenbergh


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: lisp-ob-scheme.el-Use-synchronous-eval --]
[-- Type: text/x-patch, Size: 2016 bytes --]

From d06f6d5b7342693b4065c0c361e430c4bdb065e5 Mon Sep 17 00:00:00 2001
From: Tim Van den Langenbergh <tmt_vdl@gmx.com>
Date: Sat, 23 Apr 2022 14:57:27 +0200
Subject: [PATCH] lisp/ob-scheme.el: Use synchronous eval.

* ob-scheme.el (org-babel-scheme-execute-with-geiser): If available,
use the synchronous `geiser-eval-region/wait' function to get the
evaluation result.

Works with geiser 0.18 (before introduction of async evaluation) and
geiser 0.22 (which introduces `geiser-eval-region/wait').

Modified from a patch proposal by Felipe Lema.

TINYCHANGE
---
 lisp/ob-scheme.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el
index 72d2e029e..f28cadd87 100644
--- a/lisp/ob-scheme.el
+++ b/lisp/ob-scheme.el
@@ -55,6 +55,8 @@
 (declare-function geiser-mode "ext:geiser-mode" ())
 (declare-function geiser-eval-region "ext:geiser-mode"
                   (start end &optional and-go raw nomsg))
+(declare-function geiser-eval-region/wait "ext:geiser-mode"
+                  (start end &optional timeout))
 (declare-function geiser-repl-exit "ext:geiser-repl" (&optional arg))
 (declare-function geiser-eval--retort-output "ext:geiser-eval" (ret))
 (declare-function geiser-eval--retort-result-str "ext:geiser-eval" (ret prefix))
@@ -176,7 +178,11 @@ is true; otherwise returns the last value."
 	  (setq geiser-impl--implementation nil)
 	  (let ((geiser-debug-jump-to-debug-p nil)
 		(geiser-debug-show-debug-p nil))
-	    (let ((ret (geiser-eval-region (point-min) (point-max))))
+	    (let ((ret (funcall (if (fboundp 'geiser-eval-region/wait)
+                                    #'geiser-eval-region/wait
+                                  #'geiser-eval-region)
+                                (point-min)
+                                (point-max))))
 	      (setq result (if output
 			       (or (geiser-eval--retort-output ret)
 				   "Geiser Interpreter produced no output")
--
2.35.3


       reply	other threads:[~2022-04-23 14:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <878rrw0w3x.fsf@terra.tmtvl.info>
2022-04-23 13:29 ` Tim Van den Langenbergh [this message]
2022-04-26 15:04   ` [PATCH] update ob-scheme to latest changes in geiser package Felipe Lema
2022-04-27  8:44   ` Ihor Radchenko
2022-05-07 12:04     ` Tim Van den Langenbergh
2022-05-08 10:02       ` Ihor Radchenko
2021-12-29 18:03 Felipe Lema
2021-12-30  1:53 ` Felipe Lema
2021-12-30 15:50   ` Max Nikulin
2021-12-30 19:01   ` Felipe Lema
2021-12-31  4:22     ` Max Nikulin
2022-02-06  9:50       ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874k2k0vtw.fsf@terra.tmtvl.info \
    --to=tmt_vdl@gmx.com \
    --cc=3462869.oopU1TnKvU@felipe-thinkpad-x200 \
    --cc=emacs-orgmode@gnu.org \
    --cc=felipelema@mortemale.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).