From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id sMnRIi1WT2XzzQAAG6o9tA:P1 (envelope-from ) for ; Sat, 11 Nov 2023 11:23:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id sMnRIi1WT2XzzQAAG6o9tA (envelope-from ) for ; Sat, 11 Nov 2023 11:23:41 +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 58A4922300 for ; Sat, 11 Nov 2023 11:23:41 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=OjlmrhEx; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1699698221; 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=fuDkkd4FhN2jUcXXLM7GTtfelMxCpreTtcNmfkPau5Y=; b=m98x9LBt+1qdWDlv77OW7ULHfRhM1z4FtLFmN1kw7qDQ94NPvdm81luu1upFg8qusU5y/U 8HsPWIhcIqMaqOwPY5z7EgCVhqYrOoXzhlS1A87HuDnMKlhzOlPVu0YRSFIsJH3Ty7OG8W +cJln3xUsLWnEh0sQGgPjZ/N0ZWY4R8a5GmirCiFunZ5eV/IVSL7p7thx9zRPRxjAI09Tv zjSTbOwDqQAE2XTqXVBC4UlhxBVxnyQgjzGrQ/H/K9yWRQcO9Jt3qDctYOpOpKZGzxHxjL /1VVp7C/zzNXMHPGx5XJKQNNleNfokBR6cAS6zi5nWJa7m8HwneOatCEgXvfBw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=OjlmrhEx; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1699698221; a=rsa-sha256; cv=none; b=bFucMVI0rF1Sk3xFZ1LBRHKBnpYTP7SPo2OUX3fF7P3v4MEZpUsXVCZ9caawSN4CdyUTnM q3xn+iBDusMHzqR7nhSYgU5Vr5LlbzYRniTD+nIirUrOYUG5tvO42LBMMOlf4D+YgUvLKJ bhYniXGOFqEC10lxSH17AmaoElidIiOYftKmool3UXR87yco/XzegWbcsoEdshqS/CELcq WPZbXP8mMmMTE/fwuJTHA9WyhbmtmjhFr9CF5OaarbUvgGriXzWayYitl/p+taPWjs0Jve yD0wnGzep2GPBe+5jf71lKPoEMKK0bSYuUD8WK93LrY7ZaOxrDYmRqklGnOLjw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1l8Z-0005HC-H4; Sat, 11 Nov 2023 05:22:48 -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 1r1l8T-0005EU-UI for emacs-orgmode@gnu.org; Sat, 11 Nov 2023 05:22:41 -0500 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 1r1l8Q-0003XJ-QT for emacs-orgmode@gnu.org; Sat, 11 Nov 2023 05:22:40 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 822EB240029 for ; Sat, 11 Nov 2023 11:22:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1699698156; bh=vByfOv+iRDsjYxoCMXycnJ8hvr54o4wBTfgMOaVCE5g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=OjlmrhExsv3ImcGhH0ek6iqQefq5CRDxHRij8ik64Dd+I83FNR5+1OM617rCxuzzS 0uKAKfMN08x9USW5E2olk0d5n6VklEBssEtWlnqLJrYfNX1kxgKTbdXzAcQ2PpFr2I u3nnwYLllv7dFXII9LiFaYRQWgQdm2Xx8wdtUehQPkC6XfyDfWCTVO5S14XdoHXpYR lw97aSMVtCnFuFCbCc0RQFjb2R4I5ABvEEkKZMOUl7tXzuj2WzG0kcT9h0dDBIVnWp jDF8QunFwL6eVCQmeoOUnBWy6V4VHwZoINr11LsNXjcdTszuIr8TK7AyKvOiHSx17k b9235RMRVqYrg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SSBZz3Dmzz6tm4; Sat, 11 Nov 2023 11:22:34 +0100 (CET) From: Ihor Radchenko To: Leo Butler Cc: "Dr. Arne Babenhauserheide" , Florin Boariu , "emacs-orgmode@gnu.org" Subject: Re: [TASK] Allow customizeable ditaa executable in ob-ditaa.el In-Reply-To: <878r75odrc.fsf@t14.reltub.ca> References: <87wmvhnr8b.fsf@t14.reltub.ca> <871qdo5sdh.fsf@web.de> <87y1fwtkth.fsf@localhost> <87sf5f7h04.fsf@t14.reltub.ca> <875y2929pd.fsf@localhost> <878r75odrc.fsf@t14.reltub.ca> Date: Sat, 11 Nov 2023 10:24:41 +0000 Message-ID: <87zfzkvb86.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: -8.42 X-Spam-Score: -8.42 X-Migadu-Queue-Id: 58A4922300 X-Migadu-Scanner: mx10.migadu.com X-TUID: SKLJwBW6IwPA Leo Butler writes: >> And even if we do want to add certain features in future (like >> supporting ditaa executable herein), it does not mean that we have to >> rush them by any cost. > > Ihor, I don't understand that sentence. > > The *documentation* patch was intended to show that ob-ditaa did not > need to be changed. A user can already run ditaa from a script file by > setting the customization variables appropriately (or, inappropriately, > as Max said ;-) ). Let me elaborate. The below explanation in your patch relies upon the implementation detail in `org-babel-execute:ditaa' - how the ditaa command is called. +First, set ~org-babel-ditaa-java-cmd~ and ~org-ditaa-jar-option~ to +empty strings and ~org-ditaa-jar-path~ to the script's path; here, it +is =/usr/bin/ditaa=. This example uses ~setq-local~ to change only +the values in this buffer. + +#+NAME: hello-world-from-script.el.org +#+BEGIN_SRC org :exports code :results replace +,#+NAME: hello-world-from-script.el +,#+BEGIN_SRC emacs-lisp :exports none :results none +(setq-local org-babel-ditaa-java-cmd "" + org-ditaa-jar-option "" + org-ditaa-jar-path "/usr/bin/ditaa") +,#+END_SRC +#+END_SRC however, it can easily happen that we change that detail in future. In fact, your explanation is already not correct for :file foo.eps - org-ditaa-jar-path value is ignored in such scenario: (cmd (concat org-babel-ditaa-java-cmd " " java " " org-ditaa-jar-option " " (shell-quote-argument (expand-file-name (if eps org-ditaa-eps-jar-path org-ditaa-jar-path))) " " cmdline " " (org-babel-process-file-name in-file) " " (if pdf-cmd eps-file (org-babel-process-file-name out-file)))) Further, it won't help with the discussed problem - trying (setq org-ditaa-jar-path "flatpak-spawn --host toolbox run ditaa") will simply fail when passed through `shell-quote-argument'. And now imagine that we change how CMD is produced in future. (For example, there is a WIP branch that unifies escaping command arguments to avoid vulnerabilities). Your documentation patch may cease working any moment, causing damage to users who tried to follow it. Or we may have to constrain the ways we change the internal implementation details in order to not break the existing documentation. Either way is not good and that's why I am saying no to your proposed documentation change. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at