From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id eHoMAVXAXGNrcgEAbAwnHQ (envelope-from ) for ; Sat, 29 Oct 2022 07:55:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id CHsOAFXAXGOGIAAAG6o9tA (envelope-from ) for ; Sat, 29 Oct 2022 07:55:33 +0200 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 C2B7A88C2 for ; Sat, 29 Oct 2022 07:55:32 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooemv-0004ZX-MW; Sat, 29 Oct 2022 01:53:45 -0400 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 1ooemg-0004Qp-4G for emacs-orgmode@gnu.org; Sat, 29 Oct 2022 01:53:30 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooeme-0002yq-0u for emacs-orgmode@gnu.org; Sat, 29 Oct 2022 01:53:29 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 5050E240026 for ; Sat, 29 Oct 2022 07:53:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667022806; bh=mYMKgZEeb3UGsRtWnti556fcb+9tRSwVGCUH7N2XMPI=; h=From:To:Cc:Subject:Date:From; b=NsESPueannP6aPehdRo6Gbk5N5BjHqV58/cfhh0ob8pwcStbZG3JiSvoXpPU8mY9I PMCjYJNf+Srvepjq8oYPOm6J3ejiyox2fWddlyo9VwduOAEXK0ujWJ6yZN2YOr85KN mkoqWvg159iLsb75H4edtqkZ0TSU0+Gj+D/t+mGG2ZLFSrLAxZ6lrE3DNHXU849fta ITK96i7k+AhDdSfnnwXa/4a1dmdTBhkfgHcNZdX0dR0qrLTwA27d4H7FXfk55a3xbv fUdYTNaQbvf/C8Atma4F19qToxmlU0btf+ykHOkBDN/Y/nVRTZC8L0binDt3ISXQI5 qftNhPCBMtGeA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MzpVn4wzSz9rxH; Sat, 29 Oct 2022 07:53:21 +0200 (CEST) From: Ihor Radchenko To: Tobias Zawada Cc: "emacs-orgmode@gnu.org" Subject: Re: [BUG] ob-octave.el In-Reply-To: <217078597.347872.1639979694777@email.ionos.de> References: <217078597.347872.1639979694777@email.ionos.de> Date: Sat, 29 Oct 2022 05:54:04 +0000 Message-ID: <87r0yri39f.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de 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, 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: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667022932; 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=iuAM4wLuS48Uoge8oYrEuL6gaLUOooe0zi2ssgWkhtY=; b=aGXRGfdvS43uhNw/JpYqMNzDoLxmHoAjNPYXwoS0aAL36CyCN1WtyQxtDTvM7y7x2OD+fY hIZ9xEMx20C1mDG+3zz1Hy/ZDlTxlTBVI5qIZVYjyP4VaXv9DnY4BKwhmzw9el3FTsU15z edArSYluo7iaEej3d8+KsaczpM+iQMYHm0med7daaNd4sldYemmqnobJQIEH+IrfBAoe7l Rd695odjj50utazVH6Rrd+I2ZrEdbiP7oRZA9L9gCOylbfTlnza0olHr5i5IqH7yySJnc1 TulNFOZ6tiUEtfW5PGCamx4ynvpoUvSfXk1MXUbY4jdANNTfdB3o8o5ydYsS9w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667022932; a=rsa-sha256; cv=none; b=sKI7qPNBwLtcqYc7OpNCpQ3/Fw9S7N5yElDu4oyrzIVWSIdqRWvVBZnifhdT8hI5iHTQ7h so25GUiYXaRt0QRRb/NePhXQ0PUllbJS2yUHhBSmc1oydkUv45X1enSRZNbBY444xEYaVO /JeV8y/RhM7CtTcQfjdwx2BhIfnBlhV7/kFX4ohmIq2vZHRzP1milkqIvVJshO4vGmSZlZ D9/kpZFxMkOQWjZC/4fsk2a1eHSHjNV4CwHB4yMsm/Gi0SlB5Y4JcL8goZxV+/xZO9FdI2 Bmrqww4IJhybPd/+/tJUAGNbfwvxZzYAp6kiC8JoEZOKRlWyZJVp0CWl2AOmjw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=NsESPuea; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.63 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=NsESPuea; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: C2B7A88C2 X-Spam-Score: -3.63 X-Migadu-Scanner: scn1.migadu.com X-TUID: n6x0qK+jrswX --=-=-= Content-Type: text/plain Tobias Zawada writes: > Currently, evaluating the Org-mode source block > > #+NAME: bug > #+BEGIN_SRC octave :exports results > ["one"; "two"; "three"] > #+END_SRC > > gives > > #+RESULTS: bug > : ottnwheor e e > > Substituting ~fprintf~ in ~org-babel-octave-wrapper-method~ with ~fdisp~ changes the output to > > #+NAME: bug > #+BEGIN_SRC octave :exports results > ["one"; "two"; "three"] > #+END_SRC > > #+RESULTS: bug > | one | > | two | > | three | > > which is more adequate. Thanks for reporting, and sorry for the late reply. Your suggestion looks fine, although I am a bit concerned if the trailing newline in the old version was significant. Can you please test the attached patch when the output long and occupies multiple lines? (I am not familiar with octave) Best, Ihor --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ob-octave-Fix-octave-results-value-parsing.patch >From ac15cc43b0f755da186301c826c74a8010b3f8a9 Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Sat, 29 Oct 2022 13:48:45 +0800 Subject: [PATCH] ob-octave: Fix octave :results value parsing * lisp/ob-octave.el (org-babel-octave-wrapper-method): Use fdisp instead of fprintf. Reported-by: Alexandre Duret-Lutz Link: https://orgmode.org/list/217078597.347872.1639979694777@email.ionos.de --- lisp/ob-octave.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-octave.el b/lisp/ob-octave.el index 55926b789..b0a7767ec 100644 --- a/lisp/ob-octave.el +++ b/lisp/ob-octave.el @@ -61,7 +61,7 @@ (defvar org-babel-matlab-emacs-link-wrapper-method ") (defvar org-babel-octave-wrapper-method "%s -if ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); fclose(fid); +if ischar(ans), fid = fopen('%s', 'w'); fdisp(fid, ans); fclose(fid); else, dlmwrite('%s', ans, '\\t') end") -- 2.35.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--