emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Failure exporting with emacs --batch


From: Nick Dokos
Subject: Re: [O] Failure exporting with emacs --batch
Date: Tue, 15 Nov 2011 22:33:12 -0500

Tom Prince <address@hidden> wrote:

> On Tue, 15 Nov 2011 15:30:25 -0500, Nick Dokos <address@hidden> wrot=
> e:
> > Tom Prince <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]