From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id SJNrCXlHW2d9OAAAqHPOHw:P1 (envelope-from ) for ; Thu, 12 Dec 2024 20:28:41 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id SJNrCXlHW2d9OAAAqHPOHw (envelope-from ) for ; Thu, 12 Dec 2024 21:28:41 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=J8hUZCkB; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734035320; a=rsa-sha256; cv=none; b=HxzMyGcmhxrPg30ZKIl9fpqTNuIRXJKVyRAijCvPiCjIccHSX0zVcsj/zaKggCvHzXk921 1271VdIMr9u1TOSBK+BYa0epEetFYPJx1L3LpodOwGSr/L9Chz/UoF6715JshaHDmiDCKJ oACP3u6S3ovdp2teNxBi7Dv5FkfKBeXYIATV84J/mDlWydbAmGhhdcFIEMvgolTKVeCDS5 zzHRjcwiQW7ZJr1oIwwlIEgJuejVlenixr+fJTFHPt8to8kJFv4PrLBRVKwWfEGvNUBt5W XigTy6/4lp0YXU6IyFuSDB3nKvXZMmQESvo/4/vgmpbRPOGq3CER45YV29G1zQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=J8hUZCkB; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734035320; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=THjTRwmrZmt+vuMGIXtqL+C2Pq/s1HwICCF3Rr+TGJM=; b=s9i7NNmP/2cuZ95lEej72RqqsjNiOr5x5Fjzoz5I4SSaWmv+vO5Fn3wNvgXi+0O8lO6S7e fwdaQUntp1rZQM+R4qXVq5KL7iayfkbF13+bMbuluA0uaqxOvp2Oa2pV12u3okMH444RHU zWxkMZqM3WxC1+osYaqrPiQZ84/xfYoUCuqGouKwDcyJemdBAl2lnojTipU8Zmw7ma1YJu 8QYdZ9X9YVDrO3LagMMoWA1Ei5RRnojVyPGc/a8bC9azYsEODSpiw8ZrwRZ24U/+A0u0XN NcpX/Cf+8ZBnrwP7NNa9QUGzU7TglG9RQUFLsWUbXXZdAR5t2R5VqzLxkO4Gqw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7E4B5353B for ; Thu, 12 Dec 2024 21:28:40 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLpmd-0003rm-Qe; Thu, 12 Dec 2024 15:27:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLpmc-0003re-AP for emacs-orgmode@gnu.org; Thu, 12 Dec 2024 15:27:38 -0500 Received: from mail-yb1-xb2c.google.com ([2607:f8b0:4864:20::b2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLpmZ-0003yu-Vw for emacs-orgmode@gnu.org; Thu, 12 Dec 2024 15:27:38 -0500 Received: by mail-yb1-xb2c.google.com with SMTP id 3f1490d57ef6-e3824e1adcdso742103276.3 for ; Thu, 12 Dec 2024 12:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734035254; x=1734640054; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=THjTRwmrZmt+vuMGIXtqL+C2Pq/s1HwICCF3Rr+TGJM=; b=J8hUZCkBWg1uALp93c4MjtECpCC7/WD+Q1357GiKV18cabFeDztqQHFRscYkKcLgxD HWbAGN49xU+tTYicDn4lHYZjp5tN60oz7X46r1YY6zefsau6Ezr126MZ3E2OUynvxgKZ NV8vdU7+/EoT97HWYLT6iptHy2zO0dktaILDc5QCa7TTk3E5258GpYXLwHdqsUSrg4ta hgb4AkMq5PJOZjW25e9zBX3n4K124cOMm97WswtpVORh7oPcoOXENxL2cKiz5IUslObH vgD40ZU4x2TXyprLILIVGq/WqQus/E5yiVPHCFNFhRpfLCwUIRJ1L5ZgDXBRxBYRL0d+ V+ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734035254; x=1734640054; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=THjTRwmrZmt+vuMGIXtqL+C2Pq/s1HwICCF3Rr+TGJM=; b=Y+FzJaWICSZwxK1gGbWvAERR+N8V7RPc2V/Ew6Bn+JGw8COK7R54DFGcBpQNWltNdu JnncIXvqjaYDneq8ICBBFw3OzjL2GfxeFR1RAEPfvL8oOfwYPlBCgwFnUQS9QvssAfsj bygYmpB8iSqq+riAHJFeWd38kkUoQR0ZVF1hZ1D2unY1672W4NRdkB+0usLE8ls0jqEi +EVKde1aqN6NgJ1YzVZTMDTafNYj9g2GEA2OXbqClHP3xAiytbyQp2XNuCm5iOURVFvp E9hsy3ZHczJ4MgLvx2El0fqwCOxC+5Tmg/eL6PNYEZrO9rpzD5TiEqa09a7Sre5luYHN 0Dmg== X-Forwarded-Encrypted: i=1; AJvYcCWEpfKlRb8WzFsyc4Kn36mYYYsF5eatccaYi9SXCFfVyOHiUJ3qNHcC77eHgYtAaCSJiUeQV3QR460oAMFb@gnu.org X-Gm-Message-State: AOJu0YxCUN2Ycp1zvmBRmJow6Jiu+KVFlJ1hX4touzm4PdTEZD6Lema8 izpyTXkBqarwcVewkA6TDojFAalJXvs+35Aj7jNTsTn0yXf46Ce31UKiRmQK0pEtRSZzhwIANpg W1Fv7v0xwTj4JKT8yE4fgMW8WHYM= X-Gm-Gg: ASbGncts7rG9w+ZJaswMSHlZyekpqPGfVrQUetMCAYqhGy+CVreqIV10ZecIWssVuat Zn92OK5WqrTuqbh2uRPfUN9GbpIQWBs29uKsuyTU= X-Google-Smtp-Source: AGHT+IFlFqCstxUYR8wM0dtbOdWpaAM7ZwUcE1AaQKbFdgd6IM5ZjR1lCGA+/XsGCPS4/fqkCeHoMNqifqD8rFAShmw= X-Received: by 2002:a05:6902:1028:b0:e39:8462:8bc1 with SMTP id 3f1490d57ef6-e434f944032mr77511276.51.1734035253828; Thu, 12 Dec 2024 12:27:33 -0800 (PST) MIME-Version: 1.0 References: <87h6aejf17.fsf@localhost> <87tte8qakc.fsf@localhost> <87ed3sgptk.fsf@localhost> <87ldxysqoo.fsf@localhost> <874j4gfocp.fsf@localhost> <87ttccs1vc.fsf@localhost> <878qt9yd69.fsf@localhost> <87plm2e50v.fsf@localhost> <87h67cx569.fsf@t14.reltub.ca> <874j3cvcew.fsf@t14.reltub.ca> <87ttbbpgbo.fsf@t14.reltub.ca> In-Reply-To: <87ttbbpgbo.fsf@t14.reltub.ca> From: Benjamin McMillan Date: Fri, 13 Dec 2024 09:27:07 +1300 Message-ID: Subject: Re: [BUG] ob-maxima outputs linenum:0 in results on MacOS To: Leo Butler Cc: Ihor Radchenko , "emacs-orgmode@gnu.org" Content-Type: multipart/alternative; boundary="0000000000005524d90629188b0e" Received-SPF: pass client-ip=2607:f8b0:4864:20::b2c; envelope-from=mcmillanbb@gmail.com; helo=mail-yb1-xb2c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -2.40 X-Spam-Score: -2.40 X-Migadu-Queue-Id: 7E4B5353B X-Migadu-Scanner: mx12.migadu.com X-TUID: IHPvqup92vdU --0000000000005524d90629188b0e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Leo, The first suggestion, to add to org-babel-maxima--output-filter-regexps does fix the src block you ask about here. However, the regexp doesn't match for other maxima tests. For example: #+name: ob-maxima/batch+verbatim #+begin_src maxima :results verbatim :batch batch :cmdline --quiet (assume(z>0), integrate(exp(-t)*t^z, t, 0, inf)); #+end_src #+RESULTS: ob-maxima/batch+verbatim #+begin_example (%i1) (linenum:0, (%i1) (assume(z > 0),integrate(exp(-t)*t^z,t,0,inf)) (%o1) gamma(z + 1) #+end_example Best, Ben On Wed, Dec 11, 2024 at 7:02=E2=80=AFAM Leo Butler wrote: > On Tue, Dec 10 2024, Benjamin McMillan wrote: > > > Hi Leo, > > I get the following output: > > > > #+RESULTS: > > > > #+begin_example > > (linenum:0, > > #+end_example > > > > and from *messages*: > > > > Executing Maxima source code block > > maxima -r \(linenum\:0\,\ > > > batchload\(\"/var/folders/f5/6nrph1812wdf0nlg4ddcs_580000gn/T/babel-wImUP= J/maxima-Swf2M2.max\"\)\)\$ > > --very-quiet > > Wrote > > > /var/folders/f5/6nrph1812wdf0nlg4ddcs_580000gn/T/babel-wImUPJ/ob-input-Rb= gtzp > > Code block evaluation complete (took 0.1s). > > > > The contents of that file (which I also attach) are: > > > > build_info(); > > > > If there's more information I can give, just let me know. > > Thanks, > > Benjamin > > > > On Tue, Dec 10, 2024 at 9:17=E2=80=AFAM Leo Butler > wrote: > > > >> On Mon, Dec 09 2024, Leo Butler wrote: > >> > >> > On Sun, Dec 08 2024, Ihor Radchenko wrote: > >> > > >> >> Benjamin McMillan writes: > >> >> > >> >>> This outputs > >> >>> #+RESULTS: > >> >>> | (linenum:0, | > >> >>> | 4 | > >> >>> > >> >>> I suppose the issue is the "linenum:0". In fact, running any of th= e > >> test > >> >>> src blocks does that, e.g. > >> >>> #+begin_src maxima :results verbatim :batch batch > >> >>> (assume(z>0), > >> >>> integrate(exp(-t)*t^z, t, 0, inf)); > >> >>> #+end_src > >> >>> > >> >>> #+RESULTS: > >> >>> #+begin_example > >> >>> (linenum:0, > >> >>> (assume(z > 0),integrate(exp(-t)*t^z,t,0,inf)) > >> >>> gamma(z + 1) > >> >>> #+end_example > >> >>> This does not match the (should (equal ...)) in test-ob-maxima.el > >> >>> > >> >>> I don't know maxima, and haven't made any explicit modifications > >> regards > >> >>> it, so I don't know why my setup would be outputting linenum:0 > >> > >> Benjamin, > >> When you execute your source code block, ob-maxima prints the shell > >> command as a message. Could you copy that shell command from *Messages= * > >> and send it, along with the batch file that ob-maxima creates? > >> > >> Thanks, > >> Leo > >> > >> >> > >> >> Setting linenum was introduced in > >> >> https://list.orgmode.org/orgmode/87jzsrai3x.fsf@localhost/ > >> >> > >> >> It clearly does not affect Linux, but Maxima on MacOS appears to ha= ve > >> >> slightly different behavior. > >> >> > >> >> I am CCing the author of the original patch that introduced this > >> setting. > >> >> Leo, maybe you have some insight? > >> >> > >> >> Unless we can do something to solve the problem on Mac, I am > tentatively > >> >> inclined to revert the linenum part of the patch, so that ob-maxima > is > >> >> not broken on MacOS. > >> > > >> > Benjamin, > >> > Could you include the output of > >> > > >> > #+begin_src maxima :results verbatim > >> > build_info(); > >> > #+end_src > >> > > >> > , please? I think the bug is in the Mac build of Maxima, but I need > more > >> > information to figure it out. > >> > > >> > Best, > >> > Leo > > Hi Benjamin, > > Let me preface my requests by saying that I do not have access to a Mac, > and the problem you are seeing seems to be Mac-specific, so I am > searching in the dark for a solution to the problem. > > I have a couple ideas. > > * First idea > ** Add the regexp =3D^(linenum:0,=3D to > =3Dorg-babel-maxima--output-filter-regexps=3D > > #+begin_src elisp :exports none :results raw > (add-to-list 'org-babel-maxima--output-filter-regexps "^(linenum:0,") > #+end_src > > ** Evaluate your Maxima code block > > #+name: max > #+begin_src maxima :results raw :batch batch > (assume(z>0), integrate(exp(-t)*t^z, t, 0, inf)); > #+end_src > > If all goes well, you should see the output: > > #+RESULTS: max > (assume(z > 0),integrate(exp(-t)*t^z,t,0,inf)) > gamma(z + 1) > > Please evaluate these code blocks in an Org buffer and tell us how it > goes. > > * Second idea > > We could introduce a customization variable, e.g. > org-babel-maxima-batch/load-format-string, whose default is the current > value is "(linenum:0, %s(%S))$". You could change that to "%s(%S)$". > > I would prefer to see if the first idea works for you, though, before > pursuing this. > > TIA, > Leo --0000000000005524d90629188b0e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Leo,
The first suggestion, to add to org= -babel-maxima--output-filter-regexps=C2=A0 does fix the src block you ask a= bout here.
However, the regexp doesn't match for other maxima= tests. For example:

#+name: ob-maxima/batch+verba= tim
#+begin_src maxima :results verbatim :batch batch :cmdline --quiet(assume(z>0),
integrate(exp(-t)*t^z, t, 0, inf));
#+end_src
<= br>#+RESULTS: ob-maxima/batch+verbatim
#+begin_example
(%i1) (linenum= :0,
(%i1) (assume(z > 0),integrate(exp(-t)*t^z,t,0,inf))
(%o1) =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=A0gamma(z + 1)
#+end_example

= Best,
Ben

On Wed, Dec 1= 1, 2024 at 7:02=E2=80=AFAM Leo Butler <Leo.Butler@umanitoba.ca> wrote:
On Tue, Dec 10 2024, Benjamin McMillan <= ;mcmillanbb@gmail= .com> wrote:

> Hi Leo,
> I get the following output:
>
> #+RESULTS:
>
> #+begin_example
> (linenum:0,
> #+end_example
>
> and from *messages*:
>
> Executing Maxima source code block
> maxima -r \(linenum\:0\,\
> batchload\(\"/var/folders/f5/6nrph1812wdf0nlg4ddcs_580000gn/T/bab= el-wImUPJ/maxima-Swf2M2.max\"\)\)\$
>=C2=A0 --very-quiet
> Wrote
> /var/folders/f5/6nrph1812wdf0nlg4ddcs_580000gn/T/babel-wImUPJ/ob-input= -Rbgtzp
> Code block evaluation complete (took 0.1s).
>
> The contents of that file (which I also attach) are:
>
> build_info();
>
> If there's more information I can give, just let me know.
> Thanks,
> Benjamin
>
> On Tue, Dec 10, 2024 at 9:17=E2=80=AFAM Leo Butler <Leo.Butler@umanitoba.ca&g= t; wrote:
>
>> On Mon, Dec 09 2024, Leo Butler <Leo.Butler@umanitoba.ca> wrote:
>>
>> > On Sun, Dec 08 2024, Ihor Radchenko <yantar92@posteo.net> wrote:
>> >
>> >> Benjamin McMillan <mcmillanbb@gmail.com> writes:
>> >>
>> >>> This outputs
>> >>> #+RESULTS:
>> >>> | (linenum:0, |
>> >>> |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A04 |
>> >>>
>> >>> I suppose the issue is the "linenum:0". In = fact, running any of the
>> test
>> >>> src blocks does that, e.g.
>> >>> #+begin_src maxima :results verbatim :batch batch
>> >>> (assume(z>0),
>> >>> integrate(exp(-t)*t^z, t, 0, inf));
>> >>> #+end_src
>> >>>
>> >>> #+RESULTS:
>> >>> #+begin_example
>> >>> (linenum:0,
>> >>> (assume(z > 0),integrate(exp(-t)*t^z,t,0,inf))
>> >>>=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 =C2=A0 =C2=A0 =C2=A0 gamma(z = + 1)
>> >>> #+end_example
>> >>> This does not match the (should (equal ...)) in test-= ob-maxima.el
>> >>>
>> >>> I don't know maxima, and haven't made any exp= licit modifications
>> regards
>> >>> it, so I don't know why my setup would be outputt= ing linenum:0
>>
>> Benjamin,
>> When you execute your source code block, ob-maxima prints the shel= l
>> command as a message. Could you copy that shell command from *Mess= ages*
>> and send it, along with the batch file that ob-maxima creates?
>>
>> Thanks,
>> Leo
>>
>> >>
>> >> Setting linenum was introduced in
>> >> https://list.orgmode.org= /orgmode/87jzsrai3x.fsf@localhost/
>> >>
>> >> It clearly does not affect Linux, but Maxima on MacOS app= ears to have
>> >> slightly different behavior.
>> >>
>> >> I am CCing the author of the original patch that introduc= ed this
>> setting.
>> >> Leo, maybe you have some insight?
>> >>
>> >> Unless we can do something to solve the problem on Mac, I= am tentatively
>> >> inclined to revert the linenum part of the patch, so that= ob-maxima is
>> >> not broken on MacOS.
>> >
>> > Benjamin,
>> > Could you include the output of
>> >
>> > #+begin_src maxima :results verbatim
>> > build_info();
>> > #+end_src
>> >
>> > , please? I think the bug is in the Mac build of Maxima, but = I need more
>> > information to figure it out.
>> >
>> > Best,
>> > Leo

Hi Benjamin,

Let me preface my requests by saying that I do not have access to a Mac, and the problem you are seeing seems to be Mac-specific, so I am
searching in the dark for a solution to the problem.

I have a couple ideas.

* First idea
** Add the regexp =3D^(linenum:0,=3D to =3Dorg-babel-maxima--output-filter-= regexps=3D

#+begin_src elisp :exports none :results raw
=C2=A0 (add-to-list 'org-babel-maxima--output-filter-regexps "^(li= nenum:0,")
#+end_src

** Evaluate your Maxima code block

#+name: max
#+begin_src maxima :results raw :batch batch
=C2=A0 (assume(z>0), integrate(exp(-t)*t^z, t, 0, inf));
#+end_src

If all goes well, you should see the output:

#+RESULTS: max
(assume(z > 0),integrate(exp(-t)*t^z,t,0,inf))
=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 =C2=A0 =C2=A0 =C2=A0gamma(z + 1)

Please evaluate these code blocks in an Org buffer and tell us how it
goes.

* Second idea

We could introduce a customization variable, e.g.
org-babel-maxima-batch/load-format-string, whose default is the current
value is "(linenum:0, %s(%S))$". You could change that to "%= s(%S)$".

I would prefer to see if the first idea works for you, though, before
pursuing this.

TIA,
Leo
--0000000000005524d90629188b0e--