emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: "Sébastien Vauban" <wxhgmqzgwmuf@spammotel.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: wrong-type-argument when publishing to HTML
Date: Thu, 3 Sep 2009 10:19:34 +0200	[thread overview]
Message-ID: <F680038F-E995-4766-B1D6-265E56E28C87@gmail.com> (raw)
In-Reply-To: <873a74sb03.fsf@mundaneum.com>


On Sep 3, 2009, at 10:11 AM, Sébastien Vauban wrote:

> Hi Carsten,
>
> Carsten Dominik wrote:
>> On Sep 2, 2009, at 1:44 PM, Sébastien Vauban wrote:
>>
>>> 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---
>>> [...]
>>> 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")
>>> [...]
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> I tried to understand what could be wrong, but don't see anything  
>>> special
>>> with the time-stamps.
>>>
>>> Here is the contents of Org2HTML.el:
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> ;; Org-mode
>>> (require 'org)
>>>
>>> ;; publish related Org-mode files as a website
>>> (require 'org-publish)
>>>
>>> ;; association list to control publishing behavior
>>> (setq org-publish-project-alist
>>>     '(("Project"
>>>        :base-directory "./"
>>>        :recursive t
>>>        :publishing-directory "../public_html/"
>>>        :base-extension "org"
>>>        :publishing-function org-publish-org-to-html
>>>        :section-numbers nil
>>>        :table-of-contents nil
>>>        :author-info nil
>>>        :creator-info nil
>>>        :style-include-default nil
>>>        :style "<link rel=\"stylesheet\" type=\"text/css\" href=
>>>                                              \"assets/css/ 
>>> common.css\"/>"
>>>        :timestamp nil
>>>        [...]
>>>        :auto-preamble nil
>>>        :auto-postamble nil
>>>        :auto-index t                  ; Generate index.org  
>>> automagically...
>>>        :index-filename "sitemap.org"  ; ... call it sitemap.org ...
>>>        :index-title "Sitemap"         ; ... with title 'Sitemap'.
>>>        )))
>>> --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.
>
> I knew that, but I thought that
>
> --8<---------------cut here---------------start------------->8---
> ;; Org-mode
> (require 'org)
> --8<---------------cut here---------------end--------------->8---
>
> would add the association `.org' in `auto-mode-alist' on its own.

No, this is, I think, against Emacs conventions, because
it would overrule user setup - some people might want to
use .org for a different purpose.

In Emacs 23, the default value for auto-mode-alist contains the
regexp for org-mode, but I guess you are not running 23 in this case.

>
> Anyway, adding the above `add-to-list' line (just after the `require  
> org')
> solved the problem of my colleague. Thanks.

You are welcome.

- Carsten

  reply	other threads:[~2009-09-03  8:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-02 11:44 wrong-type-argument when publishing to HTML Sébastien Vauban
2009-09-02 15:25 ` Carsten Dominik
2009-09-03  8:11   ` Sébastien Vauban
2009-09-03  8:19     ` Carsten Dominik [this message]
2009-09-03  8:43       ` Sébastien Vauban

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F680038F-E995-4766-B1D6-265E56E28C87@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=wxhgmqzgwmuf@spammotel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).