From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QDHfBEoCzmF7fQEAgWs5BA (envelope-from ) for ; Thu, 30 Dec 2021 20:02:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GEKVAUoCzmHrnwAAauVa8A (envelope-from ) for ; Thu, 30 Dec 2021 20:02:34 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 653F91CB6 for ; Thu, 30 Dec 2021 20:02:32 +0100 (CET) Received: from localhost ([::1]:55726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n30h4-00031O-VP for larch@yhetil.org; Thu, 30 Dec 2021 14:02:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n30gX-0002zA-9q for emacs-orgmode@gnu.org; Thu, 30 Dec 2021 14:01:57 -0500 Received: from devianza.investici.org ([198.167.222.108]:40917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n30gU-0007TU-6k for emacs-orgmode@gnu.org; Thu, 30 Dec 2021 14:01:56 -0500 Received: from mx2.investici.org (unknown [127.0.0.1]) by devianza.investici.org (Postfix) with ESMTP id 4JPyLJ1XZhz6vHV for ; Thu, 30 Dec 2021 19:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mortemale.org; s=stigmate; t=1640890904; bh=+72ZW6ipb0kpkGqoyGfkrxcCDGJF5q1E57TgopA7/T0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=G4HLwwLTrWmKk1IjD36DDzYgZ3I11coBrkHjwfx2FIJqBV15bz6oCXvO0tRGT8zpH 0rOvTbRlsvfrG5b1iwDtJ7WK/WltvqEAIsGYKri9aNnttgDvC+qyAKsOE8m3vcINGO getuxl51wm9chLo/5hPftuJx3KmozGHI6V6y8nlA= Received: from [198.167.222.108] (mx2.investici.org [198.167.222.108]) (Authenticated sender: felipelema@mortemale.org) by localhost (Postfix) with ESMTPSA id 4JPyLH5H8cz6vH3 for ; Thu, 30 Dec 2021 19:01:43 +0000 (UTC) From: Felipe Lema To: emacs-orgmode@gnu.org Subject: Re: [PATCH] update ob-scheme to latest changes in geiser package Date: Thu, 30 Dec 2021 16:01:37 -0300 Message-ID: <3462869.oopU1TnKvU@felipe-thinkpad-x200> In-Reply-To: <3749511.XVzDg1PN9u@felipe-thinkpad-x200> References: <8693346.QgZh8Glrbv@felipe-thinkpad-x200> <3749511.XVzDg1PN9u@felipe-thinkpad-x200> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart3231174.sZXyZEH0Fs" Content-Transfer-Encoding: 7Bit Received-SPF: pass client-ip=198.167.222.108; envelope-from=felipelema@mortemale.org; helo=devianza.investici.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640890953; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=+72ZW6ipb0kpkGqoyGfkrxcCDGJF5q1E57TgopA7/T0=; b=Kz91UsBWGS6ZLurcFW2XTjeZpPs2+0QTOOf+kK1BvoNbZwf0GqnRwPruGTFQ8FlZnFE4zZ hO3X5yMtkDlpBJBaZr+ZiDacWCmkAmodq/PJAzC0FM8VJ/Srja1F0nZlik7EQugNzK9ThV Bob7XL351Ld0S9IY/iWuwIt77Gvc9AtMCKB8KRdoy0z9WLeJG8CwvG4bFaAX/kqcfTzhWT kWSU8qzUu7y12zZe89ss/LbS6reDiwyVPF0/B/sf6WLJFz7nHZgNXWnggmLb5qAqGnwZEN 4xr3gY8nIZFzxK47ez+eBAxdEb8w4uFIkTaMvlxUtFs+lUObZomaEYHp25qvpg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640890953; a=rsa-sha256; cv=none; b=YvDLx8U11Q1/IORyB066NCjCD24ZoO6/HYRPK9eOn/pTewyKeriffiqp99Lioi+8gSbYg9 HyBiR70p2J7aOvnBzJDEO/w3TeAULSDAkNElYRAF/cT8zrMMMYPANgMdy0p+fex71vDSqx 1WFe0k8nhKueF2bUWYSr3F6hyZNL2qhQhA/H5ycXFral8+XM/6ffsnk8jr+Qq5ZOEKtNxG 4nqZuvVNudbm0DDTT2WodeMw+s/DVvX45XoDLh7GKtVZPewrkA8piHaivHM2I8+/azjDgi eb46rFG3xsA+p0RzF3+WInyCZsc5SbSTPhQLw9VkABBmaLYC1IgwxD/FDUzonw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=mortemale.org header.s=stigmate header.b=G4HLwwLT; dmarc=pass (policy=reject) header.from=mortemale.org; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.27 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=mortemale.org header.s=stigmate header.b=G4HLwwLT; dmarc=pass (policy=reject) header.from=mortemale.org; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 653F91CB6 X-Spam-Score: -3.27 X-Migadu-Scanner: scn1.migadu.com X-TUID: lpse651slr2I This is a multi-part message in MIME format. --nextPart3231174.sZXyZEH0Fs Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Thursday, 30 December 2021 22:50:20 +07 Max Nikulin wrote: > On Wednesday, 29 December 2021 22.53.18 -03 Felipe Lema wrote: > > On Wednesday, 29 December 2021 15.03.47 -03 Felipe Lema wrote: > > > Sup, y'all > > > > > > The geiser package had a recent update in which `geiser-eval-region` behaves like an async function and does not return evaluation result. In exchange, the newly introduced `geiser-eval-region/wait` does that now. > > > > > > I've attached a patch to update ob-scheme.el to reflect these changes. Without them, evaluating scheme dialect code blocks in Org will end up with empty results. > > > > > > To learn more about the change (and how it impacted other people's flows) see issue thread below > > > > > > https://gitlab.com/emacs-geiser/geiser/-/issues/30 > > > > > > Felipe > > > > > > > > > > I was pointed out that I was missing the corresponding `declare-function`. > > > > I've included it in the attached patch. Sorry about the double-posting > > > > Felipe > > > > I am not a geiser user, so maybe I missed something. Does this change mean that org becomes incompatible with older geiser versions? E,g, debian and ubuntu have elpa-geiser system package. > > > I would consider testing if `geiser-eval-region/wait' is bound and fallback to `geiser-eval-region' otherwise. I've wrapped an `if` to fallback to previous API before this breaking change in attached patch. Felipe --nextPart3231174.sZXyZEH0Fs Content-Disposition: attachment; filename="org-babel-scheme-geiser-eval-region.wait_v3.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="org-babel-scheme-geiser-eval-region.wait_v3.diff" update to new API call to evaluate region and wait for result * ob-scheme.el replace `geiser-eval-region` with `geiser-eval-region/wait` (only available in newer versions) as the former changed expected behaviour; the latter returns the result of evaluating. diff --git a/lisp/org/ob-scheme.el b/lisp/org/ob-scheme.el index f4836b23fe..ffbd62bf97 100644 --- a/lisp/org/ob-scheme.el +++ b/lisp/org/ob-scheme.el @@ -53,8 +53,6 @@ geiser-repl-window-allow-split (declare-function run-geiser "ext:geiser-repl" (impl)) (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-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 +174,14 @@ org-babel-scheme-execute-with-geiser (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 + ;; use `geiser-eval-region/wait' only when available + ;; in newer versions of `geiser' + (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") --nextPart3231174.sZXyZEH0Fs--