From mboxrd@z Thu Jan 1 00:00:00 1970 From: KDr2 Subject: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Wed, 2 Apr 2014 11:48:11 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=f46d0447f0da80ae9304f60728cd Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVCAE-0001n1-Ee for emacs-orgmode@gnu.org; Tue, 01 Apr 2014 23:48:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVCAD-0006hu-4X for emacs-orgmode@gnu.org; Tue, 01 Apr 2014 23:48:34 -0400 Received: from mail-ob0-x22c.google.com ([2607:f8b0:4003:c01::22c]:36254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVCAC-0006hk-Tm for emacs-orgmode@gnu.org; Tue, 01 Apr 2014 23:48:33 -0400 Received: by mail-ob0-f172.google.com with SMTP id wm4so12152587obc.3 for ; Tue, 01 Apr 2014 20:48:31 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --f46d0447f0da80ae9304f60728cd Content-Type: multipart/alternative; boundary=f46d0447f0da80ae8f04f60728cb --f46d0447f0da80ae8f04f60728cb Content-Type: text/plain; charset=ISO-8859-1 The bug: write file ~/scheme-test.org with the content below: -------8<-------------- #+BEGIN_SRC scheme :exports results :results output raw (display "Hello Scheme in OrgMode") #+END_SRC -------8<-------------- and run: emacs --batch --eval='(load "~/.emacs.d/init.el")' ~/scheme-test.org -f org-html-export-to-html you will find the bug: `org-babel-scheme-execute-with-geiser' uses `current-message' to get the results of scheme code blocks, but `current-message' always returns nil in batch mode, and this patch fixes this. -- -- KDr2, http://kdr2.com --f46d0447f0da80ae8f04f60728cb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
The bug:
write file ~/scheme-test.org with the content below:
--= -----8<--------------
#+BEGIN_SRC scheme :exports results= :results output raw
=A0 (display "Hello Scheme in OrgMode")
#+END_SRC<= /div>
-------8<--------------

and run= :

emacs --batch --eval=3D'(load "~/.emacs= .d/init.el")' ~/scheme-test.org= -f org-html-export-to-html

you will find the bug:

`= org-babel-scheme-execute-with-geiser' uses `current-message' to get= the results of scheme code blocks, but `current-message' always return= s nil in batch mode, and this patch fixes this.

--
--=A0
--f46d0447f0da80ae8f04f60728cb-- --f46d0447f0da80ae9304f60728cd Content-Type: text/x-patch; charset=US-ASCII; name="0001-ob-scheme.el-Fix-scheme-code-blocks-execution-error-.patch" Content-Disposition: attachment; filename="0001-ob-scheme.el-Fix-scheme-code-blocks-execution-error-.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hti1k16x0 RnJvbSBjZWJmOWZjNGZlMDlhYjIyZmQzMWZmOGU1NjA2ZDBmNjgwYzEyMWU5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBLRHIyIDxraWxseS5kcmF3QGdtYWlsLmNvbT4KRGF0ZTogV2Vk LCAyIEFwciAyMDE0IDEwOjMwOjM4ICswODAwClN1YmplY3Q6IFtQQVRDSF0gb2Itc2NoZW1lLmVs OiBGaXggc2NoZW1lIGNvZGUgYmxvY2tzIGV4ZWN1dGlvbiBlcnJvciBpbiBiYXRjaAogbW9kZQoK KiBsaXNwL29iLXNjaGVtZS5lbCAob3JnLWJhYmVsLXNjaGVtZS1jYXB0dXJlLWN1cnJlbnQtbWVz c2FnZSwgb3JnLWJhYmVsLXNjaGVtZS1leGVjdXRlLXdpdGgtZ2Vpc2VyKTogQ2FwdHVyZSBzY2hl bWUgY29kZSByZXN1bHRzIHZpYSBjdXJyZW50LW1lc3NhZ2UgYm90aCBpbiB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 PiAiKQotCQkgIChyZXBsYWNlLXJlZ2V4cC1pbi1zdHJpbmcgIl49PiAiICIiIChjdXJyZW50LW1l c3NhZ2UpKQorCSAgICAgIChpZiAoYW5kIChzdHJpbmdwIHJlc3VsdCkgKGVxdWFsIChzdWJzdHJp bmcgcmVzdWx0IDAgMykgIj0+ICIpKQorCQkgIChyZXBsYWNlLXJlZ2V4cC1pbi1zdHJpbmcgIl49 PiAiICIiIHJlc3VsdCkKIAkJIlwiQW4gZXJyb3Igb2NjdXJyZWQuXCIiKSkKIAkod2hlbiAobm90 IHJlcGwpCiAJICAoc2F2ZS1jdXJyZW50LWJ1ZmZlciAoc2V0LWJ1ZmZlciByZXBsLWJ1ZmZlcikK LS0gCjEuOS4xCgo= --f46d0447f0da80ae9304f60728cd-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: KDr2 Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Tue, 8 Apr 2014 21:56:07 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e011769d1b6b52004f68859c3 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXWVq-0004wZ-V1 for emacs-orgmode@gnu.org; Tue, 08 Apr 2014 09:56:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXWVp-0001Sp-2m for emacs-orgmode@gnu.org; Tue, 08 Apr 2014 09:56:30 -0400 Received: from mail-ob0-x22d.google.com ([2607:f8b0:4003:c01::22d]:37829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXWVo-0001Sd-UH for emacs-orgmode@gnu.org; Tue, 08 Apr 2014 09:56:29 -0400 Received: by mail-ob0-f173.google.com with SMTP id gq1so1028620obb.32 for ; Tue, 08 Apr 2014 06:56:28 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --089e011769d1b6b52004f68859c3 Content-Type: text/plain; charset=ISO-8859-1 Hi, folks Has anyone reviewed this patch? Or is there a better way to fix the bug? Thanks. On Wed, Apr 2, 2014 at 11:48 AM, KDr2 wrote: > The bug: > write file ~/scheme-test.org with the content below: > -------8<-------------- > #+BEGIN_SRC scheme :exports results :results output raw > (display "Hello Scheme in OrgMode") > #+END_SRC > -------8<-------------- > > and run: > > emacs --batch --eval='(load "~/.emacs.d/init.el")' ~/scheme-test.org -f > org-html-export-to-html > > you will find the bug: > > `org-babel-scheme-execute-with-geiser' uses `current-message' to get the > results of scheme code blocks, but `current-message' always returns nil in > batch mode, and this patch fixes this. > > -- > -- > > KDr2, http://kdr2.com > -- -- KDr2, http://kdr2.com --089e011769d1b6b52004f68859c3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi, folks

Has anyone reviewed this patc= h? Or is there a better way to fix the bug?

Thanks= .


= On Wed, Apr 2, 2014 at 11:48 AM, KDr2 <killy.draw@gmail.com> wrote:
The bug:
write file ~/scheme-= test.org with the content below:
-------8<--------------
#+BEGIN_SRC scheme :exports = results :results output raw
=A0 (display "Hello Scheme in OrgMode")
#+END_SRC<= /div>
-------8<--------------

and run= :

emacs --batch --eval=3D'(load "~/.emacs= .d/init.el")' ~/scheme-test.org -f org-html-export-to-html

you will find the bug:

`= org-babel-scheme-execute-with-geiser' uses `current-message' to get= the results of scheme code blocks, but `current-message' always return= s nil in batch mode, and this patch fixes this.
--
--=A0



--
--=A0

KDr2, http://kdr2.com
--089e011769d1b6b52004f68859c3-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleh Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Thu, 10 Apr 2014 10:27:33 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYAKg-0003TX-1f for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 04:27:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYAKd-0004bd-7C for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 04:27:37 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:43444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYAKd-0004bK-1M for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 04:27:35 -0400 Received: by mail-wi0-f169.google.com with SMTP id hm4so604417wib.2 for ; Thu, 10 Apr 2014 01:27:33 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: KDr2 Cc: emacs-orgmode@gnu.org Hi, I tried to have a look at your patch, but ob-scheme has stopped working for me. Can you send me the minimal init.el to make your scheme-test.org work in interactive mode? regards, Oleh On Tue, Apr 8, 2014 at 3:56 PM, KDr2 wrote: > Hi, folks > > Has anyone reviewed this patch? Or is there a better way to fix the bug? > > Thanks. > > > On Wed, Apr 2, 2014 at 11:48 AM, KDr2 wrote: >> >> The bug: >> write file ~/scheme-test.org with the content below: >> -------8<-------------- >> #+BEGIN_SRC scheme :exports results :results output raw >> (display "Hello Scheme in OrgMode") >> #+END_SRC >> -------8<-------------- >> >> and run: >> >> emacs --batch --eval='(load "~/.emacs.d/init.el")' ~/scheme-test.org -f >> org-html-export-to-html >> >> you will find the bug: >> >> `org-babel-scheme-execute-with-geiser' uses `current-message' to get the >> results of scheme code blocks, but `current-message' always returns nil in >> batch mode, and this patch fixes this. >> >> -- >> -- >> >> KDr2, http://kdr2.com > > > > > -- > -- > > KDr2, http://kdr2.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: KDr2 Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Thu, 10 Apr 2014 16:36:50 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0115ec148244b404f6ac1f3c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYATy-0007Xp-5D for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 04:37:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYATv-0007hl-Ab for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 04:37:14 -0400 Received: from mail-ob0-x232.google.com ([2607:f8b0:4003:c01::232]:62770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYATv-0007hc-4c for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 04:37:11 -0400 Received: by mail-ob0-f178.google.com with SMTP id wp18so3993658obc.23 for ; Thu, 10 Apr 2014 01:37:10 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Oleh Cc: emacs-orgmode@gnu.org --089e0115ec148244b404f6ac1f3c Content-Type: text/plain; charset=ISO-8859-1 Hi, Oleh Thanks for you reply. Here is my config steps: 0. I use Debian(sid) and Emacs 24 1. install guile (using apt): http://www.gnu.org/software/guile/ 2. install geiser(http://www.nongnu.org/geiser/) with elpa and setting for geiser: (setq geiser-active-implementations '(guile)) (setq geiser-default-implementation 'guile) That's all, there's no special settings for orgmode. Thanks again. On Thu, Apr 10, 2014 at 4:27 PM, Oleh wrote: > Hi, > > I tried to have a look at your patch, but ob-scheme has stopped working > for me. Can you send me the minimal init.el to make your scheme-test.org > work in interactive mode? > > regards, > Oleh > > On Tue, Apr 8, 2014 at 3:56 PM, KDr2 wrote: > > Hi, folks > > > > Has anyone reviewed this patch? Or is there a better way to fix the bug? > > > > Thanks. > > > > > > On Wed, Apr 2, 2014 at 11:48 AM, KDr2 wrote: > >> > >> The bug: > >> write file ~/scheme-test.org with the content below: > >> -------8<-------------- > >> #+BEGIN_SRC scheme :exports results :results output raw > >> (display "Hello Scheme in OrgMode") > >> #+END_SRC > >> -------8<-------------- > >> > >> and run: > >> > >> emacs --batch --eval='(load "~/.emacs.d/init.el")' ~/scheme-test.org -f > >> org-html-export-to-html > >> > >> you will find the bug: > >> > >> `org-babel-scheme-execute-with-geiser' uses `current-message' to get the > >> results of scheme code blocks, but `current-message' always returns nil > in > >> batch mode, and this patch fixes this. > >> > >> -- > >> -- > >> > >> KDr2, http://kdr2.com > > > > > > > > > > -- > > -- > > > > KDr2, http://kdr2.com > -- -- KDr2, http://kdr2.com --089e0115ec148244b404f6ac1f3c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi, Oleh

Thanks for you reply. Here is = my config steps:
0. I use Debian(sid) and Emacs 24
1. i= nstall guile (using apt):=A0= http://www.gnu.org/software/guile/=A0
2. install geiser(http://www= .nongnu.org/geiser/) with elpa
=A0 =A0 and setting for geiser= :

=A0 =A0 (setq geiser-active-implementations '= ;(guile))
=A0 =A0 (setq geiser-default-implementation 'guile)

=
=A0That's all, there's no special settings for orgmode.<= /div>

Thanks again.



On Thu, Apr 10, 2014 at 4:27 PM, Oleh <ohwoeowho@gmail.com> wrote:
Hi,

I tried to have a look at your patch, but ob-scheme has stopped working
for me. Can you send me the minimal init.el to make your scheme-test.org
work in interactive mode?

regards,
Oleh

On Tue, Apr 8, 2014 at 3:56 PM, KDr2 <killy.draw@gmail.com> wrote:
> Hi, folks
>
> Has anyone reviewed this patch? Or is there a better way to fix the bu= g?
>
> Thanks.
>
>
> On Wed, Apr 2, 2014 at 11:48 AM, KDr2 <killy.draw@gmail.com> wrote:
>>
>> The bug:
>> write file ~/= scheme-test.org with the content below:
>> -------8<--------------
>> #+BEGIN_SRC scheme :exports results :results output raw
>> =A0 (display "Hello Scheme in OrgMode")
>> #+END_SRC
>> -------8<--------------
>>
>> and run:
>>
>> emacs --batch --eval=3D'(load "~/.emacs.d/init.el")&= #39; ~/scheme-test.org= -f
>> org-html-export-to-html
>>
>> you will find the bug:
>>
>> `org-babel-scheme-execute-with-geiser' uses `current-message&#= 39; to get the
>> results of scheme code blocks, but `current-message' always re= turns nil in
>> batch mode, and this patch fixes this.
>>
>> --
>> --
>>
>> KDr2, http://kdr2.co= m
>
>
>
>
> --
> --
>
> KDr2, http://kdr2.com



--
=
--089e0115ec148244b404f6ac1f3c-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleh Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Thu, 10 Apr 2014 10:55:26 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYAlc-0004xF-MB for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 04:55:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYAlb-0004BD-M0 for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 04:55:28 -0400 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:57627) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYAlb-0004B9-BR for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 04:55:27 -0400 Received: by mail-wi0-f174.google.com with SMTP id d1so10291192wiv.7 for ; Thu, 10 Apr 2014 01:55:26 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: KDr2 Cc: emacs-orgmode@gnu.org > 0. I use Debian(sid) and Emacs 24 > 1. install guile (using apt): http://www.gnu.org/software/guile/ > 2. install geiser(http://www.nongnu.org/geiser/) with elpa > and setting for geiser: > > (setq geiser-active-implementations '(guile)) > (setq geiser-default-implementation 'guile) > I've got emacs trunk, GNU Guile 2.0.9, geiser from MELPA and I'm getting the results in a *Geiser dbg* window instead of org-mode when I eval. So the issue is either with ob-scheme or with my geiser, which is the development version, but I don't see why it shouldn't work. regards, Oleh From mboxrd@z Thu Jan 1 00:00:00 1970 From: KDr2 Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Thu, 10 Apr 2014 17:02:34 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1134aa0e87d10a04f6ac7b02 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYAsq-00032g-05 for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 05:02:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYAso-0006UE-UX for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 05:02:55 -0400 Received: from mail-oa0-x229.google.com ([2607:f8b0:4003:c02::229]:58311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYAso-0006U6-Qn for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 05:02:54 -0400 Received: by mail-oa0-f41.google.com with SMTP id j17so4150881oag.28 for ; Thu, 10 Apr 2014 02:02:54 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Oleh Cc: emacs-orgmode@gnu.org --001a1134aa0e87d10a04f6ac7b02 Content-Type: text/plain; charset=ISO-8859-1 Does your "M-x run-geiser" work? It will lead you to a scheme REPL like this: GNU Guile 2.0.9-deb+1-1 Copyright (C) 1995-2013 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> 1 $2 = 1 scheme@(guile-user)> On Thu, Apr 10, 2014 at 4:55 PM, Oleh wrote: > > 0. I use Debian(sid) and Emacs 24 > > 1. install guile (using apt): http://www.gnu.org/software/guile/ > > 2. install geiser(http://www.nongnu.org/geiser/) with elpa > > and setting for geiser: > > > > (setq geiser-active-implementations '(guile)) > > (setq geiser-default-implementation 'guile) > > > > I've got emacs trunk, GNU Guile 2.0.9, geiser from MELPA and I'm > getting the results in a *Geiser dbg* window instead of org-mode when > I eval. So the issue is either with ob-scheme or with my geiser, > which is the development version, but I don't see why it shouldn't > work. > > regards, > Oleh > -- -- KDr2, http://kdr2.com --001a1134aa0e87d10a04f6ac7b02 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Does your "M-x run-geiser" work? It will lead yo= u to a scheme REPL like this:

GNU Guile 2.0.9-deb+1= -1
Copyright (C) 1995-2013 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,= show w'.
This program is free software, and you are welcome t= o redistribute it
under certain conditions; type `,show c' fo= r details.

Enter `,help' for help.
scheme@(guile-use= r)> 1
$2 =3D 1
scheme@(guile-user)>=A0
=



On Thu, Apr 10, 2014 at 4:55 PM, Oleh <ohwoeowho@gmail.com> wrote:
> 0. I use Debian(sid) and Emacs 24
> 1. install guile (using apt): http://www.gnu.org/software/guile/
> 2. install geiser(http://www.nongnu.org/geiser/) with elpa
> =A0 =A0 and setting for geiser:
>
> =A0 =A0 (setq geiser-active-implementations '(guile))
> =A0 =A0 (setq geiser-default-implementation 'guile)
>

I've got emacs trunk, GNU Guile 2.0.9, geiser from MELPA and I= 9;m
getting the results in a *Geiser dbg* window instead of org-mode when
I eval. =A0So the issue is either with ob-scheme or with my geiser,
which is the development version, but I don't see why it shouldn't<= br> work.

regards,
Oleh



--
--=A0

KDr2, http://kdr2.com
--001a1134aa0e87d10a04f6ac7b02-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleh Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Thu, 10 Apr 2014 12:54:16 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYCch-00082T-Am for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 06:54:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYCcb-0001QI-KA for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 06:54:23 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:45132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYCcb-0001Q3-DJ for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 06:54:17 -0400 Received: by mail-wi0-f169.google.com with SMTP id hm4so770257wib.4 for ; Thu, 10 Apr 2014 03:54:16 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: KDr2 Cc: emacs-orgmode@gnu.org Of course it works, that's the first thing I tried. The issue probably is that the implementation of geiser functions that ob-scheme uses has been changed. Oleh On Thu, Apr 10, 2014 at 11:02 AM, KDr2 wrote: > Does your "M-x run-geiser" work? It will lead you to a scheme REPL like > this: > > GNU Guile 2.0.9-deb+1-1 > Copyright (C) 1995-2013 Free Software Foundation, Inc. > > Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. > This program is free software, and you are welcome to redistribute it > under certain conditions; type `,show c' for details. > > Enter `,help' for help. > scheme@(guile-user)> 1 > $2 = 1 > scheme@(guile-user)> > > > > > On Thu, Apr 10, 2014 at 4:55 PM, Oleh wrote: >> >> > 0. I use Debian(sid) and Emacs 24 >> > 1. install guile (using apt): http://www.gnu.org/software/guile/ >> > 2. install geiser(http://www.nongnu.org/geiser/) with elpa >> > and setting for geiser: >> > >> > (setq geiser-active-implementations '(guile)) >> > (setq geiser-default-implementation 'guile) >> > >> >> I've got emacs trunk, GNU Guile 2.0.9, geiser from MELPA and I'm >> getting the results in a *Geiser dbg* window instead of org-mode when >> I eval. So the issue is either with ob-scheme or with my geiser, >> which is the development version, but I don't see why it shouldn't >> work. >> >> regards, >> Oleh > > > > > -- > -- > > KDr2, http://kdr2.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: KDr2 Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Thu, 10 Apr 2014 19:00:52 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2903ca3006f04f6ae22c4 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYCjK-0004S6-Sl for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 07:01:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYCjJ-0003cN-G1 for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 07:01:14 -0400 Received: from mail-ob0-x234.google.com ([2607:f8b0:4003:c01::234]:62793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYCjJ-0003c9-9Q for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 07:01:13 -0400 Received: by mail-ob0-f180.google.com with SMTP id wn1so4106887obc.25 for ; Thu, 10 Apr 2014 04:01:12 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Oleh Cc: emacs-orgmode@gnu.org --001a11c2903ca3006f04f6ae22c4 Content-Type: text/plain; charset=ISO-8859-1 Version of geiser I installed: geiser-20140326.951, If it has been changed, it must be changed in the past 2 weeks ... On Thu, Apr 10, 2014 at 6:54 PM, Oleh wrote: > Of course it works, that's the first thing I tried. > The issue probably is that the implementation of geiser functions that > ob-scheme uses has been changed. > > Oleh > > On Thu, Apr 10, 2014 at 11:02 AM, KDr2 wrote: > > Does your "M-x run-geiser" work? It will lead you to a scheme REPL like > > this: > > > > GNU Guile 2.0.9-deb+1-1 > > Copyright (C) 1995-2013 Free Software Foundation, Inc. > > > > Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. > > This program is free software, and you are welcome to redistribute it > > under certain conditions; type `,show c' for details. > > > > Enter `,help' for help. > > scheme@(guile-user)> 1 > > $2 = 1 > > scheme@(guile-user)> > > > > > > > > > > On Thu, Apr 10, 2014 at 4:55 PM, Oleh wrote: > >> > >> > 0. I use Debian(sid) and Emacs 24 > >> > 1. install guile (using apt): http://www.gnu.org/software/guile/ > >> > 2. install geiser(http://www.nongnu.org/geiser/) with elpa > >> > and setting for geiser: > >> > > >> > (setq geiser-active-implementations '(guile)) > >> > (setq geiser-default-implementation 'guile) > >> > > >> > >> I've got emacs trunk, GNU Guile 2.0.9, geiser from MELPA and I'm > >> getting the results in a *Geiser dbg* window instead of org-mode when > >> I eval. So the issue is either with ob-scheme or with my geiser, > >> which is the development version, but I don't see why it shouldn't > >> work. > >> > >> regards, > >> Oleh > > > > > > > > > > -- > > -- > > > > KDr2, http://kdr2.com > -- -- KDr2, http://kdr2.com --001a11c2903ca3006f04f6ae22c4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Version of =A0geiser I installed: geiser-20140326.951, If = it has been changed, it must be changed in the past 2 weeks ...


= On Thu, Apr 10, 2014 at 6:54 PM, Oleh <ohwoeowho@gmail.com> wrote:
Of course it works, that's the first thi= ng I tried.
The issue probably is that the implementation of geiser functions that
ob-scheme uses has been changed.

Oleh

On Thu, Apr 10, 2014 at 11:02 AM, KDr2 <killy.draw@gmail.com> wrote:
> Does your "M-x run-geiser" work? It will lead you to a schem= e REPL like
> this:
>
> GNU Guile 2.0.9-deb+1-1
> Copyright (C) 1995-2013 Free Software Foundation, Inc.
>
> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'= ;.
> This program is free software, and you are welcome to redistribute it<= br> > under certain conditions; type `,show c' for details.
>
> Enter `,help' for help.
> scheme@(guile-user)> 1
> $2 =3D 1
> scheme@(guile-user)>
>
>
>
>
> On Thu, Apr 10, 2014 at 4:55 PM, Oleh <ohwoeowho@gmail.com> wrote:
>>
>> > 0. I use Debian(sid) and Emacs 24
>> > 1. install guile (using apt): http://www.gnu.org/software/guile/ >> > 2. install geiser(http://www.nongnu.org/geiser/) with elpa
>> > =A0 =A0 and setting for geiser:
>> >
>> > =A0 =A0 (setq geiser-active-implementations '(guile))
>> > =A0 =A0 (setq geiser-default-implementation 'guile)
>> >
>>
>> I've got emacs trunk, GNU Guile 2.0.9, geiser from MELPA and I= 'm
>> getting the results in a *Geiser dbg* window instead of org-mode w= hen
>> I eval. =A0So the issue is either with ob-scheme or with my geiser= ,
>> which is the development version, but I don't see why it shoul= dn't
>> work.
>>
>> regards,
>> Oleh
>
>
>
>
> --
> --
>
> KDr2, http://kdr2.com



--
=
--001a11c2903ca3006f04f6ae22c4-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleh Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Thu, 10 Apr 2014 13:22:59 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYD4P-0002fm-In for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 07:23:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYD4O-0002hH-Ta for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 07:23:01 -0400 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:37342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYD4O-0002h8-Lx for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 07:23:00 -0400 Received: by mail-wi0-f172.google.com with SMTP id hi2so10472761wib.5 for ; Thu, 10 Apr 2014 04:22:59 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: KDr2 Cc: emacs-orgmode@gnu.org > Version of geiser I installed: geiser-20140326.951, If it has been changed, > it must be changed in the past 2 weeks ... > That's exactly the version that I have. Which org-mode are you using? From mboxrd@z Thu Jan 1 00:00:00 1970 From: KDr2 Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Thu, 10 Apr 2014 19:32:52 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e011764e9136f5004f6ae953b Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYDEI-00036h-SI for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 07:33:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYDEH-00063d-Eq for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 07:33:14 -0400 Received: from mail-ob0-x22e.google.com ([2607:f8b0:4003:c01::22e]:47171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYDEH-00063W-7W for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 07:33:13 -0400 Received: by mail-ob0-f174.google.com with SMTP id wo20so4202229obc.19 for ; Thu, 10 Apr 2014 04:33:12 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Oleh Cc: emacs-orgmode@gnu.org --089e011764e9136f5004f6ae953b Content-Type: text/plain; charset=ISO-8859-1 org-plus-contrib-20140407 And the file lisp/ob-scheme.el is the same as it in the master branch: And the error message before patched: Loading /home/kdr2/.emacs.d/init.el (source)... Loading /home/kdr2/.emacs.d/src/elisp/common.el (source)... Loading pde-load... Loading pde-loaddefs... ../.emacs.d/src/elisp/tools/init-ace-jump.el: `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'. Loading /home/kdr2/.emacs.d/src/elisp/misc.el (source)... Loading desktop... Loading /home/kdr2/.emacs.d/src/elisp/themes/wombat-custom.el (source)... Loading vline... Evaluate this scheme code block on your system? (y or n) y executing Scheme code block... Starting Geiser REPL for guile ... Package assoc is obsolete! Package complete is obsolete! Guile REPL up and running! => "Hello Scheme in OrgMode" Debugger entered--Lisp error: (wrong-type-argument arrayp nil) org-babel-scheme-execute-with-geiser("(display \"Hello Scheme in OrgMode\")" t guile nil) org-babel-execute:scheme("(display \"Hello Scheme in OrgMode\")" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "results") (:results . "raw output replace") (:colname-names) (:hlines . "no") (:result-params "replace" "output" "raw") (:result-type . output) (:rowname-names) (:session . "none"))) org-babel-execute-src-block(nil ("scheme" "(display \"Hello Scheme in OrgMode\")" ((:colname-names) (:rowname-names) (:result-params "replace" "out put" "raw" "replace" "output" "raw") (:result-type . output) (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangl e . "no") (:exports . "results") (:results . "replace output raw") (:session . "none") (:rowname-names) (:result-type . output) (:result-params "repl ace" "output" "raw") (:hlines . "no") (:colname-names)) "" nil 0 1)) org-babel-exp-results(("scheme" "(display \"Hello Scheme in OrgMode\")" ((:cache . "no") (:colname-names) (:comments . "") (:exports . "results") ( :hlines . "no") (:noweb . "no") (:padline . "") (:result-params "replace" "output" "raw") (:result-type . output) (:results . "replace output raw") ( :rowname-names) (:session . "none") (:shebang . "") (:tangle . "no")) "" nil 0 1) block nil "a01854650514fd2cec7ce6957a4622b52118fcd3") org-babel-exp-do-export(("scheme" "(display \"Hello Scheme in OrgMode\")" ((:cache . "no") (:colname-names) (:comments . "") (:exports . "results") (:hlines . "no") (:noweb . "no") (:padline . "") (:result-params "replace" "output" "raw") (:result-type . output) (:results . "replace output raw"$ (:rowname-names) (:session . "none") (:shebang . "") (:tangle . "no")) "" nil 0 1) block "a01854650514fd2cec7ce6957a4622b52118fcd3") org-babel-exp-src-block(("scheme" ":exports" "results" ":results" "output" "raw")) org-babel-exp-process-buffer() org-export-execute-babel-code() org-export-as(html nil nil nil nil) org-export-to-file(html "./test.html" nil nil nil nil nil) org-html-export-to-html() call-interactively(org-html-export-to-html nil nil) command-execute(org-html-export-to-html) command-line-1(("--eval=(load \"~/.emacs.d/init.el\")" "/home/kdr2/ test.org" "-f" "org-html-export-to-html")) command-line() normal-top-level() On Thu, Apr 10, 2014 at 7:22 PM, Oleh wrote: > > Version of geiser I installed: geiser-20140326.951, If it has been > changed, > > it must be changed in the past 2 weeks ... > > > > That's exactly the version that I have. > Which org-mode are you using? > -- -- KDr2, http://kdr2.com --089e011764e9136f5004f6ae953b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
org-plus-contrib-20140407

And the f= ile lisp/ob-scheme.el is the same as it in the master branch:
And the error message before patched:

Loading /home/kdr2/.emacs.d/init.el (source)...
Loading /hom= e/kdr2/.emacs.d/src/elisp/common.el (source)...
Loading pde-load.= ..
Loading pde-loaddefs...
../.emacs.d/src/elisp/tools/= init-ace-jump.el: `flet' is an obsolete macro (as of 24.3); use either = `cl-flet' or `cl-letf'.
Loading /home/kdr2/.emacs.d/src/elisp/misc.el (source)...
Lo= ading desktop...
Loading /home/kdr2/.emacs.d/src/elisp/themes/wom= bat-custom.el (source)...
Loading vline...
Evaluate thi= s scheme code block on your system? (y or n) y
executing Scheme code block...
Starting Geiser REPL for guil= e ...

Package assoc is obsolete!
Package= complete is obsolete!
Guile REPL up and running!
=3D> "Hello Scheme in OrgMode"
Debugger entered--Lis= p error: (wrong-type-argument arrayp nil)
=A0 org-babel-scheme-ex= ecute-with-geiser("(display \"Hello Scheme in OrgMode\")&quo= t; t guile nil)
=A0 org-babel-execute:scheme("(display \"Hello Scheme in Org= Mode\")" ((:comments . "") (:shebang . "") (:= cache . "no") (:padline . "") (:noweb . "no")= =A0
(:tangle . "no") (:exports . "results") (:results = . "raw output replace") (:colname-names) (:hlines . "no"= ;) (:result-params "replace" "output" "raw")<= /div>
=A0(:result-type . output) (:rowname-names) (:session . "none&quo= t;)))
=A0 org-babel-execute-src-block(nil ("scheme" &qu= ot;(display \"Hello Scheme in OrgMode\")" ((:colname-names) = (:rowname-names) (:result-params "replace" "out
put" "raw" "replace" "output" "= ;raw") (:result-type . output) (:comments . "") (:shebang . = "") (:cache . "no") (:padline . "") (:noweb .= "no") (:tangl
e . "no") (:exports . "results") (:results . "= ;replace output raw") (:session . "none") (:rowname-names) (= :result-type . output) (:result-params "repl
ace" "= ;output" "raw") (:hlines . "no") (:colname-names))= "" nil 0 1))
=A0 org-babel-exp-results(("scheme" "(display \"He= llo Scheme in OrgMode\")" ((:cache . "no") (:colname-na= mes) (:comments . "") (:exports . "results") (
:hlines . "no") (:noweb . "no") (:padline . ""= ;) (:result-params "replace" "output" "raw") = (:result-type . output) (:results . "replace output raw") (
:rowname-names) (:session . "none") (:shebang . ""= ) (:tangle . "no")) "" nil 0 1) block nil "a018546= 50514fd2cec7ce6957a4622b52118fcd3")
=A0 org-babel-exp-do-exp= ort(("scheme" "(display \"Hello Scheme in OrgMode\"= ;)" ((:cache . "no") (:colname-names) (:comments . "&qu= ot;) (:exports . "results") (:hlines . "no") (:noweb . = "no") (:padline . "") (:result-params "replace&quo= t; "output" "raw") (:result-type . output) (:results . = "replace output raw"$ (:rowname-names) (:session . "none&quo= t;) (:shebang . "") (:tangle . "no")) "" nil = 0 1) block "a01854650514fd2cec7ce6957a4622b52118fcd3")
=A0 org-babel-exp-src-block(("scheme" ":exports" &= quot;results" ":results" "output" "raw")= )
=A0 org-babel-exp-process-buffer()
=A0 org-export-exe= cute-babel-code()
=A0 org-export-as(html nil nil nil nil)
=A0 org-export-to-fi= le(html "./test.html" nil nil nil nil nil)
=A0 org-html= -export-to-html()
=A0 call-interactively(org-html-export-to-html = nil nil)
=A0 command-execute(org-html-export-to-html)
=A0 command-lin= e-1(("--eval=3D(load \"~/.emacs.d/init.el\")" "/ho= me/kdr2/test.org" "-f" "= ;org-html-export-to-html"))
=A0 command-line()
=A0 normal-top-level()
<= div>


On Thu, Apr 10, 2014 at 7:22 PM, Oleh <ohwoeowho@gmail.com&g= t; wrote:
> Version of =A0geiser I = installed: geiser-20140326.951, If it has been changed,
> it must be changed in the past 2 weeks ...
>

That's exactly the version that I have.
Which org-mode are you using?



--
--=A0

KDr2, http://kdr2.com
--089e011764e9136f5004f6ae953b-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Thu, 10 Apr 2014 20:45:47 -0600 Message-ID: <87sipky46c.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYRTe-0006wN-Bt for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 22:46:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYRTY-0001Bf-6S for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 22:46:02 -0400 Received: from mail-ie0-x233.google.com ([2607:f8b0:4001:c03::233]:61620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYRTY-0001Ba-1g for emacs-orgmode@gnu.org; Thu, 10 Apr 2014 22:45:56 -0400 Received: by mail-ie0-f179.google.com with SMTP id lx4so4847495iec.38 for ; Thu, 10 Apr 2014 19:45:55 -0700 (PDT) In-Reply-To: (KDr2's message of "Wed, 2 Apr 2014 11:48:11 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: KDr2 Cc: emacs-orgmode@gnu.org We can no longer use `flet' in the Org-mode code base, please re-work this patch w/o flet. Also, I don't see your name in the list of contributors, and (I believe) this patch is too large to apply w/o FSF assignment. See the following page on how to contribute to Org-mode. http://orgmode.org/worg/org-contribute.html KDr2 writes: > The bug: > write file ~/scheme-test.org with the content below: > -------8<-------------- > #+BEGIN_SRC scheme :exports results :results output raw > (display "Hello Scheme in OrgMode") > #+END_SRC > -------8<-------------- > > and run: > > emacs --batch --eval='(load "~/.emacs.d/init.el")' ~/scheme-test.org -f > org-html-export-to-html > > you will find the bug: > > `org-babel-scheme-execute-with-geiser' uses `current-message' to get the > results of scheme code blocks, but `current-message' always returns nil in > batch mode, and this patch fixes this. > > -- -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D From mboxrd@z Thu Jan 1 00:00:00 1970 From: KDr2 Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Fri, 11 Apr 2014 13:18:49 +0800 Message-ID: References: <87sipky46c.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a11c256e634696e04f6bd790f Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYTrw-0004xT-1Q for emacs-orgmode@gnu.org; Fri, 11 Apr 2014 01:19:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYTrq-0003o3-LC for emacs-orgmode@gnu.org; Fri, 11 Apr 2014 01:19:15 -0400 Received: from mail-ob0-x229.google.com ([2607:f8b0:4003:c01::229]:48411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYTrq-0003nx-D5 for emacs-orgmode@gnu.org; Fri, 11 Apr 2014 01:19:10 -0400 Received: by mail-ob0-f169.google.com with SMTP id va2so5568147obc.28 for ; Thu, 10 Apr 2014 22:19:09 -0700 (PDT) In-Reply-To: <87sipky46c.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org --001a11c256e634696e04f6bd790f Content-Type: multipart/alternative; boundary=001a11c256e634696904f6bd790d --001a11c256e634696904f6bd790d Content-Type: text/plain; charset=ISO-8859-1 Hi, Eric I'm sorry for that I used `flet' in the patch, It's a easy way to let function `current-message' work in batch mode, so I used it even I saw that emacs says `flet' is obsolete, I'm sorry for that. And I made a new patch(attachment) using `defadvice' for `message' to capture the message in batch mode, after the message being captured, the advice function is removed. Is this way OK? And I also sent a request email to assign@gnu.org, and now waiting the reply. Thanks. On Fri, Apr 11, 2014 at 10:45 AM, Eric Schulte wrote: > We can no longer use `flet' in the Org-mode code base, please re-work > this patch w/o flet. > > Also, I don't see your name in the list of contributors, and (I believe) > this patch is too large to apply w/o FSF assignment. See the following > page on how to contribute to Org-mode. > > http://orgmode.org/worg/org-contribute.html > > KDr2 writes: > > > The bug: > > write file ~/scheme-test.org with the content below: > > -------8<-------------- > > #+BEGIN_SRC scheme :exports results :results output raw > > (display "Hello Scheme in OrgMode") > > #+END_SRC > > -------8<-------------- > > > > and run: > > > > emacs --batch --eval='(load "~/.emacs.d/init.el")' ~/scheme-test.org -f > > org-html-export-to-html > > > > you will find the bug: > > > > `org-babel-scheme-execute-with-geiser' uses `current-message' to get the > > results of scheme code blocks, but `current-message' always returns nil > in > > batch mode, and this patch fixes this. > > > > -- > > -- > Eric Schulte > https://cs.unm.edu/~eschulte > PGP: 0x614CA05D > -- -- KDr2, http://kdr2.com --001a11c256e634696904f6bd790d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi, Eric

I'm sorry for that I used = `flet' in the patch, It's a easy way to let function `current-messa= ge' work in batch mode, so I used it even I saw that emacs says `flet&#= 39; is obsolete, I'm sorry for that.=A0

And I made a new patch(attachment) using `defadvice'= ; for `message' to capture the message in batch mode, after the message= being captured, the advice function is removed. Is this way OK?

And I also sent a request email=A0to assig= n@gnu.org, and now waiting the reply.

Tha= nks.


On Fri, Apr 11, 2014 at 10:45 AM, Eric Schulte = <schulte.eri= c@gmail.com> wrote:
We can no longer use `flet' in the Org-m= ode code base, please re-work
this patch w/o flet.

Also, I don't see your name in the list of contributors, and (I believe= )
this patch is too large to apply w/o FSF assignment. =A0See the following page on how to contribute to Org-mode.

=A0 http://orgmode.org/worg/org-contribute.html

KDr2 <killy.draw@gmail.com&g= t; writes:

> The bug:
> write file ~/sche= me-test.org with the content below:
> -------8<--------------
> #+BEGIN_SRC scheme :exports results :results output raw
> =A0 (display "Hello Scheme in OrgMode")
> #+END_SRC
> -------8<--------------
>
> and run:
>
> emacs --batch --eval=3D'(load "~/.emacs.d/init.el")'= ~/scheme-test.org= -f
> org-html-export-to-html
>
> you will find the bug:
>
> `org-babel-scheme-execute-with-geiser' uses `current-message' = to get the
> results of scheme code blocks, but `current-message' always return= s nil in
> batch mode, and this patch fixes this.
>
> --

--
Eric Schulte
https://cs.unm.e= du/~eschulte
PGP: 0x614CA05D



--
--=A0
--001a11c256e634696904f6bd790d-- --001a11c256e634696e04f6bd790f Content-Type: text/x-patch; charset=US-ASCII; name="0001-lisp-ob-scheme.el-Fix-scheme-code-blocks-execution-e.patch" Content-Disposition: attachment; filename="0001-lisp-ob-scheme.el-Fix-scheme-code-blocks-execution-e.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_htv0v7wj0 RnJvbSBmZTU1NDlmM2Y0OGFjZjliNTFhZWIzNzA2ZWI4ZGQzZDc2YWIxOGMxIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBLRHIyIDxraWxseS5kcmF3QGdtYWlsLmNvbT4KRGF0ZTogRnJp LCAxMSBBcHIgMjAxNCAxMjo1NjoyNCArMDgwMApTdWJqZWN0OiBbUEFUQ0hdIGxpc3Avb2Itc2No ZW1lLmVsOiBGaXggc2NoZW1lIGNvZGUgYmxvY2tzIGV4ZWN1dGlvbiBlcnJvciBpbgogYmF0Y2gg bW9kZQoKKiBsaXNwL29iLXNjaGVtZS5lbCAob3JnLWJhYmVsLXNjaGVtZS1jYXB0dXJlLWN1cnJl bnQtbWVzc2FnZSwgb3JnLWJhYmVsLXNjaGVtZS1leGVjdXRlLXdpdGgtZ2Vpc2VyKTogQ2FwdHVy ZSBzY2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W1lc3NhZ2UKKwkJICAgICAgKGdlaXNlci1ldmFsLXJlZ2lvbiAocG9pbnQtbWlu KSAocG9pbnQtbWF4KSkpKQogCShzZXRxIHJlc3VsdAotCSAgICAgIChpZiAoZXF1YWwgKHN1YnN0 cmluZyAoY3VycmVudC1tZXNzYWdlKSAwIDMpICI9PiAiKQotCQkgIChyZXBsYWNlLXJlZ2V4cC1p bi1zdHJpbmcgIl49PiAiICIiIChjdXJyZW50LW1lc3NhZ2UpKQorCSAgICAgIChpZiAoYW5kIChz dHJpbmdwIHJlc3VsdCkgKGVxdWFsIChzdWJzdHJpbmcgcmVzdWx0IDAgMykgIj0+ICIpKQorCQkg IChyZXBsYWNlLXJlZ2V4cC1pbi1zdHJpbmcgIl49PiAiICIiIHJlc3VsdCkKIAkJIlwiQW4gZXJy b3Igb2NjdXJyZWQuXCIiKSkKIAkod2hlbiAobm90IHJlcGwpCiAJICAoc2F2ZS1jdXJyZW50LWJ1 ZmZlciAoc2V0LWJ1ZmZlciByZXBsLWJ1ZmZlcikKLS0gCjEuOS4yCgo= --001a11c256e634696e04f6bd790f-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Fri, 11 Apr 2014 13:18:22 -0600 Message-ID: <87tx9zk5ln.fsf@gmail.com> References: <87sipky46c.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYhTm-0007bp-JB for emacs-orgmode@gnu.org; Fri, 11 Apr 2014 15:51:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYhTi-000778-An for emacs-orgmode@gnu.org; Fri, 11 Apr 2014 15:51:14 -0400 Received: from mail-pb0-x22b.google.com ([2607:f8b0:400e:c01::22b]:64752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYhTh-000771-VK for emacs-orgmode@gnu.org; Fri, 11 Apr 2014 15:51:10 -0400 Received: by mail-pb0-f43.google.com with SMTP id um1so5836135pbc.2 for ; Fri, 11 Apr 2014 12:51:08 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: KDr2 Cc: emacs-orgmode@gnu.org Hmmm, Not to be overly nitpicky here, but I see two issues. 1. You should use unwind-protect, to ensure that (ad-unadvise #'message) is run even if @body throws an error, and 2. This will remove any advise which the user has placed on #'message. How about something shaped like the following. (defmacro with-weird-message (&rest body) `(let ((hold #'message) current-message) (unwind-protect (progn (defun message (&rest args) (setq current-message (apply #'format args))) ,@body current-message) (setq message hold)))) Best, P.S. I know this is a lot of process for a small patch, but from this point forward once you have the FSF assignment you can much more easily contribute to ob-scheme and org in general KDr2 writes: > Hi, Eric > > I'm sorry for that I used `flet' in the patch, It's a easy way to let > function `current-message' work in batch mode, so I used it even I saw that > emacs says `flet' is obsolete, I'm sorry for that. > > And I made a new patch(attachment) using `defadvice' for `message' to > capture the message in batch mode, after the message being captured, the > advice function is removed. Is this way OK? > > And I also sent a request email to assign@gnu.org, and now waiting the > reply. > > Thanks. > > > On Fri, Apr 11, 2014 at 10:45 AM, Eric Schulte wrote: > >> We can no longer use `flet' in the Org-mode code base, please re-work >> this patch w/o flet. >> >> Also, I don't see your name in the list of contributors, and (I believe) >> this patch is too large to apply w/o FSF assignment. See the following >> page on how to contribute to Org-mode. >> >> http://orgmode.org/worg/org-contribute.html >> >> KDr2 writes: >> >> > The bug: >> > write file ~/scheme-test.org with the content below: >> > -------8<-------------- >> > #+BEGIN_SRC scheme :exports results :results output raw >> > (display "Hello Scheme in OrgMode") >> > #+END_SRC >> > -------8<-------------- >> > >> > and run: >> > >> > emacs --batch --eval='(load "~/.emacs.d/init.el")' ~/scheme-test.org -f >> > org-html-export-to-html >> > >> > you will find the bug: >> > >> > `org-babel-scheme-execute-with-geiser' uses `current-message' to get the >> > results of scheme code blocks, but `current-message' always returns nil >> in >> > batch mode, and this patch fixes this. >> > >> > -- >> >> -- >> Eric Schulte >> https://cs.unm.edu/~eschulte >> PGP: 0x614CA05D >> > > > > -- > -- > > KDr2, http://kdr2.com > > From fe5549f3f48acf9b51aeb3706eb8dd3d76ab18c1 Mon Sep 17 00:00:00 2001 > From: KDr2 > Date: Fri, 11 Apr 2014 12:56:24 +0800 > Subject: [PATCH] lisp/ob-scheme.el: Fix scheme code blocks execution error in > batch mode > > * lisp/ob-scheme.el (org-babel-scheme-capture-current-message, org-babel-scheme-execute-with-geiser): Capture scheme code results via current-message both in interactive mode and noninteractive mode. > > `org-babel-scheme-execute-with-geiser' uses `current-message' to get the results of scheme code blocks, but `current-message' always returns nil in batch mode, and this patch fixes this. > > Modified from a patch proposal by KDr2(killy.draw@gmail.com) > --- > lisp/ob-scheme.el | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) > > diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el > index b7117e9..6b82c6e 100644 > --- a/lisp/ob-scheme.el > +++ b/lisp/ob-scheme.el > @@ -118,6 +118,19 @@ org-babel-scheme-execute-with-geiser will use a temporary session." > (name)))) > result)) > > +(defmacro org-babel-scheme-capture-current-message (&rest body) > + "Capture current message in both interactive and noninteractive mode" > + `(if noninteractive > + (let ((current-message nil)) > + (defadvice message (after capture-current-message activate) > + (setq current-message ad-return-value)) > + ,@body > + (ad-unadvise #'message) > + current-message) > + (progn > + ,@body > + (current-message)))) > + > (defun org-babel-scheme-execute-with-geiser (code output impl repl) > "Execute code in specified REPL. If the REPL doesn't exist, create it > using the given scheme implementation. > @@ -142,10 +155,11 @@ is true; otherwise returns the last value." > (current-buffer))))) > (setq geiser-repl--repl repl-buffer) > (setq geiser-impl--implementation nil) > - (geiser-eval-region (point-min) (point-max)) > + (setq result (org-babel-scheme-capture-current-message > + (geiser-eval-region (point-min) (point-max)))) > (setq result > - (if (equal (substring (current-message) 0 3) "=> ") > - (replace-regexp-in-string "^=> " "" (current-message)) > + (if (and (stringp result) (equal (substring result 0 3) "=> ")) > + (replace-regexp-in-string "^=> " "" result) > "\"An error occurred.\"")) > (when (not repl) > (save-current-buffer (set-buffer repl-buffer) -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D From mboxrd@z Thu Jan 1 00:00:00 1970 From: KDr2 Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Sat, 12 Apr 2014 16:13:25 +0800 Message-ID: References: <87sipky46c.fsf@gmail.com> <87tx9zk5ln.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a11c2b8b277557104f6d407f2 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYt4P-0007Yo-AZ for emacs-orgmode@gnu.org; Sat, 12 Apr 2014 04:13:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYt4M-0000TE-SY for emacs-orgmode@gnu.org; Sat, 12 Apr 2014 04:13:49 -0400 Received: from mail-oa0-x22e.google.com ([2607:f8b0:4003:c02::22e]:65133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYt4M-0000T8-HR for emacs-orgmode@gnu.org; Sat, 12 Apr 2014 04:13:46 -0400 Received: by mail-oa0-f46.google.com with SMTP id i7so7222195oag.19 for ; Sat, 12 Apr 2014 01:13:45 -0700 (PDT) In-Reply-To: <87tx9zk5ln.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org --001a11c2b8b277557104f6d407f2 Content-Type: multipart/alternative; boundary=001a11c2b8b277556c04f6d407f0 --001a11c2b8b277556c04f6d407f0 Content-Type: text/plain; charset=ISO-8859-1 HI, Eric You are right, I remove the usage of advice now, and use the method you (nearly) gave, only 1 little change: I found the code: ---- (defun t1 () (message "abc")) ;;(symbol-function 't1) (let ((hold #'t1)) (defun t1 () (message "def")) (setq t1 hold)) ;;(symbol-function 't1) ---- did recover the t1 function after it executed, so I use this way: ---- (defun t1 () (message "abc")) ;;(symbol-function 't1) (let ((hold (symbol-function 't1))) (defun t1 () (message "def")) (fset 't1 hold)) ;;(symbol-function 't1) ---- And the new patch is attached. BTW: I received a PDF assignment form from FSF, but the developer name and the target program on it were wrong (It's for another person who contributes to GCC, I think), so I reply that mail for a new PDF assignment form, I 'll tell you after these things done. Thanks. On Sat, Apr 12, 2014 at 3:18 AM, Eric Schulte wrote: > Hmmm, > > Not to be overly nitpicky here, but I see two issues. > > 1. You should use unwind-protect, to ensure that (ad-unadvise #'message) > is run even if @body throws an error, and > > 2. This will remove any advise which the user has placed on #'message. > > How about something shaped like the following. > > (defmacro with-weird-message (&rest body) > `(let ((hold #'message) > current-message) > (unwind-protect > (progn > (defun message (&rest args) > (setq current-message (apply #'format args))) > ,@body > current-message) > (setq message hold)))) > > Best, > > P.S. I know this is a lot of process for a small patch, but from this > point forward once you have the FSF assignment you can much more > easily contribute to ob-scheme and org in general > > KDr2 writes: > > > Hi, Eric > > > > I'm sorry for that I used `flet' in the patch, It's a easy way to let > > function `current-message' work in batch mode, so I used it even I saw > that > > emacs says `flet' is obsolete, I'm sorry for that. > > > > And I made a new patch(attachment) using `defadvice' for `message' to > > capture the message in batch mode, after the message being captured, the > > advice function is removed. Is this way OK? > > > > And I also sent a request email to assign@gnu.org, and now waiting the > > reply. > > > > Thanks. > > > > > > On Fri, Apr 11, 2014 at 10:45 AM, Eric Schulte >wrote: > > > >> We can no longer use `flet' in the Org-mode code base, please re-work > >> this patch w/o flet. > >> > >> Also, I don't see your name in the list of contributors, and (I believe) > >> this patch is too large to apply w/o FSF assignment. See the following > >> page on how to contribute to Org-mode. > >> > >> http://orgmode.org/worg/org-contribute.html > >> > >> KDr2 writes: > >> > >> > The bug: > >> > write file ~/scheme-test.org with the content below: > >> > -------8<-------------- > >> > #+BEGIN_SRC scheme :exports results :results output raw > >> > (display "Hello Scheme in OrgMode") > >> > #+END_SRC > >> > -------8<-------------- > >> > > >> > and run: > >> > > >> > emacs --batch --eval='(load "~/.emacs.d/init.el")' ~/scheme-test.org-f > >> > org-html-export-to-html > >> > > >> > you will find the bug: > >> > > >> > `org-babel-scheme-execute-with-geiser' uses `current-message' to get > the > >> > results of scheme code blocks, but `current-message' always returns > nil > >> in > >> > batch mode, and this patch fixes this. > >> > > >> > -- > >> > >> -- > >> Eric Schulte > >> https://cs.unm.edu/~eschulte > >> PGP: 0x614CA05D > >> > > > > > > > > -- > > -- > > > > KDr2, http://kdr2.com > > > > From fe5549f3f48acf9b51aeb3706eb8dd3d76ab18c1 Mon Sep 17 00:00:00 2001 > > From: KDr2 > > Date: Fri, 11 Apr 2014 12:56:24 +0800 > > Subject: [PATCH] lisp/ob-scheme.el: Fix scheme code blocks execution > error in > > batch mode > > > > * lisp/ob-scheme.el (org-babel-scheme-capture-current-message, > org-babel-scheme-execute-with-geiser): Capture scheme code results via > current-message both in interactive mode and noninteractive mode. > > > > `org-babel-scheme-execute-with-geiser' uses `current-message' to get the > results of scheme code blocks, but `current-message' always returns nil in > batch mode, and this patch fixes this. > > > > Modified from a patch proposal by KDr2(killy.draw@gmail.com) > > --- > > lisp/ob-scheme.el | 20 +++++++++++++++++--- > > 1 file changed, 17 insertions(+), 3 deletions(-) > > > > diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el > > index b7117e9..6b82c6e 100644 > > --- a/lisp/ob-scheme.el > > +++ b/lisp/ob-scheme.el > > @@ -118,6 +118,19 @@ org-babel-scheme-execute-with-geiser will use a > temporary session." > > (name)))) > > result)) > > > > +(defmacro org-babel-scheme-capture-current-message (&rest body) > > + "Capture current message in both interactive and noninteractive mode" > > + `(if noninteractive > > + (let ((current-message nil)) > > + (defadvice message (after capture-current-message activate) > > + (setq current-message ad-return-value)) > > + ,@body > > + (ad-unadvise #'message) > > + current-message) > > + (progn > > + ,@body > > + (current-message)))) > > + > > (defun org-babel-scheme-execute-with-geiser (code output impl repl) > > "Execute code in specified REPL. If the REPL doesn't exist, create it > > using the given scheme implementation. > > @@ -142,10 +155,11 @@ is true; otherwise returns the last value." > > (current-buffer))))) > > (setq geiser-repl--repl repl-buffer) > > (setq geiser-impl--implementation nil) > > - (geiser-eval-region (point-min) (point-max)) > > + (setq result (org-babel-scheme-capture-current-message > > + (geiser-eval-region (point-min) (point-max)))) > > (setq result > > - (if (equal (substring (current-message) 0 3) "=> ") > > - (replace-regexp-in-string "^=> " "" (current-message)) > > + (if (and (stringp result) (equal (substring result 0 3) "=> > ")) > > + (replace-regexp-in-string "^=> " "" result) > > "\"An error occurred.\"")) > > (when (not repl) > > (save-current-buffer (set-buffer repl-buffer) > > -- > Eric Schulte > https://cs.unm.edu/~eschulte > PGP: 0x614CA05D > -- -- KDr2, http://kdr2.com --001a11c2b8b277556c04f6d407f0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
HI, Eric

You are right, I remove the us= age of advice now, and use the method you (nearly) gave, only 1 little chan= ge:
I found the code:
----
(defun t1 () = (message "abc"))
;;(symbol-function 't1)

(let ((hold #'= ;t1))
=A0 (defun t1 () (message "def"))
=A0 (= setq t1 hold))
;;(symbol-function 't1)
--= --

did recover the t1 function after it executed, so I use= this way:
----
(defun t1 () (message "abc&qu= ot;))
;;(symbol-function 't1)

(let (= (hold (symbol-function 't1)))
=A0 (defun t1 () (message "def"))
=A0 (fset 't= 1 hold))

;;(symbol-function 't1)
----

And the new patch is attached.

BTW: I received a PDF=A0assignment form from FSF, but the developer name and th= e target program on it were wrong (It's for another person who contribu= tes to GCC, I think), so I reply that mail for a new=A0PDF=A0assignment form, I = 9;ll tell you after these things done.

Tha= nks.


On Sat, Apr 12, 2014 at 3:18 AM, Eric Schulte <schulte.eric@gmail.com= > wrote:
Hmmm,

Not to be overly nitpicky here, but I see two issues.

1. You should use unwind-protect, to ensure that (ad-unadvise #'message= )
=A0 =A0is run even if @body throws an error, and

2. This will remove any advise which the user has placed on #'message.<= br>
How about something shaped like the following.

=A0 =A0 (defmacro with-weird-message (&rest body)
=A0 =A0 =A0 `(let ((hold #'message)
=A0 =A0 =A0 =A0 =A0 =A0 =A0current-message)
=A0 =A0 =A0 =A0 =A0(unwind-protect
=A0 =A0 =A0 =A0 =A0 =A0 =A0(progn
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(defun message (&rest args)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(setq current-message (apply #'forma= t args)))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0,@body
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0current-message)
=A0 =A0 =A0 =A0 =A0 =A0(setq message hold))))

Best,

P.S. I know this is a lot of process for a small patch, but from this
=A0 =A0 =A0point forward once you have the FSF assignment you can much more=
=A0 =A0 =A0easily contribute to ob-scheme and org in general

KDr2 <killy.draw@gmail.com&g= t; writes:

> Hi, Eric
>
> I'm sorry for that I used `flet' in the patch, It's a easy= way to let
> function `current-message' work in batch mode, so I used it even I= saw that
> emacs says `flet' is obsolete, I'm sorry for that.
>
> And I made a new patch(attachment) using `defadvice' for `message&= #39; to
> capture the message in batch mode, after the message being captured, t= he
> advice function is removed. Is this way OK?
>
> And I also sent a request email to a= ssign@gnu.org, and now waiting the
> reply.
>
> Thanks.
>
>
> On Fri, Apr 11, 2014 at 10:45 AM, Eric Schulte <schulte.eric@gmail.com>wrote:
>
>> We can no longer use `flet' in the Org-mode code base, please = re-work
>> this patch w/o flet.
>>
>> Also, I don't see your name in the list of contributors, and (= I believe)
>> this patch is too large to apply w/o FSF assignment. =A0See the fo= llowing
>> page on how to contribute to Org-mode.
>>
>> =A0 http://orgmode.org/worg/org-contribute.html
>>
>> KDr2 <killy.draw@gmail.= com> writes:
>>
>> > The bug:
>> > write file ~/scheme-test.org with the content below:
>> > -------8<--------------
>> > #+BEGIN_SRC scheme :exports results :results output raw
>> > =A0 (display "Hello Scheme in OrgMode")
>> > #+END_SRC
>> > -------8<--------------
>> >
>> > and run:
>> >
>> > emacs --batch --eval=3D'(load "~/.emacs.d/init.el&qu= ot;)' ~/scheme-tes= t.org -f
>> > org-html-export-to-html
>> >
>> > you will find the bug:
>> >
>> > `org-babel-scheme-execute-with-geiser' uses `current-mess= age' to get the
>> > results of scheme code blocks, but `current-message' alwa= ys returns nil
>> in
>> > batch mode, and this patch fixes this.
>> >
>> > --
>>
>> --
>> Eric Schulte
>> https:/= /cs.unm.edu/~eschulte
>> PGP: 0x614CA05D
>>
>
>
>
> --
> --
>
> KDr2, http://kdr2.com
>
> From fe5549f3f48acf9b51aeb3706eb8dd3d76ab18c1 Mon Sep 17 0= 0:00:00 2001
> From: KDr2 <
killy.draw@gmai= l.com>
> Date: Fri, 11 Apr 2014 12:56:24 +0800
> Subject: [PATCH] lisp/ob-scheme.el: Fix scheme code blocks execution e= rror in
> =A0batch mode
>
> * lisp/ob-scheme.el (org-babel-scheme-capture-current-message, org-bab= el-scheme-execute-with-geiser): Capture scheme code results via current-mes= sage both in interactive mode and noninteractive mode.
>
> `org-babel-scheme-execute-with-geiser' uses `current-message' = to get the results of scheme code blocks, but `current-message' always = returns nil in batch mode, and this patch fixes this.
>
> Modified from a patch proposal by KDr2(killy.draw@gmail.com)
> ---
> =A0lisp/ob-scheme.el | 20 +++++++++++++++++---
> =A01 file changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el
> index b7117e9..6b82c6e 100644
> --- a/lisp/ob-scheme.el
> +++ b/lisp/ob-scheme.el
> @@ -118,6 +118,19 @@ org-babel-scheme-execute-with-geiser will use a t= emporary session."
> =A0 =A0 =A0 =A0 =A0 =A0 =A0(name))))
> =A0 =A0 =A0result))
>
> +(defmacro org-babel-scheme-capture-current-message (&rest body) > + =A0"Capture current message in both interactive and noninteract= ive mode"
> + =A0`(if noninteractive
> + =A0 =A0 =A0 (let ((current-message nil))
> + =A0 =A0 =A0 =A0 (defadvice message (after capture-current-message ac= tivate)
> + =A0 =A0 =A0 =A0 =A0 (setq current-message ad-return-value))
> + =A0 =A0 =A0 =A0 ,@body
> + =A0 =A0 =A0 =A0 (ad-unadvise #'message)
> + =A0 =A0 =A0 =A0 current-message)
> + =A0 =A0 (progn
> + =A0 =A0 =A0 ,@body
> + =A0 =A0 =A0 (current-message))))
> +
> =A0(defun org-babel-scheme-execute-with-geiser (code output impl repl)=
> =A0 =A0"Execute code in specified REPL. If the REPL doesn't e= xist, create it
> =A0using the given scheme implementation.
> @@ -142,10 +155,11 @@ is true; otherwise returns the last value."=
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(current-buffer= )))))
> =A0 =A0 =A0 (setq geiser-repl--repl repl-buffer)
> =A0 =A0 =A0 (setq geiser-impl--implementation nil)
> - =A0 =A0 (geiser-eval-region (point-min) (point-max))
> + =A0 =A0 (setq result (org-babel-scheme-capture-current-message
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (geiser-eval-region (point-min) = (point-max))))
> =A0 =A0 =A0 (setq result
> - =A0 =A0 =A0 =A0 =A0 (if (equal (substring (current-message) 0 3) &qu= ot;=3D> ")
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 (replace-regexp-in-string "^=3D>= " "" (current-message))
> + =A0 =A0 =A0 =A0 =A0 (if (and (stringp result) (equal (substring resu= lt 0 3) "=3D> "))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 (replace-regexp-in-string "^=3D>= " "" result)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 "\"An error occurred.\"&quo= t;))
> =A0 =A0 =A0 (when (not repl)
> =A0 =A0 =A0 =A0 (save-current-buffer (set-buffer repl-buffer)

--
Eric Schulte
https://cs.unm.e= du/~eschulte
PGP: 0x614CA05D



--
=
--=A0
--001a11c2b8b277556c04f6d407f0-- --001a11c2b8b277557104f6d407f2 Content-Type: text/x-patch; charset=US-ASCII; name="0001-lisp-ob-scheme.el-Fix-scheme-code-blocks-execution-e.patch" Content-Disposition: attachment; filename="0001-lisp-ob-scheme.el-Fix-scheme-code-blocks-execution-e.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_htwmgmev0 RnJvbSBmMjA5NDllMTgzMTQ5NzdiZmEzYzJlYzFhNTlmYjFlN2IzMjY5Y2JkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBLRHIyIDxraWxseS5kcmF3QGdtYWlsLmNvbT4KRGF0ZTogU2F0 LCAxMiBBcHIgMjAxNCAxNTo1OTozNyArMDgwMApTdWJqZWN0OiBbUEFUQ0hdIGxpc3Avb2Itc2No ZW1lLmVsOiBGaXggc2NoZW1lIGNvZGUgYmxvY2tzIGV4ZWN1dGlvbiBlcnJvciBpbgogYmF0Y2gg bW9kZQoKKiBsaXNwL29iLXNjaGVtZS5lbCAob3JnLWJhYmVsLXNjaGVtZS1jYXB0dXJlLWN1cnJl bnQtbWVzc2FnZSwgb3JnLWJhYmVsLXNjaGVtZS1leGVjdXRlLXdpdGgtZ2Vpc2VyKTogQ2FwdHVy ZSBzY2hlbWUgY29kZSByZXN1bHRzIHZpYSBjdXJyZW50LW1lc3NhZ2UgYm90aCBpbiBpbnRlcmFj dGl2ZSBtb2RlIGFuZCBub25pbnRlcmFjdGl2ZSBtb2RlLgoKYG9yZy1iYWJlbC1zY2hlbWUtZXhl Y3V0ZS13aXRoLWdlaXNlcicgdXNlcyBgY3VycmVudC1tZXNzYWdlJyB0byBnZXQgdGhlIHJlc3Vs dHMgb2Ygc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YWdlKSAwIDMpICI9PiAiKQotCQkgIChyZXBs YWNlLXJlZ2V4cC1pbi1zdHJpbmcgIl49PiAiICIiIChjdXJyZW50LW1lc3NhZ2UpKQorCSAgICAg IChpZiAoYW5kIChzdHJpbmdwIHJlc3VsdCkgKGVxdWFsIChzdWJzdHJpbmcgcmVzdWx0IDAgMykg Ij0+ICIpKQorCQkgIChyZXBsYWNlLXJlZ2V4cC1pbi1zdHJpbmcgIl49PiAiICIiIHJlc3VsdCkK IAkJIlwiQW4gZXJyb3Igb2NjdXJyZWQuXCIiKSkKIAkod2hlbiAobm90IHJlcGwpCiAJICAoc2F2 ZS1jdXJyZW50LWJ1ZmZlciAoc2V0LWJ1ZmZlciByZXBsLWJ1ZmZlcikKLS0gCjEuOS4yCgo= --001a11c2b8b277557104f6d407f2-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Sat, 12 Apr 2014 08:12:45 -0600 Message-ID: <87d2gmiqle.fsf@gmail.com> References: <87sipky46c.fsf@gmail.com> <87tx9zk5ln.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYyum-0000ip-IZ for emacs-orgmode@gnu.org; Sat, 12 Apr 2014 10:28:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYyg1-0003Ox-Ho for emacs-orgmode@gnu.org; Sat, 12 Apr 2014 10:13:05 -0400 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]:51185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYyg1-0003Ot-5b for emacs-orgmode@gnu.org; Sat, 12 Apr 2014 10:13:01 -0400 Received: by mail-pa0-f51.google.com with SMTP id kq14so6532050pab.38 for ; Sat, 12 Apr 2014 07:12:59 -0700 (PDT) In-Reply-To: (KDr2's message of "Sat, 12 Apr 2014 16:13:25 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: KDr2 Cc: emacs-orgmode@gnu.org KDr2 writes: > HI, Eric > > You are right, I remove the usage of advice now, and use the method you > (nearly) gave, only 1 little change: > I found the code: > ---- > (defun t1 () (message "abc")) > ;;(symbol-function 't1) > > (let ((hold #'t1)) > (defun t1 () (message "def")) > (setq t1 hold)) > ;;(symbol-function 't1) > ---- > > did recover the t1 function after it executed, so I use this way: > ---- > (defun t1 () (message "abc")) > ;;(symbol-function 't1) > > (let ((hold (symbol-function 't1))) > (defun t1 () (message "def")) > (fset 't1 hold)) > > ;;(symbol-function 't1) > ---- > Using fset is more readable than my proposal. Very nice. > > And the new patch is attached. > Thanks, however unwind-protect is not used correctly. Make sure that the value of message is reset in the unwindforms portion of unwind-protect. > > BTW: I received a PDF assignment form from FSF, but the developer name and > the target program on it were wrong (It's for another person who > contributes to GCC, I think), so I reply that mail for a new PDF assignment > form, I 'll tell you after these things done. > Great, let Bastien and myself know when this comes through and he'll add you to the contributors list and I'll apply the patch. Best, > > Thanks. > > > On Sat, Apr 12, 2014 at 3:18 AM, Eric Schulte wrote: > >> Hmmm, >> >> Not to be overly nitpicky here, but I see two issues. >> >> 1. You should use unwind-protect, to ensure that (ad-unadvise #'message) >> is run even if @body throws an error, and >> >> 2. This will remove any advise which the user has placed on #'message. >> >> How about something shaped like the following. >> >> (defmacro with-weird-message (&rest body) >> `(let ((hold #'message) >> current-message) >> (unwind-protect >> (progn >> (defun message (&rest args) >> (setq current-message (apply #'format args))) >> ,@body >> current-message) >> (setq message hold)))) >> >> Best, >> >> P.S. I know this is a lot of process for a small patch, but from this >> point forward once you have the FSF assignment you can much more >> easily contribute to ob-scheme and org in general >> >> KDr2 writes: >> >> > Hi, Eric >> > >> > I'm sorry for that I used `flet' in the patch, It's a easy way to let >> > function `current-message' work in batch mode, so I used it even I saw >> that >> > emacs says `flet' is obsolete, I'm sorry for that. >> > >> > And I made a new patch(attachment) using `defadvice' for `message' to >> > capture the message in batch mode, after the message being captured, the >> > advice function is removed. Is this way OK? >> > >> > And I also sent a request email to assign@gnu.org, and now waiting the >> > reply. >> > >> > Thanks. >> > >> > >> > On Fri, Apr 11, 2014 at 10:45 AM, Eric Schulte > >wrote: >> > >> >> We can no longer use `flet' in the Org-mode code base, please re-work >> >> this patch w/o flet. >> >> >> >> Also, I don't see your name in the list of contributors, and (I believe) >> >> this patch is too large to apply w/o FSF assignment. See the following >> >> page on how to contribute to Org-mode. >> >> >> >> http://orgmode.org/worg/org-contribute.html >> >> >> >> KDr2 writes: >> >> >> >> > The bug: >> >> > write file ~/scheme-test.org with the content below: >> >> > -------8<-------------- >> >> > #+BEGIN_SRC scheme :exports results :results output raw >> >> > (display "Hello Scheme in OrgMode") >> >> > #+END_SRC >> >> > -------8<-------------- >> >> > >> >> > and run: >> >> > >> >> > emacs --batch --eval='(load "~/.emacs.d/init.el")' ~/scheme-test.org-f >> >> > org-html-export-to-html >> >> > >> >> > you will find the bug: >> >> > >> >> > `org-babel-scheme-execute-with-geiser' uses `current-message' to get >> the >> >> > results of scheme code blocks, but `current-message' always returns >> nil >> >> in >> >> > batch mode, and this patch fixes this. >> >> > >> >> > -- >> >> >> >> -- >> >> Eric Schulte >> >> https://cs.unm.edu/~eschulte >> >> PGP: 0x614CA05D >> >> >> > >> > >> > >> > -- >> > -- >> > >> > KDr2, http://kdr2.com >> > >> > From fe5549f3f48acf9b51aeb3706eb8dd3d76ab18c1 Mon Sep 17 00:00:00 2001 >> > From: KDr2 >> > Date: Fri, 11 Apr 2014 12:56:24 +0800 >> > Subject: [PATCH] lisp/ob-scheme.el: Fix scheme code blocks execution >> error in >> > batch mode >> > >> > * lisp/ob-scheme.el (org-babel-scheme-capture-current-message, >> org-babel-scheme-execute-with-geiser): Capture scheme code results via >> current-message both in interactive mode and noninteractive mode. >> > >> > `org-babel-scheme-execute-with-geiser' uses `current-message' to get the >> results of scheme code blocks, but `current-message' always returns nil in >> batch mode, and this patch fixes this. >> > >> > Modified from a patch proposal by KDr2(killy.draw@gmail.com) >> > --- >> > lisp/ob-scheme.el | 20 +++++++++++++++++--- >> > 1 file changed, 17 insertions(+), 3 deletions(-) >> > >> > diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el >> > index b7117e9..6b82c6e 100644 >> > --- a/lisp/ob-scheme.el >> > +++ b/lisp/ob-scheme.el >> > @@ -118,6 +118,19 @@ org-babel-scheme-execute-with-geiser will use a >> temporary session." >> > (name)))) >> > result)) >> > >> > +(defmacro org-babel-scheme-capture-current-message (&rest body) >> > + "Capture current message in both interactive and noninteractive mode" >> > + `(if noninteractive >> > + (let ((current-message nil)) >> > + (defadvice message (after capture-current-message activate) >> > + (setq current-message ad-return-value)) >> > + ,@body >> > + (ad-unadvise #'message) >> > + current-message) >> > + (progn >> > + ,@body >> > + (current-message)))) >> > + >> > (defun org-babel-scheme-execute-with-geiser (code output impl repl) >> > "Execute code in specified REPL. If the REPL doesn't exist, create it >> > using the given scheme implementation. >> > @@ -142,10 +155,11 @@ is true; otherwise returns the last value." >> > (current-buffer))))) >> > (setq geiser-repl--repl repl-buffer) >> > (setq geiser-impl--implementation nil) >> > - (geiser-eval-region (point-min) (point-max)) >> > + (setq result (org-babel-scheme-capture-current-message >> > + (geiser-eval-region (point-min) (point-max)))) >> > (setq result >> > - (if (equal (substring (current-message) 0 3) "=> ") >> > - (replace-regexp-in-string "^=> " "" (current-message)) >> > + (if (and (stringp result) (equal (substring result 0 3) "=> >> ")) >> > + (replace-regexp-in-string "^=> " "" result) >> > "\"An error occurred.\"")) >> > (when (not repl) >> > (save-current-buffer (set-buffer repl-buffer) >> >> -- >> Eric Schulte >> https://cs.unm.edu/~eschulte >> PGP: 0x614CA05D >> > > > > -- > -- > > KDr2, http://kdr2.com > > From f20949e18314977bfa3c2ec1a59fb1e7b3269cbd Mon Sep 17 00:00:00 2001 > From: KDr2 > Date: Sat, 12 Apr 2014 15:59:37 +0800 > Subject: [PATCH] lisp/ob-scheme.el: Fix scheme code blocks execution error in > batch mode > > * lisp/ob-scheme.el (org-babel-scheme-capture-current-message, org-babel-scheme-execute-with-geiser): Capture scheme code results via current-message both in interactive mode and noninteractive mode. > > `org-babel-scheme-execute-with-geiser' uses `current-message' to get the results of scheme code blocks, but `current-message' always returns nil in batch mode, and this patch fixes this. > > Modified from a patch proposal by KDr2(killy.draw@gmail.com) > --- > lisp/ob-scheme.el | 21 ++++++++++++++++++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > > diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el > index b7117e9..cf21311 100644 > --- a/lisp/ob-scheme.el > +++ b/lisp/ob-scheme.el > @@ -118,6 +118,20 @@ org-babel-scheme-execute-with-geiser will use a temporary session." > (name)))) > result)) > > +(defmacro org-babel-scheme-capture-current-message (&rest body) > + "Capture current message in both interactive and noninteractive mode" > + `(if noninteractive > + (let ((original-message (symbol-function 'message)) > + (current-message nil)) > + (defun message (&rest args) > + (setq current-message (apply original-message args))) > + (unwind-protect ,@body) > + (fset 'message original-message) > + current-message) > + (progn > + ,@body > + (current-message)))) > + > (defun org-babel-scheme-execute-with-geiser (code output impl repl) > "Execute code in specified REPL. If the REPL doesn't exist, create it > using the given scheme implementation. > @@ -142,10 +156,11 @@ is true; otherwise returns the last value." > (current-buffer))))) > (setq geiser-repl--repl repl-buffer) > (setq geiser-impl--implementation nil) > - (geiser-eval-region (point-min) (point-max)) > + (setq result (org-babel-scheme-capture-current-message > + (geiser-eval-region (point-min) (point-max)))) > (setq result > - (if (equal (substring (current-message) 0 3) "=> ") > - (replace-regexp-in-string "^=> " "" (current-message)) > + (if (and (stringp result) (equal (substring result 0 3) "=> ")) > + (replace-regexp-in-string "^=> " "" result) > "\"An error occurred.\"")) > (when (not repl) > (save-current-buffer (set-buffer repl-buffer) -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D From mboxrd@z Thu Jan 1 00:00:00 1970 From: KDr2 Subject: Re: [PATCH] ob-scheme.el: Fix scheme code blocks execution error in batch mode Date: Thu, 22 May 2014 20:45:24 +0800 Message-ID: References: <87sipky46c.fsf@gmail.com> <87tx9zk5ln.fsf@gmail.com> <87d2gmiqle.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0118243ae3847404f9fc7de8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnSNa-0008Cg-Iy for emacs-orgmode@gnu.org; Thu, 22 May 2014 08:45:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnSNX-0003Xi-MJ for emacs-orgmode@gnu.org; Thu, 22 May 2014 08:45:50 -0400 Received: from mail-ob0-x22b.google.com ([2607:f8b0:4003:c01::22b]:55048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnSNW-0003XU-Ue for emacs-orgmode@gnu.org; Thu, 22 May 2014 08:45:47 -0400 Received: by mail-ob0-f171.google.com with SMTP id wn1so3748661obc.2 for ; Thu, 22 May 2014 05:45:46 -0700 (PDT) In-Reply-To: <87d2gmiqle.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Cc: emacs-orgmode@gnu.org --089e0118243ae3847404f9fc7de8 Content-Type: text/plain; charset=UTF-8 Hi, all This patch is finally merged into the master branch, we can export results of scheme code block under batch mode now. Thanks to Eric, Bastien and Oleh. On Sat, Apr 12, 2014 at 10:12 PM, Eric Schulte wrote: > KDr2 writes: > > > HI, Eric > > > > You are right, I remove the usage of advice now, and use the method you > > (nearly) gave, only 1 little change: > > I found the code: > > ---- > > (defun t1 () (message "abc")) > > ;;(symbol-function 't1) > > > > (let ((hold #'t1)) > > (defun t1 () (message "def")) > > (setq t1 hold)) > > ;;(symbol-function 't1) > > ---- > > > > did recover the t1 function after it executed, so I use this way: > > ---- > > (defun t1 () (message "abc")) > > ;;(symbol-function 't1) > > > > (let ((hold (symbol-function 't1))) > > (defun t1 () (message "def")) > > (fset 't1 hold)) > > > > ;;(symbol-function 't1) > > ---- > > > > Using fset is more readable than my proposal. Very nice. > > > > > And the new patch is attached. > > > > Thanks, however unwind-protect is not used correctly. Make sure that > the value of message is reset in the unwindforms portion of > unwind-protect. > > > > > BTW: I received a PDF assignment form from FSF, but the developer name > and > > the target program on it were wrong (It's for another person who > > contributes to GCC, I think), so I reply that mail for a new PDF > assignment > > form, I 'll tell you after these things done. > > > > Great, let Bastien and myself know when this comes through and he'll add > you to the contributors list and I'll apply the patch. > > Best, > > > > > Thanks. > > > > > > On Sat, Apr 12, 2014 at 3:18 AM, Eric Schulte >wrote: > > > >> Hmmm, > >> > >> Not to be overly nitpicky here, but I see two issues. > >> > >> 1. You should use unwind-protect, to ensure that (ad-unadvise #'message) > >> is run even if @body throws an error, and > >> > >> 2. This will remove any advise which the user has placed on #'message. > >> > >> How about something shaped like the following. > >> > >> (defmacro with-weird-message (&rest body) > >> `(let ((hold #'message) > >> current-message) > >> (unwind-protect > >> (progn > >> (defun message (&rest args) > >> (setq current-message (apply #'format args))) > >> ,@body > >> current-message) > >> (setq message hold)))) > >> > >> Best, > >> > >> P.S. I know this is a lot of process for a small patch, but from this > >> point forward once you have the FSF assignment you can much more > >> easily contribute to ob-scheme and org in general > >> > >> KDr2 writes: > >> > >> > Hi, Eric > >> > > >> > I'm sorry for that I used `flet' in the patch, It's a easy way to let > >> > function `current-message' work in batch mode, so I used it even I saw > >> that > >> > emacs says `flet' is obsolete, I'm sorry for that. > >> > > >> > And I made a new patch(attachment) using `defadvice' for `message' to > >> > capture the message in batch mode, after the message being captured, > the > >> > advice function is removed. Is this way OK? > >> > > >> > And I also sent a request email to assign@gnu.org, and now waiting > the > >> > reply. > >> > > >> > Thanks. > >> > > >> > > >> > On Fri, Apr 11, 2014 at 10:45 AM, Eric Schulte < > schulte.eric@gmail.com > >> >wrote: > >> > > >> >> We can no longer use `flet' in the Org-mode code base, please re-work > >> >> this patch w/o flet. > >> >> > >> >> Also, I don't see your name in the list of contributors, and (I > believe) > >> >> this patch is too large to apply w/o FSF assignment. See the > following > >> >> page on how to contribute to Org-mode. > >> >> > >> >> http://orgmode.org/worg/org-contribute.html > >> >> > >> >> KDr2 writes: > >> >> > >> >> > The bug: > >> >> > write file ~/scheme-test.org with the content below: > >> >> > -------8<-------------- > >> >> > #+BEGIN_SRC scheme :exports results :results output raw > >> >> > (display "Hello Scheme in OrgMode") > >> >> > #+END_SRC > >> >> > -------8<-------------- > >> >> > > >> >> > and run: > >> >> > > >> >> > emacs --batch --eval='(load "~/.emacs.d/init.el")' > ~/scheme-test.org-f > >> >> > org-html-export-to-html > >> >> > > >> >> > you will find the bug: > >> >> > > >> >> > `org-babel-scheme-execute-with-geiser' uses `current-message' to > get > >> the > >> >> > results of scheme code blocks, but `current-message' always returns > >> nil > >> >> in > >> >> > batch mode, and this patch fixes this. > >> >> > > >> >> > -- > >> >> > >> >> -- > >> >> Eric Schulte > >> >> https://cs.unm.edu/~eschulte > >> >> PGP: 0x614CA05D > >> >> > >> > > >> > > >> > > >> > -- > >> > -- > >> > > >> > KDr2, http://kdr2.com > >> > > >> > From fe5549f3f48acf9b51aeb3706eb8dd3d76ab18c1 Mon Sep 17 00:00:00 2001 > >> > From: KDr2 > >> > Date: Fri, 11 Apr 2014 12:56:24 +0800 > >> > Subject: [PATCH] lisp/ob-scheme.el: Fix scheme code blocks execution > >> error in > >> > batch mode > >> > > >> > * lisp/ob-scheme.el (org-babel-scheme-capture-current-message, > >> org-babel-scheme-execute-with-geiser): Capture scheme code results via > >> current-message both in interactive mode and noninteractive mode. > >> > > >> > `org-babel-scheme-execute-with-geiser' uses `current-message' to get > the > >> results of scheme code blocks, but `current-message' always returns nil > in > >> batch mode, and this patch fixes this. > >> > > >> > Modified from a patch proposal by KDr2(killy.draw@gmail.com) > >> > --- > >> > lisp/ob-scheme.el | 20 +++++++++++++++++--- > >> > 1 file changed, 17 insertions(+), 3 deletions(-) > >> > > >> > diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el > >> > index b7117e9..6b82c6e 100644 > >> > --- a/lisp/ob-scheme.el > >> > +++ b/lisp/ob-scheme.el > >> > @@ -118,6 +118,19 @@ org-babel-scheme-execute-with-geiser will use a > >> temporary session." > >> > (name)))) > >> > result)) > >> > > >> > +(defmacro org-babel-scheme-capture-current-message (&rest body) > >> > + "Capture current message in both interactive and noninteractive > mode" > >> > + `(if noninteractive > >> > + (let ((current-message nil)) > >> > + (defadvice message (after capture-current-message activate) > >> > + (setq current-message ad-return-value)) > >> > + ,@body > >> > + (ad-unadvise #'message) > >> > + current-message) > >> > + (progn > >> > + ,@body > >> > + (current-message)))) > >> > + > >> > (defun org-babel-scheme-execute-with-geiser (code output impl repl) > >> > "Execute code in specified REPL. If the REPL doesn't exist, create > it > >> > using the given scheme implementation. > >> > @@ -142,10 +155,11 @@ is true; otherwise returns the last value." > >> > (current-buffer))))) > >> > (setq geiser-repl--repl repl-buffer) > >> > (setq geiser-impl--implementation nil) > >> > - (geiser-eval-region (point-min) (point-max)) > >> > + (setq result (org-babel-scheme-capture-current-message > >> > + (geiser-eval-region (point-min) (point-max)))) > >> > (setq result > >> > - (if (equal (substring (current-message) 0 3) "=> ") > >> > - (replace-regexp-in-string "^=> " "" (current-message)) > >> > + (if (and (stringp result) (equal (substring result 0 3) > "=> > >> ")) > >> > + (replace-regexp-in-string "^=> " "" result) > >> > "\"An error occurred.\"")) > >> > (when (not repl) > >> > (save-current-buffer (set-buffer repl-buffer) > >> > >> -- > >> Eric Schulte > >> https://cs.unm.edu/~eschulte > >> PGP: 0x614CA05D > >> > > > > > > > > -- > > -- > > > > KDr2, http://kdr2.com > > > > From f20949e18314977bfa3c2ec1a59fb1e7b3269cbd Mon Sep 17 00:00:00 2001 > > From: KDr2 > > Date: Sat, 12 Apr 2014 15:59:37 +0800 > > Subject: [PATCH] lisp/ob-scheme.el: Fix scheme code blocks execution > error in > > batch mode > > > > * lisp/ob-scheme.el (org-babel-scheme-capture-current-message, > org-babel-scheme-execute-with-geiser): Capture scheme code results via > current-message both in interactive mode and noninteractive mode. > > > > `org-babel-scheme-execute-with-geiser' uses `current-message' to get the > results of scheme code blocks, but `current-message' always returns nil in > batch mode, and this patch fixes this. > > > > Modified from a patch proposal by KDr2(killy.draw@gmail.com) > > --- > > lisp/ob-scheme.el | 21 ++++++++++++++++++--- > > 1 file changed, 18 insertions(+), 3 deletions(-) > > > > diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el > > index b7117e9..cf21311 100644 > > --- a/lisp/ob-scheme.el > > +++ b/lisp/ob-scheme.el > > @@ -118,6 +118,20 @@ org-babel-scheme-execute-with-geiser will use a > temporary session." > > (name)))) > > result)) > > > > +(defmacro org-babel-scheme-capture-current-message (&rest body) > > + "Capture current message in both interactive and noninteractive mode" > > + `(if noninteractive > > + (let ((original-message (symbol-function 'message)) > > + (current-message nil)) > > + (defun message (&rest args) > > + (setq current-message (apply original-message args))) > > + (unwind-protect ,@body) > > + (fset 'message original-message) > > + current-message) > > + (progn > > + ,@body > > + (current-message)))) > > + > > (defun org-babel-scheme-execute-with-geiser (code output impl repl) > > "Execute code in specified REPL. If the REPL doesn't exist, create it > > using the given scheme implementation. > > @@ -142,10 +156,11 @@ is true; otherwise returns the last value." > > (current-buffer))))) > > (setq geiser-repl--repl repl-buffer) > > (setq geiser-impl--implementation nil) > > - (geiser-eval-region (point-min) (point-max)) > > + (setq result (org-babel-scheme-capture-current-message > > + (geiser-eval-region (point-min) (point-max)))) > > (setq result > > - (if (equal (substring (current-message) 0 3) "=> ") > > - (replace-regexp-in-string "^=> " "" (current-message)) > > + (if (and (stringp result) (equal (substring result 0 3) "=> > ")) > > + (replace-regexp-in-string "^=> " "" result) > > "\"An error occurred.\"")) > > (when (not repl) > > (save-current-buffer (set-buffer repl-buffer) > > -- > Eric Schulte > https://cs.unm.edu/~eschulte > PGP: 0x614CA05D > -- -- KDr2, http://kdr2.com --089e0118243ae3847404f9fc7de8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi, all

This patch is finally merged in= to the master branch, we can export results of scheme code block under batc= h mode now.

Thanks to Eric, Bastien and Oleh.


On Sat,= Apr 12, 2014 at 10:12 PM, Eric Schulte <schulte.eric@gmail.com&g= t; wrote:
KDr2 <killy.draw@gmail.com> writes:

> HI, Eric
>
> You are right, I remove the usage of advice now, and use the method yo= u
> (nearly) gave, only 1 little change:
> I found the code:
> ----
> (defun t1 () (message "abc"))
> ;;(symbol-function 't1)
>
> (let ((hold #'t1))
> =C2=A0 (defun t1 () (message "def"))
> =C2=A0 (setq t1 hold))
> ;;(symbol-function 't1)
> ----
>
> did recover the t1 function after it executed, so I use this way:
> ----
> (defun t1 () (message "abc"))
> ;;(symbol-function 't1)
>
> (let ((hold (symbol-function 't1)))
> =C2=A0 (defun t1 () (message "def"))
> =C2=A0 (fset 't1 hold))
>
> ;;(symbol-function 't1)
> ----
>

Using fset is more readable than my proposal. =C2=A0Very nice.

>
> And the new patch is attached.
>

Thanks, however unwind-protect is not used correctly. =C2=A0Make sure= that
the value of message is reset in the unwindforms portion of
unwind-protect.

>
> BTW: I received a PDF assignment form from FSF, but the developer name= and
> the target program on it were wrong (It's for another person who > contributes to GCC, I think), so I reply that mail for a new PDF assig= nment
> form, I 'll tell you after these things done.
>

Great, let Bastien and myself know when this comes through and he'= ;ll add
you to the contributors list and I'll apply the patch.

Best,

>
> Thanks.
>
>
> On Sat, Apr 12, 2014 at 3:18 AM, Eric Schulte <schulte.eric@gmail.com>wrote:
>
>> Hmmm,
>>
>> Not to be overly nitpicky here, but I see two issues.
>>
>> 1. You should use unwind-protect, to ensure that (ad-unadvise #= 9;message)
>> =C2=A0 =C2=A0is run even if @body throws an error, and
>>
>> 2. This will remove any advise which the user has placed on #'= message.
>>
>> How about something shaped like the following.
>>
>> =C2=A0 =C2=A0 (defmacro with-weird-message (&rest body)
>> =C2=A0 =C2=A0 =C2=A0 `(let ((hold #'message)
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0current-message) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(unwind-protect
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(progn
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(defun mess= age (&rest args)
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(set= q current-message (apply #'format args)))
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0,@body
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0current-mes= sage)
>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq message hold)))) >>
>> Best,
>>
>> P.S. I know this is a lot of process for a small patch, but from t= his
>> =C2=A0 =C2=A0 =C2=A0point forward once you have the FSF assignment= you can much more
>> =C2=A0 =C2=A0 =C2=A0easily contribute to ob-scheme and org in gene= ral
>>
>> KDr2 <killy.draw@gmail.= com> writes:
>>
>> > Hi, Eric
>> >
>> > I'm sorry for that I used `flet' in the patch, It'= ;s a easy way to let
>> > function `current-message' work in batch mode, so I used = it even I saw
>> that
>> > emacs says `flet' is obsolete, I'm sorry for that. >> >
>> > And I made a new patch(attachment) using `defadvice' for = `message' to
>> > capture the message in batch mode, after the message being ca= ptured, the
>> > advice function is removed. Is this way OK?
>> >
>> > And I also sent a request email to assign@gnu.org, and now waiting the
>> > reply.
>> >
>> > Thanks.
>> >
>> >
>> > On Fri, Apr 11, 2014 at 10:45 AM, Eric Schulte <schulte.eric@gmail.com
>> >wrote:
>> >
>> >> We can no longer use `flet' in the Org-mode code base= , please re-work
>> >> this patch w/o flet.
>> >>
>> >> Also, I don't see your name in the list of contributo= rs, and (I believe)
>> >> this patch is too large to apply w/o FSF assignment. =C2= =A0See the following
>> >> page on how to contribute to Org-mode.
>> >>
>> >> =C2=A0 http://orgmode.org/worg/org-contribute.html
>> >>
>> >> KDr2 <killy.dr= aw@gmail.com> writes:
>> >>
>> >> > The bug:
>> >> > write file ~/scheme-test.org with the content below:
>> >> > -------8<--------------
>> >> > #+BEGIN_SRC scheme :exports results :results output = raw
>> >> > =C2=A0 (display "Hello Scheme in OrgMode")=
>> >> > #+END_SRC
>> >> > -------8<--------------
>> >> >
>> >> > and run:
>> >> >
>> >> > emacs --batch --eval=3D'(load "~/.emacs.d/i= nit.el")' ~/scheme-test.org-f
>> >> > org-html-export-to-html
>> >> >
>> >> > you will find the bug:
>> >> >
>> >> > `org-babel-scheme-execute-with-geiser' uses `cur= rent-message' to get
>> the
>> >> > results of scheme code blocks, but `current-message&= #39; always returns
>> nil
>> >> in
>> >> > batch mode, and this patch fixes this.
>> >> >
>> >> > --
>> >>
>> >> --
>> >> Eric Schulte
>> >> https://cs.unm.edu/~eschulte
>> >> PGP: 0x614CA05D
>> >>
>> >
>> >
>> >
>> > --
>> > --
>> >
>> > KDr2, http://kd= r2.com
>> >
>> > From fe5549f3f48acf9b51aeb3706eb8dd3d76ab18c1 Mon Sep 17 00:0= 0:00 2001
>> > From: KDr2 <killy.= draw@gmail.com>
>> > Date: Fri, 11 Apr 2014 12:56:24 +0800
>> > Subject: [PATCH] lisp/ob-scheme.el: Fix scheme code blocks ex= ecution
>> error in
>> > =C2=A0batch mode
>> >
>> > * lisp/ob-scheme.el (org-babel-scheme-capture-current-message= ,
>> org-babel-scheme-execute-with-geiser): Capture scheme code results= via
>> current-message both in interactive mode and noninteractive mode.<= br> >> >
>> > `org-babel-scheme-execute-with-geiser' uses `current-mess= age' to get the
>> results of scheme code blocks, but `current-message' always re= turns nil in
>> batch mode, and this patch fixes this.
>> >
>> > Modified from a patch proposal by KDr2(killy.draw@gmail.com)
>> > ---
>> > =C2=A0lisp/ob-scheme.el | 20 +++++++++++++++++---
>> > =C2=A01 file changed, 17 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el
>> > index b7117e9..6b82c6e 100644
>> > --- a/lisp/ob-scheme.el
>> > +++ b/lisp/ob-scheme.el
>> > @@ -118,6 +118,19 @@ org-babel-scheme-execute-with-geiser wil= l use a
>> temporary session."
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(name))))
>> > =C2=A0 =C2=A0 =C2=A0result))
>> >
>> > +(defmacro org-babel-scheme-capture-current-message (&res= t body)
>> > + =C2=A0"Capture current message in both interactive and= noninteractive mode"
>> > + =C2=A0`(if noninteractive
>> > + =C2=A0 =C2=A0 =C2=A0 (let ((current-message nil))
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (defadvice message (after captu= re-current-message activate)
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq current-message ad= -return-value))
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 ,@body
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (ad-unadvise #'message)
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 current-message)
>> > + =C2=A0 =C2=A0 (progn
>> > + =C2=A0 =C2=A0 =C2=A0 ,@body
>> > + =C2=A0 =C2=A0 =C2=A0 (current-message))))
>> > +
>> > =C2=A0(defun org-babel-scheme-execute-with-geiser (code outpu= t impl repl)
>> > =C2=A0 =C2=A0"Execute code in specified REPL. If the REP= L doesn't exist, create it
>> > =C2=A0using the given scheme implementation.
>> > @@ -142,10 +155,11 @@ is true; otherwise returns the last val= ue."
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(current-buffer)))))
>> > =C2=A0 =C2=A0 =C2=A0 (setq geiser-repl--repl repl-buffer)
>> > =C2=A0 =C2=A0 =C2=A0 (setq geiser-impl--implementation nil) >> > - =C2=A0 =C2=A0 (geiser-eval-region (point-min) (point-max))<= br> >> > + =C2=A0 =C2=A0 (setq result (org-babel-scheme-capture-curren= t-message
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (geiser-eval-region (point-min) (point-max))))
>> > =C2=A0 =C2=A0 =C2=A0 (setq result
>> > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (equal (substring (c= urrent-message) 0 3) "=3D> ")
>> > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (replace-r= egexp-in-string "^=3D> " "" (current-message))
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (and (stringp result= ) (equal (substring result 0 3) "=3D>
>> "))
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (replace-r= egexp-in-string "^=3D> " "" result)
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "\"= ;An error occurred.\""))
>> > =C2=A0 =C2=A0 =C2=A0 (when (not repl)
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 (save-current-buffer (set-buffer = repl-buffer)
>>
>> --
>> Eric Schulte
>> https:/= /cs.unm.edu/~eschulte
>> PGP: 0x614CA05D
>>
>
>
>
> --
> --
>
> KDr2, http://kdr2.com
>
> From f20949e18314977bfa3c2ec1a59fb1e7b3269cbd Mon Sep 17 0= 0:00:00 2001
> From: KDr2 <
killy.draw@gmai= l.com>
> Date: Sat, 12 Apr 2014 15:59:37 +0800
> Subject: [PATCH] lisp/ob-scheme.el: Fix scheme code bl= ocks execution error in
> =C2=A0batch mode
>
> * lisp/ob-scheme.el (org-babel-scheme-capture-current-message, org-bab= el-scheme-execute-with-geiser): Capture scheme code results via current-mes= sage both in interactive mode and noninteractive mode.
>
> `org-babel-scheme-execute-with-geiser' uses `current-message' = to get the results of scheme code blocks, but `current-message' always = returns nil in batch mode, and this patch fixes this.
>
> Modified from a patch proposal by KDr2(killy.draw@gmail.com)
> ---
> =C2=A0lisp/ob-scheme.el | 21 ++++++++++++++++++---
> =C2=A01 file changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/ob-scheme.el b/lisp/ob-scheme.el
> index b7117e9..cf21311 100644
> --- a/lisp/ob-scheme.el
> +++ b/lisp/ob-scheme.el
> @@ -118,6 +118,20 @@ org-babel-scheme-execute-with-geiser will use a t= emporary session."
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(name)= )))
> =C2=A0 =C2=A0 =C2=A0result))
>
> +(defmacro org-babel-scheme-capture-current-message (&rest body) > + =C2=A0"Capture current message in both interactive and noninter= active mode"
> + =C2=A0`(if noninteractive
> + =C2=A0 =C2=A0 =C2=A0 (let ((original-message (symbol-function = 'message))
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (current-message nil))
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (defun message (&rest args)
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq current-message (apply orig= inal-message args)))
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (unwind-protect ,@body)
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (fset 'message original-message)
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 current-message)
> + =C2=A0 =C2=A0 (progn
> + =C2=A0 =C2=A0 =C2=A0 ,@body
> + =C2=A0 =C2=A0 =C2=A0 (current-message))))
> +
> =C2=A0(defun org-babel-scheme-execute-with-geiser (code output impl re= pl)
> =C2=A0 =C2=A0"Execute code in specified REPL. If the REPL doesn&#= 39;t exist, create it
> =C2=A0using the given scheme implementation.
> @@ -142,10 +156,11 @@ is true; otherwise returns the last value.= "
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(curre= nt-buffer)))))
> =C2=A0 =C2=A0 =C2=A0 (setq geiser-repl--repl repl-buffer)
> =C2=A0 =C2=A0 =C2=A0 (setq geiser-impl--implementation nil)
> - =C2=A0 =C2=A0 (geiser-eval-region (point-min) (point-max))
> + =C2=A0 =C2=A0 (setq result (org-babel-scheme-capture-current-message=
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (geis= er-eval-region (point-min) (point-max))))
> =C2=A0 =C2=A0 =C2=A0 (setq result
> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (equal (substring (current-me= ssage) 0 3) "=3D> ")
> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (replace-regexp-in-= string "^=3D> " "" (current-message))
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (and (stringp result) (equal = (substring result 0 3) "=3D> "))
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (replace-regexp-in-= string "^=3D> " "" result)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "\"An error= occurred.\""))
> =C2=A0 =C2=A0 =C2=A0 (when (not repl)
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 (save-current-buffer (set-buffer repl-buff= er)

--
Eric Schulte
https://cs.unm.e= du/~eschulte
PGP: 0x614CA05D



--
=
--089e0118243ae3847404f9fc7de8--