[Orgmode] wrong-type-argument when publishing to HTML

2009-09-02 Thread Sébastien Vauban
Hello,

A colleague of mine gets the error `(wrong-type-argument stringp nil)' when
executing the command (from a script, under Ubuntu and Emacs 22.2.1 with
Org-mode 6.29c):

--8---cut here---start-8---
emacs --batch \
--load ./Org2HTML.el \
--visit=agile-software-development.org \
--funcall org-publish-current-file
--8---cut here---end---8---

The detailed result is:

--8---cut here---start-8---
Loading 00debian-vars...
No /etc/mailname. Reverting to default...
Loading /etc/emacs22/site-start.d/50auctex.el (source)...
Loading /usr/share/emacs/22.2/site-lisp/auctex.el (source)...
Loading /usr/share/emacs/22.2/site-lisp/preview-latex.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50erlang-mode.el (source)...
Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...
Loading cjk-enc...
Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)...
Loading /etc/emacs/site-start.d/50lilypond-data.el (source)...
Loading /etc/emacs/site-start.d/50psvn.el (source)...
Loading vc-svn...
Publishing file /home/llg/devel/Internet/source/agile-software-development.org 
using `org-publish-org-to-html'
Exporting...
Warning: defvar ignored because description is let-bound
Exporting...
Exporting...
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match(nil )
  (while (string-match org-maybe-keyword-time-regexp s) (or b (setq b ...)) 
(setq r (concat r ...  @span class=\timestamp-wrapper\ ... ... 
@/span) s (substring s ...)))
  (let (r b) (while (string-match org-maybe-keyword-time-regexp s) (or b ...) 
(setq r ... s ...)) (if (not r) s (setq r ...) (unless ... ...) r))
  (catch (quote exit) (let (r b) (while ... ... ...) (if ... s ... ... r)))
  org-html-handle-time-stamps()
  (setq line (org-html-handle-time-stamps line))
  (catch (quote nextline) (when (and inquote ...) (insert /pre\n) 
(org-open-par) (setq inquote nil)) (when inquote (insert ... \n) (throw ... 
nil)) (when (and org-export-with-fixed-width ...) (when ... ... ... ...) 
(insert ... \n) (when ... ... ... ...) (throw ... nil)) 
(org-export-html-close-lists-maybe line) (when (get-text-property 0 ... line) 
(let ... ... ... ... ...) (throw ... nil)) (when (equal ORG-BLOCKQUOTE-START 
line) (org-close-par-maybe) (insert blockquote\n) (org-open-par) (throw ... 
nil)) (when (equal ORG-BLOCKQUOTE-END line) (org-close-par-maybe) (insert 
\n/blockquote\n) (org-open-par) (throw ... nil)) (when (equal 
ORG-VERSE-START line) (org-close-par-maybe) (insert \np 
class=\verse\\n) (setq inverse t) (throw ... nil)) (when (equal 
ORG-VERSE-END line) (insert /p\n) (org-open-par) (setq inverse nil) 
(throw ... nil)) (when (equal ORG-CENTER-START line) (org-close-par-maybe) 
(insert \ndiv style=\text-align: center\) (org-open-par) (throw ... nil)) 
(when (equal ORG-CENTER-END line) (org-close-par-maybe) (insert \n/div) 
(org-open-par) (throw ... nil)) (run-hooks (quote 
org-export-html-after-blockquotes-hook)) (when inverse (let ... ... ...)) 
(while (string-match ?\\([^]*\\)?\\((INVISIBLE)\\)?[]*\n? 
line) (cond ... ... ...)) (setq line (org-html-handle-time-stamps line)) (or 
(string-match org-table-hline-regexp line) (setq line ...)) (setq start 0) 
(while (string-match org-bracket-link-analytic-regexp++ line start) (setq start 
...) (setq path ...) (setq type ...) (setq path ...) (setq attr ...) (setq 
desc1 ... desc2 ... descp ... desc ...) (when ... ... ...) (cond ... ... ... 
... ... ... ... ...) (setq line ... start ...)) (if (and ... ...) (setq line 
...)) (when org-export-with-footnotes (setq start 0) (while ... ...)) (cond 
(... ... ... ... ... ... ... ...) (... ... ...) (... ... ... ...) (t ... ... 
... ... ... ... ...)))
  (while (setq line (pop lines) origline line) (catch (quote nextline) (when 
... ... ... ...) (when inquote ... ...) (when ... ... ... ... ...) 
(org-export-html-close-lists-maybe line) (when ... ... ...) (when ... ... ... 
... ...) (when ... ... ... ... ...) (when ... ... ... ... ...) (when ... ... 
... ... ...) (when ... ... ... ... ...) (when ... ... ... ... ...) (run-hooks 
...) (when inverse ...) (while ... ...) (setq line ...) (or ... ...) (setq 
start 0) (while ... ... ... ... ... ... ... ... ... ...) (if ... ...) (when 
org-export-with-footnotes ... ...) (cond ... ... ... ...)))
  (let ((case-fold-search nil) (org-odd-levels-only odd)) (mapc (lambda ... 
...) org-export-plist-vars) (setq umax (if arg ... org-export-headline-levels)) 
(setq umax-toc (if ... ... umax)) (unless body-only (insert ...) 
(org-export-html-insert-plist-item opt-plist :preamble opt-plist) (when 

Re: [Orgmode] wrong-type-argument when publishing to HTML

2009-09-02 Thread Carsten Dominik


On Sep 2, 2009, at 1:44 PM, Sébastien Vauban wrote:


Hello,

A colleague of mine gets the error `(wrong-type-argument stringp  
nil)' when
executing the command (from a script, under Ubuntu and Emacs 22.2.1  
with

Org-mode 6.29c):

--8---cut here---start-8---
emacs --batch \
--load ./Org2HTML.el \
--visit=agile-software-development.org \
--funcall org-publish-current-file
--8---cut here---end---8---


This looks to me as if the  the file being published is not
in org-mode.  So my first guess would be that Org2HTML.el misses
the following line:

(add-to-list 'auto-mode-alist '(\\.org\\' . org-mode))

Remember that --batch processing implies -q, i.e. the .emacs
file will not be evalated.  Another solution might be to add

--load ~/.emacs

directly after --batch, but that only works if the .emacs files
does not do seomthing strange.  For example, some people have
their .emacs file automatically switch to a certain file or
displaying the agenda or so.  That may not be a good idea in batch
mode.

HTH

- Carsten




The detailed result is:

--8---cut here---start-8---
Loading 00debian-vars...
No /etc/mailname. Reverting to default...
Loading /etc/emacs22/site-start.d/50auctex.el (source)...
Loading /usr/share/emacs/22.2/site-lisp/auctex.el (source)...
Loading /usr/share/emacs/22.2/site-lisp/preview-latex.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el  
(source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el  
(source)...

Loading /etc/emacs/site-start.d/50erlang-mode.el (source)...
Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...
Loading cjk-enc...
Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)...
Loading /etc/emacs/site-start.d/50lilypond-data.el (source)...
Loading /etc/emacs/site-start.d/50psvn.el (source)...
Loading vc-svn...
Publishing file /home/llg/devel/Internet/source/agile-software- 
development.org using `org-publish-org-to-html'

Exporting...
Warning: defvar ignored because description is let-bound
Exporting...
Exporting...
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
 string-match(nil )
 (while (string-match org-maybe-keyword-time-regexp s) (or b (setq  
b ...)) (setq r (concat r ...  @span class=\timestamp-wrapper 
\ ... ... @/span) s (substring s ...)))
 (let (r b) (while (string-match org-maybe-keyword-time-regexp s)  
(or b ...) (setq r ... s ...)) (if (not r) s (setq r ...)  
(unless ... ...) r))
 (catch (quote exit) (let (r b) (while ... ... ...) (if ...  
s ... ... r)))

 org-html-handle-time-stamps()
 (setq line (org-html-handle-time-stamps line))
 (catch (quote nextline) (when (and inquote ...) (insert /pre\n)  
(org-open-par) (setq inquote nil)) (when inquote (insert ... \n)  
(throw ... nil)) (when (and org-export-with-fixed-width ...)  
(when ... ... ... ...) (insert ... \n) (when ... ... ... ...)  
(throw ... nil)) (org-export-html-close-lists-maybe line) (when (get- 
text-property 0 ... line) (let ... ... ... ... ...) (throw ... nil))  
(when (equal ORG-BLOCKQUOTE-START line) (org-close-par-maybe)  
(insert blockquote\n) (org-open-par) (throw ... nil)) (when  
(equal ORG-BLOCKQUOTE-END line) (org-close-par-maybe) (insert \n/ 
blockquote\n) (org-open-par) (throw ... nil)) (when (equal ORG- 
VERSE-START line) (org-close-par-maybe) (insert \np class=\verse 
\\n) (setq inverse t) (throw ... nil)) (when (equal ORG-VERSE- 
END line) (insert /p\n) (org-open-par) (setq inverse nil)  
(throw ... nil)) (when (equal ORG-CENTER-START line) (org-close- 
par-maybe) (insert \ndiv style=\text-align: center\) (org-open- 
par) (throw ... nil)) (when (equal ORG-CENTER-END line) (org-close- 
par-maybe) (insert \n/div) (org-open-par) (throw ... nil)) (run- 
hooks (quote org-export-html-after-blockquotes-hook)) (when inverse  
(let ... ... ...)) (while (string-match ?\\([^]*\\)?\\ 
((INVISIBLE)\\)?[ 	]*\n? line) (cond ... ... ...)) (setq line (org- 
html-handle-time-stamps line)) (or (string-match org-table-hline- 
regexp line) (setq line ...)) (setq start 0) (while (string-match  
org-bracket-link-analytic-regexp++ line start) (setq start ...)  
(setq path ...) (setq type ...) (setq path ...) (setq attr ...)  
(setq desc1 ... desc2 ... descp ... desc ...) (when ... ... ...)  
(cond ... ... ... ... ... ... ... ...) (setq line ... start ...))  
(if (and ... ...) (setq line ...)) (when org-export-with-footnotes  
(setq start 0) (while ... ...)) (cond  
(... ... ... ... ... ... ... ...) (... ... ...) (... ... ... ...)  
(t ... ... ... ... ... ... ...)))
 (while (setq line (pop lines) origline line) (catch (quote  
nextline) (when ... ... ... ...) (when inquote ... ...)  
(when ... ... ... ... ...)