From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 2KgeH58czmFfgwAAgWs5BA (envelope-from ) for ; Thu, 30 Dec 2021 21:54:55 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id ML3hF58czmHa5gAAG6o9tA (envelope-from ) for ; Thu, 30 Dec 2021 21:54:55 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BE0F9DC78 for ; Thu, 30 Dec 2021 21:54:54 +0100 (CET) Received: from localhost ([::1]:40348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n32Rq-0002kx-0j for larch@yhetil.org; Thu, 30 Dec 2021 15:54:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n32RE-0002kp-OL for emacs-orgmode@gnu.org; Thu, 30 Dec 2021 15:54:16 -0500 Received: from [2a00:1450:4864:20::229] (port=43956 helo=mail-lj1-x229.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n32RD-0006kA-5S for emacs-orgmode@gnu.org; Thu, 30 Dec 2021 15:54:16 -0500 Received: by mail-lj1-x229.google.com with SMTP id g13so30191962ljj.10 for ; Thu, 30 Dec 2021 12:54:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:message-id:date:mime-version:user-agent:subject :content-language:to:references:in-reply-to; bh=adwiehI5nIku1Mz8jUIpIGA+8KezizGobK+Bxte9jKk=; b=e3m8AEqXUYw6tVXUz9r+RiI+uI0sUaNm2JZerld33Ypf3Vmpc7WmmmBNvKbPhFMkfp M+fKvtAMcMwHCqaHLhET1hdBhGnqQQVQntm0OguOVIaA9B0m/pL1hkcXLRaEXNm+vBY1 TfYCxHplk9bTgFwle6kofSDZWvxqG4e4jVoGQ5euIkb5E9u7AAV3oYULpNjTnNqA/fGc jTCubxJVfpGbv7Xzkcxxs0lseEQ1NNc6QDL/8O0/4dK5OPEJY2W6ceKnqOqM67NBoUlp QYr8W0DiPuUjBjMlhsHAvmtVdSBMNFeDGkwAUXpP8CGAxytdlc6ZLdARME972iTWiI7W /FOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:date:mime-version:user-agent :subject:content-language:to:references:in-reply-to; bh=adwiehI5nIku1Mz8jUIpIGA+8KezizGobK+Bxte9jKk=; b=UjE6jESKVs9I1/idug4bUzLkxCug2zwyUI9yzczThE+1Lt0xMOaYdc/Duir+8MaXuZ numxEaXpRKeeqtkUIPVGWRq7kadsjMb5hqPZABusx4OV9M5SoS0XpFwW1FgasmbKSXco SbVCpCzn0HpbZAA1Z3Zi1ItV5ONnQiMzrq4Ta6P1/Xj/3FeU2rKd0h/DOzDM6FkrDxEN IQI/cyIopA3XZzT0rG7WPkMxrGXnqIhjGXVzcidJ8Sm2XzrI2vqy7B+DPpzHOEj/LqAQ EZ+uqK6o8Kzy9FcQCJSlVK3X/hSJvqlkWp6w5+sCKQEen8VgFhkBBEah0fXBlCYuEK/q T74A== X-Gm-Message-State: AOAM533YZao9x/ae1d83EC7DEUPUg/q0w9loLQtLHLTic8dI1dw1yVXU sBjc+6c3M0lHTDhy5I7Q9P4= X-Google-Smtp-Source: ABdhPJxazHA0/1IhYciTrNgi5b3g/E1ZT4wEzTpHMtnM5s7ah9zu2UHSIJzeqOQZq4vU5zJO23CZfw== X-Received: by 2002:a2e:91d3:: with SMTP id u19mr27596390ljg.176.1640897653061; Thu, 30 Dec 2021 12:54:13 -0800 (PST) Received: from ?IPV6:2a02:2168:b07b:7500:87f7:b59:d3b7:434f? ([2a02:2168:b07b:7500:87f7:b59:d3b7:434f]) by smtp.gmail.com with ESMTPSA id p18sm2581390lfc.297.2021.12.30.12.54.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Dec 2021 12:54:12 -0800 (PST) From: Nikolay Kudryavtsev X-Google-Original-From: Nikolay Kudryavtsev Content-Type: multipart/mixed; boundary="------------r4TlSdwSAL0P1ONqkF1UeX5j" Message-ID: <8cd49b4c-9342-a77f-d665-402c41432b57@gmail.com> Date: Thu, 30 Dec 2021 23:54:10 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH] ob-maxima.el: Fix execution on MS Windows Content-Language: en-US To: Max Nikulin , emacs-orgmode@gnu.org References: <53a33993-2e62-2600-ee28-7c3d886de678@gmail.com> In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::229 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=nikolay.kudryavtsev@gmail.com; helo=mail-lj1-x229.google.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-3.024, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640897695; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=adwiehI5nIku1Mz8jUIpIGA+8KezizGobK+Bxte9jKk=; b=PDca2FFeu2wL1GYUDv5LyCelvdJcMdagsrhSZpRlcx1vNglkf3odzFBFYLyPrjYUW0rvKU bRFYNhHf98MU7K+swp5LZ3/2H+RiHfhOY5m0Vi0kHSS0A1kA8eH5+QIGc4r5AaHRtrBWTe CT74tUzqGoM4XPLnieyJTBJ2/zjLEnhWIWKuBPc/0jCPduffz+aU9vVRZJOZ/KjNbiKpDH bPzcRWBLhFmOsaBOrYJQ9CvIxhVVRqHo1K42nx1i+ywh1b9EWSlD+GvdAnyT1mCTLi6X4M IHgUKuMvXiTcwKSZnGOn80zP+aE7QalqFXK22YVeLItoEHbS4aIqXJ39AQ25nw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640897695; a=rsa-sha256; cv=none; b=FXKERsUmkwZ7Rt4yjjy7fSIO1UQ2i70JVTPiRMGA0NaZqVU4F7mLy+yYH7pV+YxaqlEhXb aRE9yy85uLTgTAeKUc3w1FS5gCsZNithrAj7eHVRc/+knGQMGhRzSM6djMqJUVKaRnAC+N AmdG1zt54V2oIZWimW5MPO+oW4XeFLzHPanyTa+Jwgm9QILxhkv6vA0b61wmTZOWh6oE6f pLbBi8Ggk8LYVKkNvmQ2pIlhJOvqEjbte8F13/cH6bmEAPtdWDUqV68EZpJ7GD4lL3k3/L Y49BAp2oZ2Z1vLyH+WQ2Lmyl4OPKoYHKMIOjVtD1iwEF00bAyAjz9cpeN8vcAQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=e3m8AEqX; 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" X-Migadu-Spam-Score: -5.17 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=e3m8AEqX; 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" X-Migadu-Queue-Id: BE0F9DC78 X-Spam-Score: -5.17 X-Migadu-Scanner: scn0.migadu.com X-TUID: D3B7B3g8D0LM This is a multi-part message in MIME format. --------------r4TlSdwSAL0P1ONqkF1UeX5j Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > When some external data is substituted into a Maxima command > (batchload this case) there should be an extra pass of escaping that > protects special characters like quotes (and backslashes?) accordingly > to Maxima rules. Not necessarily, Maxima is capable of understanding unescaped paths, for example, this works: maxima --very-quiet -r "batchload(\"/tmp/sp ce/babel-gxqTkM/maxima-ua3e9j.max\")"$ > I suspect that quotes your added around %S must not be used there. Due > to them file name appears outside of quotes at all. Yes, good catch. > Unsure concerning Maxima but usually it is possible to pass arguments > avoiding quoting issues for particular language. Command line Maxima actually has a batch flag, but using it returns the entire input file in the output too and that seems to be the reason why the original authors of ob-maxima didn't use it. It's probably possible to filter that on our side, but such filtering would require extra work, which they probably deemed unnecessary, for such a rather obscure set of use cases. Anyway, I've tried to get it to work using shell-quote-argument, see the attached patch. Seems to work well enough in practice on both platforms and for cases like (setq temporary-file-directory "/tmp/`echo hi`/"). --------------r4TlSdwSAL0P1ONqkF1UeX5j Content-Type: text/plain; charset=UTF-8; name="0001-ob-maxima.el-Fix-execution-on-MS-Windows.patch" Content-Disposition: attachment; filename="0001-ob-maxima.el-Fix-execution-on-MS-Windows.patch" Content-Transfer-Encoding: base64 RnJvbSA0NzY5MGQxNGFjNDgzOGQ4ZTM5ZjA4YmQ4MjI0ZjBiNGFmMDUzMzU5IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBOaWtvbGF5IEt1ZHJ5YXZ0c2V2IDxuaWtvbGF5Lmt1 ZHJ5YXZ0c2V2QGdtYWlsLmNvbT4KRGF0ZTogU3VuLCAyNiBEZWMgMjAyMSAyMjo0NzoxOSAr MDMwMApTdWJqZWN0OiBbUEFUQ0hdIG9iLW1heGltYS5lbDogRml4IGV4ZWN1dGlvbiBvbiBN UyBXaW5kb3dzCgoqIG9iLW1heGltYS5lbCAob3JnLWJhYmVsLWV4ZWN1dGU6bWF4aW1hKTog Q2hhbmdlIGNvbW1hbmQgbGluZQppbnZvY2F0aW9uIHRvIGEgb25lIHRoYXQgc2hvdWxkIHdv cmsgZXZlcnl3aGVyZS4KLS0tCiBsaXNwL29iLW1heGltYS5lbCB8IDcgKysrKystLQogMSBm aWxlIGNoYW5nZWQsIDUgaW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkKCmRpZmYgLS1n aXQgYS9saXNwL29iLW1heGltYS5lbCBiL2xpc3Avb2ItbWF4aW1hLmVsCmluZGV4IDdiNDli YjA3YS4uMDhiNTg2NDE0IDEwMDY0NAotLS0gYS9saXNwL29iLW1heGltYS5lbAorKysgYi9s aXNwL29iLW1heGltYS5lbApAQCAtNzcsOCArNzcsMTEgQEAgVGhpcyBmdW5jdGlvbiBpcyBj YWxsZWQgYnkgYG9yZy1iYWJlbC1leGVjdXRlLXNyYy1ibG9jaycuIgogCShyZXN1bHQKIAkg KGxldCogKChjbWRsaW5lIChvciAoY2RyIChhc3NxIDpjbWRsaW5lIHBhcmFtcykpICIiKSkK IAkJKGluLWZpbGUgKG9yZy1iYWJlbC10ZW1wLWZpbGUgIm1heGltYS0iICIubWF4IikpCi0J CShjbWQgKGZvcm1hdCAiJXMgLS12ZXJ5LXF1aWV0IC1yICdiYXRjaGxvYWQoJVMpJCcgJXMi Ci0JCQkgICAgIG9yZy1iYWJlbC1tYXhpbWEtY29tbWFuZCBpbi1maWxlIGNtZGxpbmUpKSkK KwkJKGNtZCAoZm9ybWF0ICIlcyAtLXZlcnktcXVpZXQgLXIgJXMkICVzIgorCQkJICAgICBv cmctYmFiZWwtbWF4aW1hLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KHNoZWxsLXF1b3RlLWFyZ3VtZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo Zm9ybWF0ICJiYXRjaGxvYWQoJVMpIiBpbi1maWxlKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY21kbGluZSkpKQogCSAgICh3aXRoLXRlbXAtZmlsZSBpbi1maWxlIChpbnNl cnQgKG9yZy1iYWJlbC1tYXhpbWEtZXhwYW5kIGJvZHkgcGFyYW1zKSkpCiAJICAgKG1lc3Nh Z2UgY21kKQogICAgICAgICAgICA7OyAiIHwgZ3JlcCAtdiBiYXRjaCB8IGdyZXAgLXYgJ3Jl cGxhY2VkJyB8IHNlZCAnL14kL2QnICIKLS0gCjIuMzQuMS53aW5kb3dzLjEKCg== --------------r4TlSdwSAL0P1ONqkF1UeX5j--