From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Add preamble support to ob-plantuml.el Date: Fri, 09 Dec 2016 21:55:44 +0100 Message-ID: <87oa0kesa7.fsf@nicolasgoaziou.fr> References: <87bmwu29yk.fsf@dell-desktop.WORKGROUP> <87shq29ib5.fsf@nicolasgoaziou.fr> <87h96hpvcq.fsf@dell-desktop.WORKGROUP> <87k2bd9tcr.fsf@nicolasgoaziou.fr> <87vauwv7pm.fsf@dell-desktop.WORKGROUP> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFSCo-00058h-Uw for emacs-orgmode@gnu.org; Fri, 09 Dec 2016 15:55:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFSCl-0006lB-2R for emacs-orgmode@gnu.org; Fri, 09 Dec 2016 15:55:47 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:46800) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cFSCk-0006kN-Qt for emacs-orgmode@gnu.org; Fri, 09 Dec 2016 15:55:43 -0500 In-Reply-To: <87vauwv7pm.fsf@dell-desktop.WORKGROUP> (Thibault Marin's message of "Tue, 06 Dec 2016 19:39:01 -0600") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Thibault Marin Cc: emacs-orgmode Hello, Thibault Marin writes: > However, ob-plantuml does not seem to support the prologue option. So I > am modifying my patch to add support for the :prologue and :epilogue > header arguments instead of using a new customization variable. In the > process, I have added support for header variables which are passed to > the PlantUML file via the !define macro. I am also adding a test file > which checks that the temporary file passed to the plantuml program is > properly generated (it does not run or check the output of plantuml). Thank you. > Please let me know you have any comment on the patch. Thanks in > advance. Comments follow. > +(defun org-babel-plantuml-var-to-plantuml (var) > + "Cleanup plantuml variable (remove quotes)." > + (replace-regexp-in-string "\"" "" var)) Since this function is used only once in the code, I suggest to not implement it and use `replace-regexp-in-string' at the appropriate place. > +(defun org-babel-variable-assignments:plantuml (params) > + "Return a list of PlantUML statements assigning the block's variables." Could you document what is PARAMS? > + (mapcar > + (lambda (pair) > + (format "!define %s %s" > + (car pair) > + (org-babel-plantuml-var-to-plantuml (cdr pair)))) > + (org-babel--get-vars params))) > + > +(defun org-babel-plantuml-make-body (body params) > + "Form PlantUML input string." Do you mean "Return PlantUML" input string? Also you need to specify what are body and params. Besides, the same applies to `org-babel-plantuml-var-to-plantuml' above. Is this function really needed, as it is a mere `format'. Regards, -- Nicolas Goaziou