all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jarmo Hurri <jarmo.hurri@iki.fi>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] ob-ditaa.el: custom var name, ditaa executable, SVG output, and chararacter encoding
Date: Fri, 08 Nov 2024 13:05:15 +0200	[thread overview]
Message-ID: <87a5eanfys.fsf@iki.fi> (raw)
In-Reply-To: 87msiggqjm.fsf@localhost


Greetings Ihor.

Thanks for your feedback. A couple of notes and questions before I can
proceed to format the next version of the patch.

Ihor Radchenko <yantar92@posteo.net> writes:

> 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.

Noted.

>> -(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.

Will do so. This will also move the contents in ORG-NEWS to a different
section, since there will no longer be any "breaking changes."

>> +;;; 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.

Check.

> Also, the error sounds very generic. It would be nicer to indicate to
> the user that the problem is related to ob-ditaa.

Check.

>> +	 (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.

This could be done, but I do not see much harm in providing an
override. Note that the file extension is used by default.

So, your choice: is it
a) file extension only
b) file extension with possibility to override with parameters?

>> +      (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?

I was originally directed to ob-plantuml, which message's its
command. During the testing of this patch I found messaging useful to
observe what was happening.

So, your choice:
a) no messaging
b) message always
c) defcustom a toggle for messaging?

And, finally, should I add myself as the maintainer?

All the best,

Jarmo



  reply	other threads:[~2024-11-08 11:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-03 14:05 [PATCH] ob-ditaa.el: custom var name, ditaa executable, SVG output, and chararacter encoding Jarmo Hurri
2024-11-03 17:45 ` Ihor Radchenko
2024-11-08 11:05   ` Jarmo Hurri [this message]
2024-11-08 19:10     ` Ihor Radchenko
2024-12-08  9:28       ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a5eanfys.fsf@iki.fi \
    --to=jarmo.hurri@iki.fi \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.