From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id kO7kLW62J2ez9wAAqHPOHw:P1 (envelope-from ) for ; Sun, 03 Nov 2024 17:44:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id kO7kLW62J2ez9wAAqHPOHw (envelope-from ) for ; Sun, 03 Nov 2024 18:44:14 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=E8osaoqE; 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=1730655854; a=rsa-sha256; cv=none; b=Gua9n45BSKxZ18wwqjSC6VllLnVPfQp8S4pGVgqS79Se1+oH+rKX8ZZr5lBHlzm1rMvTEE NX/N/99xr17vDvy9d2mM1JRVvYcHmCRftRKa8Aal5M6wSAI147LuaqsqbT10AEhYzDfTUL O245oFe5533UUjnE81dh1KrbSyMN1deMBaUuMeNOk5JZVVrvMkqrnu1sVLf3a7sDXRZd6L WpbNTqlzUQT48R8DzYJc5IbV4bpWLE1qiUCeLQBrdpHYBQl2fV61hNA7R9WMfyelS06/uK 40+TNqOL3vCbTCOvaAZeoh3ncII+CldScxQU4+BbY4hRQPAM3d/iooKqduNxLA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=E8osaoqE; 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=1730655854; 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=rkkyJsKy9HivDXsGMO2RxqEpxb0Xqu5G0bU9CkEOp7o=; b=f452rqtRancL5MNe2z4d6/1qBrSletYnrKGLZSmRiglg6O/NBKD4jSREH6GugQKLW34R9O 3HKmFGNjYwSIpJ1/CWNJ/w4BbSorvf/rVTUU8EqYTBuL5zFFJRfmG29GRJ1AJpSb8xM5Vy x5z72oUXCuh/2N6VPBveK4G5GDlbBfPM132UBEYLhMoqorLmaAWaW+XxRcvyrCgQJyrmHJ lu+mwtUFOvn1tOadQvUnb6wCEZPn+cKrql915r8CXvarLMFQc7Syp72TDucb46Fw1yNsNH R5rvRKSb3b3NV/95ZM4Fpo4OO4kG0SndgH2wG6mxrbFFVUwfbkzsubLDNMld8Q== 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 582C47FE80 for ; Sun, 03 Nov 2024 18:44:14 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7edK-0006is-Ox; Sun, 03 Nov 2024 12:43:26 -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 1t7edJ-0006ii-GB for emacs-orgmode@gnu.org; Sun, 03 Nov 2024 12:43:25 -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 1t7edH-0002FO-EB for emacs-orgmode@gnu.org; Sun, 03 Nov 2024 12:43:25 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 52336240027 for ; Sun, 3 Nov 2024 18:43:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1730655800; bh=Z605H6SIvNgyOPBkf/wNGkgkQ5CPRVoaN4cJt4pUths=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=E8osaoqE3XD/hcXssrLgJWyj0gHEdM4nSVUuAwKfa3jhGnjVAoeZoPcU/eLhwRr92 zKDPivfGkXrCF0P80Uke0HobiJn6oiDJlDlKf7eOMG6xTx9EUbtC7BHS+NjECuo/L0 gp12vuD/TOJy2Bdj0GDGyFUkgs/ZxQktkzRIqLTepLZ7tez5BXzFtaqE3Igybg+T0d ZVXN7tPt47IVPsAQfWzukopHsr7HIgdcqXYELJVJzhf/aXzAd3QvR1n2hbfdwIAtg1 nBNZ48rsSXi8OZNXsQLV6vnHui/3rI63GxsO2j14/xwZ2u8zlQq6kQ6stQ7MEVQhy5 s2W99s0h6fVWw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XhMQH6QgVz6ty4; Sun, 3 Nov 2024 18:43:19 +0100 (CET) From: Ihor Radchenko To: Jarmo Hurri Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] ob-ditaa.el: custom var name, ditaa executable, SVG output, and chararacter encoding In-Reply-To: <875xp476pt.fsf@iki.fi> References: <875xp476pt.fsf@iki.fi> Date: Sun, 03 Nov 2024 17:45:01 +0000 Message-ID: <87msiggqjm.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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.98 X-Spam-Score: -4.98 X-Migadu-Queue-Id: 582C47FE80 X-Migadu-Scanner: mx10.migadu.com X-TUID: 4OoLzbcc5ER/ Jarmo Hurri writes: > Please find attached a patch written mainly to allow a ditaa executable > to be used instead of a JAR file. Assuming that this patch is > (eventually) accepted, I can also volunteer to be a maintainer for this > file if one is needed. Thanks for the patch and for volunteering to be a maintainer! Note that we will also need to update https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ditaa.html after we finalize changes in the code. See some initial comments below. > -(defcustom org-babel-ditaa-java-cmd "java" > +(defcustom org-ditaa-java-exec "java" > + "Java executable to use when evaluating ditaa blocks using a JAR." > + :group 'org-babel > + :type 'string) We generally do not rename variables irreversibly. Please leave an obsolete alias for `org-babel-ditaa-java-cmd' pointing to the new variable name. Otherwise, the existing configs that were using the old variable name will be broken. > +;;; small helper function returning file if it exists and signalling > +;;; error otherwise > +(defun org-ditaa-ensure-jar-file (file) > + (if (file-exists-p file) > + file > + (error "could not find jar file %s" file))) Rather than writing what the function does in the comment, please do it in the docstring. We might also make this function internal. Also, the error sounds very generic. It would be nicer to indicate to the user that the problem is related to ob-ditaa. > + (png (cdr (assq :png params))) > + (svg (cdr (assq :svg params))) > (eps (cdr (assq :eps params))) I am wondering if we could instead deprecate the :png/:eps parameters and instead use the :file extension to decide. > + (message cmd) > + (shell-command cmd) > + (when pdf > + (let ((pdf-cmd (concat "epstopdf" " " ditaa-out-file " " > + "-o=" (org-babel-process-file-name out-file)))) > + (message pdf-cmd) Why message? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at