From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Failure exporting with emacs --batch Date: Tue, 15 Nov 2011 22:33:12 -0500 Message-ID: <13634.1321414392@alphaville.dokosmarshall.org> References: <87pqgt9wj7.fsf@hermes.hocat.ca> <2275.1321389025@alphaville.dokosmarshall.org> <87mxbwaoos.fsf@hermes.hocat.ca> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:53150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQWFT-0001nf-Vn for emacs-orgmode@gnu.org; Tue, 15 Nov 2011 22:33:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RQWFP-0005SY-Qy for emacs-orgmode@gnu.org; Tue, 15 Nov 2011 22:33:19 -0500 Received: from g4t0016.houston.hp.com ([15.201.24.19]:39229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQWFP-0005SM-I5 for emacs-orgmode@gnu.org; Tue, 15 Nov 2011 22:33:15 -0500 In-Reply-To: Message from Tom Prince of "Tue, 15 Nov 2011 19:36:19 EST." <87mxbwaoos.fsf@hermes.hocat.ca> 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: Tom Prince Cc: nicholas.dokos@hp.com, Org Mode List Tom Prince wrote: > On Tue, 15 Nov 2011 15:30:25 -0500, Nick Dokos wrot= > e: > > Tom Prince wrote: > >=20 > > > With b43c1c621f52f4a51d8d79cb76c226dfed003998 running > > >=20 > >=20 > > Please use C-u M-x org-version to insert version information in your > > mail. It's not possible to see from the SHA1 whether it is a recent > > version or an old version without doing git archaelogy. > > org-version doesn't display a sha1 hash, when run from an installed copy > of a git version. > OK. ``git describe'' in your git tree will do the equivalent. > Further simplified: (this time with a git clone) > > emacs --no-site-file --no-init-file --load min.el --eval '(setq debug-on-er= > ror t)' --eval '(find-file "test.org")' --eval '(org-version)' -eval '(org-= > export-as-html 3)' --batch > > ------ min.el > (setq org-babel-load-languages '((emacs-lisp . t) (latex . t))) > (setq org-confirm-babel-evaluate nil) > (add-to-list 'load-path (expand-file-name "~/src/org-mode/lisp")) > (add-to-list 'auto-mode-alist '("\\.\\(org\\ |org_archive\\|txt\\)$" . org= > -mode)) > > (require 'org-install) > ------ > > ------ test.org > * Notes for 2011-09-16 > #+begin_src latex :file diag1.png > some latex source > #+end_src > ------ > Yes, I can reproduce this (Org-mode version 7.7 (release_7.7.563.gf8d8.dirty)). I goofed before in not enabling latex as a babel language in my minimal emacs. The thing is that the usual debugging techniques are useless, because it only happens with --batch. So the only thing that works is princ :-( It turns out that there is a bunch of places in org-create-formula-image (which gets called to convert latex formulas to png) that ask for properties of the default face: there is no such thing in batch, and various things blow up - e.g. $ emacs -Q --batch --eval '(princ (face-attribute (quote default) :foreground))' unspecified$ This bug has existed for ever, but I guess this is the first time anybody exercised the code path. In particular, the font height and the fg and bg colors are calculated this way. I stubbed out these things (line 16898ff in org.el) with more or less arbitrary values: (fnh (if (featurep 'xemacs) (font-height (get-face-font 'default)) (face-attribute 'default :height nil))) (fnh (if (numberp fnh) fnh 140.)) and ;; (if (eq fg 'default) (setq fg (org-dvipng-color :foreground))) ;; (if (eq bg 'default) (setq bg (org-dvipng-color :background))) (setq fg "rgb 0 1 0") (setq bg "rgb 0 0 0") and the test passes. Of course, this is not a fix, but I'm sure one will be forthcoming shortly. There may of course be more such problems in other untested paths. Thanks for an interesting bug, Nick