From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luis Anaya Subject: Re: babel for ditaa-eps Date: Sat, 15 Sep 2012 22:13:57 -0400 Message-ID: References: <877grynexk.fsf@gmx.com> <87r4q5tq7u.fsf@gmx.com> <87mx0ttiyu.fsf@gmx.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TD4N5-0001TF-Bx for emacs-orgmode@gnu.org; Sat, 15 Sep 2012 22:14:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TD4N4-0000aR-Ix for emacs-orgmode@gnu.org; Sat, 15 Sep 2012 22:14:07 -0400 Received: from blu0-omc1-s10.blu0.hotmail.com ([65.55.116.21]:52079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TD4N4-0000aN-F4 for emacs-orgmode@gnu.org; Sat, 15 Sep 2012 22:14:06 -0400 In-Reply-To: <87mx0ttiyu.fsf@gmx.com> (Eric Schulte's message of "Thu\, 13 Sep 2012 20\:51\:37 -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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org, "Arne Babenhauserheide (IMK)" --=-=-= Content-Type: text/plain Eric Schulte writes: Hi: > with the attachment :) I tried your patch and it seems that the defcustom needs to be changed (at least from the way it is written in the patch. I'm attaching a diff against the original ditaa (I hope that is close enough) with the one I fixed. The only thing that is of importance is the defcustom definition for the DitaaEPS.jar. I did not change any of the logic (yet... :) ). Luis --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename="ob-ditaa-luis-patch.el" Content-Transfer-Encoding: quoted-printable Content-Description: Luis Patch for ob-ditaa.el diff -c /sdcard-ext/org-mode/lisp/ob-ditaa.el /sdcard-ext/ob-ditaa.el.orig *** /sdcard-ext/org-mode/lisp/ob-ditaa.el 2012-09-15 21:59:22.000000000 -04= 00 --- /sdcard-ext/ob-ditaa.el.orig 2012-09-15 21:36:55.000000000 -0400 *************** *** 49,65 **** (:java . "-Dfile.encoding=3DUTF-8")) "Default arguments for evaluating a ditaa source block.") =20=20 - (defcustom org-ditaa-eps-jar-path=20 - (expand-file-name - (concat=20 - (file-name-directory - org-ditaa-jar-path) "/" - "DitaaEps.jar" )) - "Default Ditaa Eps" - :group 'org-babel - :type 'string - ) -=20 (defcustom org-ditaa-jar-option "-jar" "Option for the ditaa jar file. Do not leave leading or trailing spaces in this string." --- 49,54 ---- *************** *** 79,103 **** (cmdline (cdr (assoc :cmdline params))) (java (cdr (assoc :java params))) (in-file (org-babel-temp-file "ditaa-")) - (eps (cdr (assoc :eps params))) (cmd (concat "java " 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) ! " " (org-babel-process-file-name out-file))) ! (pdf-cmd (when (and (or (string=3D (file-name-extension out-file) "pdf") ! (cdr (assoc :pdf params)))) ! (concat ! "epstopdf" ! " " (org-babel-process-file-name (concat in-file ".eps")) ! " -o=3D" (org-babel-process-file-name out-file))))) (unless (file-exists-p org-ditaa-jar-path) (error "Could not find ditaa.jar at %s" org-ditaa-jar-path)) (with-temp-file in-file (insert body)) (message cmd) (shell-command cmd) - (when pdf-cmd (message pdf-cmd) (shell-command pdf-cmd)) nil)) ;; signal that output has already been written to file =20=20 (defun org-babel-prep-session:ditaa (session params) --- 68,83 ---- (cmdline (cdr (assoc :cmdline params))) (java (cdr (assoc :java params))) (in-file (org-babel-temp-file "ditaa-")) (cmd (concat "java " java " " org-ditaa-jar-option " " (shell-quote-argument ! (expand-file-name org-ditaa-jar-path)) " " cmdline " " (org-babel-process-file-name in-file) ! " " (org-babel-process-file-name out-file)))) (unless (file-exists-p org-ditaa-jar-path) (error "Could not find ditaa.jar at %s" org-ditaa-jar-path)) (with-temp-file in-file (insert body)) (message cmd) (shell-command cmd) nil)) ;; signal that output has already been written to file =20=20 (defun org-babel-prep-session:ditaa (session params) Diff finished. Sat Sep 15 22:07:23 2012 --=-=-= Content-Type: text/plain -- Luis Anaya papo anaya aroba hot mail punto com "Do not use 100 words if you can say it in 10" - Yamamoto Tsunetomo --=-=-=--