From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: wrong-type-argument when publishing to HTML Date: Wed, 2 Sep 2009 17:25:57 +0200 Message-ID: <74559A82-3F03-49B6-AA50-282D9D9542BF@gmail.com> References: <87ab1dk1vd.fsf@mundaneum.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Miriw-0006WE-55 for emacs-orgmode@gnu.org; Wed, 02 Sep 2009 11:26:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mirir-0006RJ-QP for emacs-orgmode@gnu.org; Wed, 02 Sep 2009 11:26:13 -0400 Received: from [199.232.76.173] (port=56236 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mirir-0006R2-KX for emacs-orgmode@gnu.org; Wed, 02 Sep 2009 11:26:09 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:65216) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Miriq-0008JR-Be for emacs-orgmode@gnu.org; Wed, 02 Sep 2009 11:26:09 -0400 Received: by ewy7 with SMTP id 7so860156ewy.31 for ; Wed, 02 Sep 2009 08:26:07 -0700 (PDT) In-Reply-To: <87ab1dk1vd.fsf@mundaneum.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?ISO-8859-1?Q?S=E9bastien_Vauban?= Cc: emacs-orgmode@gnu.org On Sep 2, 2009, at 1:44 PM, S=E9bastien Vauban wrote: > Hello, > > A colleague of mine gets the error `(wrong-type-argument stringp =20 > nil)' when > executing the command (from a script, under Ubuntu and Emacs 22.2.1 =20= > with > Org-mode 6.29c): > > --8<---------------cut here---------------start------------->8--- > emacs --batch \ > --load ./Org2HTML.el \ > --visit=3Dagile-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 =20 > (source)... > Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el =20 > (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-=20 > 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 =20 > b ...)) (setq r (concat r ... " @ \">" ... ... "@") s (substring s ...))) > (let (r b) (while (string-match org-maybe-keyword-time-regexp s) =20 > (or b ...) (setq r ... s ...)) (if (not r) s (setq r ...) =20 > (unless ... ...) r)) > (catch (quote exit) (let (r b) (while ... ... ...) (if ... =20 > s ... ... r))) > org-html-handle-time-stamps("") > (setq line (org-html-handle-time-stamps line)) > (catch (quote nextline) (when (and inquote ...) (insert "\n") =20= > (org-open-par) (setq inquote nil)) (when inquote (insert ... "\n") =20 > (throw ... nil)) (when (and org-export-with-fixed-width ...) =20 > (when ... ... ... ...) (insert ... "\n") (when ... ... ... ...) =20 > (throw ... nil)) (org-export-html-close-lists-maybe line) (when (get-=20= > text-property 0 ... line) (let ... ... ... ... ...) (throw ... nil)) =20= > (when (equal "ORG-BLOCKQUOTE-START" line) (org-close-par-maybe) =20 > (insert "
\n") (org-open-par) (throw ... nil)) (when =20 > (equal "ORG-BLOCKQUOTE-END" line) (org-close-par-maybe) (insert "\n blockquote>\n") (org-open-par) (throw ... nil)) (when (equal "ORG-=20 > VERSE-START" line) (org-close-par-maybe) (insert "\n

\">\n") (setq inverse t) (throw ... nil)) (when (equal "ORG-VERSE-=20 > END" line) (insert "

\n") (org-open-par) (setq inverse nil) =20 > (throw ... nil)) (when (equal "ORG-CENTER-START" line) (org-close-=20 > par-maybe) (insert "\n
") = (org-open-=20 > par) (throw ... nil)) (when (equal "ORG-CENTER-END" line) (org-close-=20= > par-maybe) (insert "\n
") (org-open-par) (throw ... nil)) (run-=20= > hooks (quote org-export-html-after-blockquotes-hook)) (when inverse =20= > (let ... ... ...)) (while (string-match "<<]*\\)>>>?\\=20 > ((INVISIBLE)\\)?[ ]*\n?" line) (cond ... ... ...)) (setq line = (org-=20 > html-handle-time-stamps line)) (or (string-match org-table-hline-=20 > regexp line) (setq line ...)) (setq start 0) (while (string-match =20 > org-bracket-link-analytic-regexp++ line start) (setq start ...) =20 > (setq path ...) (setq type ...) (setq path ...) (setq attr ...) =20 > (setq desc1 ... desc2 ... descp ... desc ...) (when ... ... ...) =20 > (cond ... ... ... ... ... ... ... ...) (setq line ... start ...)) =20 > (if (and ... ...) (setq line ...)) (when org-export-with-footnotes =20 > (setq start 0) (while ... ...)) (cond =20 > (... ... ... ... ... ... ... ...) (... ... ...) (... ... ... ...) =20 > (t ... ... ... ... ... ... ...))) > (while (setq line (pop lines) origline line) (catch (quote =20 > nextline) (when ... ... ... ...) (when inquote ... ...) =20 > (when ... ... ... ... ...) (org-export-html-close-lists-maybe line) =20= > (when ... ... ...) (when ... ... ... ... ...) =20 > (when ... ... ... ... ...) (when ... ... ... ... ...) =20 > (when ... ... ... ... ...) (when ... ... ... ... ...) =20 > (when ... ... ... ... ...) (run-hooks ...) (when inverse ...) =20 > (while ... ...) (setq line ...) (or ... ...) (setq start 0) =20 > (while ... ... ... ... ... ... ... ... ... ...) (if ... ...) (when =20 > org-export-with-footnotes ... ...) (cond ... ... ... ...))) > (let ((case-fold-search nil) (org-odd-levels-only odd)) (mapc =20 > (lambda ... ...) org-export-plist-vars) (setq umax (if arg ... org-=20 > export-headline-levels)) (setq umax-toc (if ... ... umax)) (unless =20 > body-only (insert ...) (org-export-html-insert-plist-item opt-=20 > plist :preamble opt-plist) (when ... ...)) (if (and org-export-with-=20= > toc ...) (progn ... ... ... ... ... ... ...)) (setq head-count 0) =20 > (org-init-section-numbers) (org-open-par) (while (setq line ... =20 > origline line) =20 > (catch=20 > ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... = ... ... ... ... ...)) (when=20 > inquote (insert "\n") (org-open-par)) (when in-local-list =20 > (while local-list-type ... ... ...) (setq local-list-indent nil in-=20 > local-list nil)) (org-html-level-start 1 nil umax (and org-export-=20 > with-toc ...) head-count) (when (and ... first-heading-pos) (insert =20= > "\n")) (save-excursion (goto-char ...) (while ... ... ...)) =20 > (when footnotes (insert ... "\n")) (let (...) (when bib ...)) =20 > (unless body-only (when ... ... ... ... ... ... ...) (if org-export-=20= > html-with-timestamp ...) (org-export-html-insert-plist-item opt-=20 > plist :postamble opt-plist) (insert "\n\n\n\n")) =20= > (unless (plist-get opt-plist :buffer-will-be-killed) (normal-mode) =20 > (if ... ...)) (goto-char (point-min)) (when thetoc =20 > (if ... ... ... ...) (insert "
\n") =20 > (mapc ... thetoc) (insert "
\n")) (goto-char (point-min)) =20 > (while (re-search-forward "

[ > \n ]*

" nil t) (replace-match "")) (goto-char (point-min)) = (while =20 > (re-search-forward "
  • [ > \n ]*
  • \n?" nil t) (replace-match "")) (goto-char (point-min)) =20= > (while (re-search-forward "\\s-*
      \n?" nil t) (replace-match =20= > "")) (goto-char (point-min)) (let (beg end n) =20 > (while ... ... ... ... ...)) (or to-buffer (save-buffer)) (goto-char =20= > (point-min)) (or (org-export-push-to-kill-ring "HTML") (message =20 > "Exporting... done")) (if (eq to-buffer ...) (prog1 ... ...) =20 > (current-buffer))) > (let* ((opt-plist ...) (body-only ...) (style ...) (html-=20 > extension ...) (link-validate ...) valid thetoc have-headings first-=20= > heading-pos (odd org-odd-levels-only) (region-p ...) (rbeg ...) =20 > (rend ...) (subtree-p ...) (level-offset ...) (opt-plist ...) (org-=20 > current-export-dir ...) (org-current-export-file buffer-file-name) =20 > (level 0) (line "") (origline "") txt todo (umax nil) (umax-toc nil) =20= > (filename ...) (current-dir ...) (buffer ...) (org-levels-open ...) =20= > (date ...) (author ...) (title ...) (link-up ...) (link-home ...) =20 > (dummy ...) (html-table-tag ...) (quote-re0 ...) (quote-re ...) =20 > (inquote nil) (infixed nil) (inverse nil) (in-local-list nil) (local-=20= > list-type nil) (local-list-indent nil) (llt org-plain-list-ordered-=20 > item-terminator) (email ...) (language ...) (keywords ...) =20 > (description ...) (lang-words nil) ...) (let (...) (org-=20 > unmodified ...)) (message "Exporting...") (setq org-min-level (org-=20 > get-min-level lines level-offset)) (setq org-last-level org-min-=20 > level) (org-init-section-numbers) (cond (... ...) (date) (t ...)) =20 > (setq lang-words (or ... ...)) (set-buffer buffer) (let (...) (erase-=20= > buffer)) (fundamental-mode) (org-install-letbind) (and (fboundp ...) =20= > (set-buffer-file-coding-system coding-system-for-write)) (let =20 > (... ...) (mapc ... org-export-plist-vars) (setq umax ...) (setq =20 > umax-toc ...) (unless body-only ... ... ...) (if ... ...) (setq head-=20= > count 0) (org-init-section-numbers) (org-open-par) (while ... ...) =20 > (when inquote ... ...) (when in-local-list ... ...) (org-html-level-=20= > start 1 nil umax ... head-count) (when ... ...) (save-=20 > excursion ... ...) (when footnotes ...) (let ... ...) (unless body-=20 > only ... ... ... ...) (unless ... ... ...) (goto-char ...) (when =20 > thetoc ... ... ... ...) (goto-char ...) (while ... ...) (goto-=20 > char ...) (while ... ...) (goto-char ...) (while ... ...) (goto-=20 > char ...) (let ... ...) (or to-buffer ...) (goto-char ...) =20 > (or ... ...) (if ... ... ...))) > org-export-as-html(nil nil (:buffer-will-be-killed t :base-=20 > directory "./" :recursive t :publishing-directory "../=20 > public_html/" :base-extension "org" :publishing-function org-publish-=20= > org-to-html :section-numbers nil :table-of-contents nil :author-info =20= > nil :creator-info nil :style-include-default nil :style " \"stylesheet\" type=3D\"text/css\" href=3D\"assets/css/common.css\"/=20= > >" :timestamp nil :preamble "\n
      \n
      \">
      \n
        \n
      \n
      \"clearfix\">\n
      \n

      Company

      \n\n\n
      \n

      src=3D\"assets/images/success.png\" alt=3D\"assets/images/success.png=20= > \" />

      \n
      \n
      \n\n
      \n\n" :postamble "\n\n
      \n\n
      \n
      \"footer\">All content copyright © 2009 Company, all =20 > rights reserved.
      \n
      \n
      \n" :auto-preamble =20 > nil :auto-postamble nil :auto-index t :index-filename =20 > "sitemap.org" :index-title "Sitemap") nil nil "/home/llg/devel/=20 > Internet/public_html/") > funcall(org-export-as-html nil nil (:buffer-will-be-killed t :base-=20= > directory "./" :recursive t :publishing-directory "../=20 > public_html/" :base-extension "org" :publishing-function org-publish-=20= > org-to-html :section-numbers nil :table-of-contents nil :author-info =20= > nil :creator-info nil :style-include-default nil :style " \"stylesheet\" type=3D\"text/css\" href=3D\"assets/css/common.css\"/=20= > >" :timestamp nil :preamble "\n
      \n
      \">
      \n
        \n
      \n
      \"clearfix\">\n
      \n

      Company

      \n\n\n
      \n

      src=3D\"assets/images/success.png\" alt=3D\"assets/images/success.png=20= > \" />

      \n
      \n
      \n\n
      \n\n" :postamble "\n\n
      \n\n
      \n
      \"footer\">All content copyright © 2009 Company, all =20 > rights reserved.
      \n
      \n
      \n" :auto-preamble =20 > nil :auto-postamble nil :auto-index t :index-filename =20 > "sitemap.org" :index-title "Sitemap") nil nil "/home/llg/devel/=20 > Internet/public_html/") > (setq export-buf-or-file (funcall (intern ...) (plist-get =20 > plist :headline-levels) nil plist nil nil pub-dir)) > (let* ((plist ...) (init-buf ...) (init-point ...) (init-buf-=20 > string ...) export-buf-or-file) (run-hooks (quote org-publish-before-=20= > export-hook)) (setq export-buf-or-file (funcall ... ... nil plist =20 > nil nil pub-dir)) (when (and ... ...) (set-buffer export-buf-or-=20 > file) (and ... ...) (kill-buffer export-buf-or-file)) (set-buffer =20 > init-buf) (when (buffer-modified-p init-buf) (erase-buffer) (insert =20= > init-buf-string) (save-buffer) (goto-char init-point)) (unless =20 > visiting (kill-buffer init-buf))) > (save-excursion (switch-to-buffer (or visiting ...)) (let* =20 > (... ... ... ... export-buf-or-file) (run-hooks ...) (setq export-=20 > buf-or-file ...) (when ... ... ... ...) (set-buffer init-buf) =20 > (when ... ... ... ... ...) (unless visiting ...))) > (let ((visiting ...)) (save-excursion (switch-to-buffer ...) =20 > (let* ... ... ... ... ... ... ...))) > org-publish-org-to("html" (:base-directory "./" :recursive =20 > t :publishing-directory "../public_html/" :base-extension =20 > "org" :publishing-function org-publish-org-to-html :section-numbers =20= > nil :table-of-contents nil :author-info nil :creator-info nil :style-=20= > include-default nil :style " \" href=3D\"assets/css/common.css\"/>" :timestamp nil :preamble =20 > "\n
      \n
      \n
        =20 > \n
      \n
      \n
      =20 > \n

      Company

      \n\n=20 > \n
      \n

      alt=3D\"assets/images/success.png\" />

      \n
      \n
      \n\n
      \"col_2\">\n=20 > \n" :postamble "\n=20= > \n
      \n\n
      \n
      All content copyright =20= > © 2009 Company, all rights reserved.
      \n
      \n div>\n" :auto-preamble nil :auto-postamble nil :auto-index t :index-=20= > filename "sitemap.org" :index-title "Sitemap") "/home/llg/devel/=20 > Internet/source/agile-software-development.org" "/home/llg/devel/=20 > Internet/public_html/") > org-publish-org-to-html((:base-directory "./" :recursive =20 > t :publishing-directory "../public_html/" :base-extension =20 > "org" :publishing-function org-publish-org-to-html :section-numbers =20= > nil :table-of-contents nil :author-info nil :creator-info nil :style-=20= > include-default nil :style " \" href=3D\"assets/css/common.css\"/>" :timestamp nil :preamble =20 > "\n
      \n
      \n
        =20 > \n
      \n
      \n
      =20 > \n

      Company

      \n\n=20 > \n
      \n

      alt=3D\"assets/images/success.png\" />

      \n
      \n
      \n\n
      \"col_2\">\n=20 > \n" :postamble "\n=20= > \n
      \n\n
      \n
      All content copyright =20= > © 2009 Company, all rights reserved.
      \n
      \n div>\n" :auto-preamble nil :auto-postamble nil :auto-index t :index-=20= > filename "sitemap.org" :index-title "Sitemap") "/home/llg/devel/=20 > Internet/source/agile-software-development.org" "/home/llg/devel/=20 > Internet/public_html/") > funcall(org-publish-org-to-html (:base-directory "./" :recursive =20 > t :publishing-directory "../public_html/" :base-extension =20 > "org" :publishing-function org-publish-org-to-html :section-numbers =20= > nil :table-of-contents nil :author-info nil :creator-info nil :style-=20= > include-default nil :style " \" href=3D\"assets/css/common.css\"/>" :timestamp nil :preamble =20 > "\n
      \n
      \n
        =20 > \n
      \n
      \n
      =20 > \n

      Company

      \n\n=20 > \n
      \n

      alt=3D\"assets/images/success.png\" />

      \n
      \n
      \n\n
      \"col_2\">\n=20 > \n" :postamble "\n=20= > \n
      \n\n
      \n
      All content copyright =20= > © 2009 Company, all rights reserved.
      \n
      \n div>\n" :auto-preamble nil :auto-postamble nil :auto-index t :index-=20= > filename "sitemap.org" :index-title "Sitemap") "/home/llg/devel/=20 > Internet/source/agile-software-development.org" "/home/llg/devel/=20 > Internet/public_html/") > (progn (funcall publishing-function project-plist filename tmp-pub-=20= > dir) (org-publish-update-timestamp filename pub-dir publishing-=20 > function)) > (if (org-publish-needed-p filename pub-dir publishing-function tmp-=20= > pub-dir) (progn (funcall publishing-function project-plist filename =20= > tmp-pub-dir) (org-publish-update-timestamp filename pub-dir =20 > publishing-function))) > (when (org-publish-needed-p filename pub-dir publishing-function =20 > tmp-pub-dir) (funcall publishing-function project-plist filename tmp-=20= > pub-dir) (org-publish-update-timestamp filename pub-dir publishing-=20 > function)) > (if (listp publishing-function) (mapc (lambda ... ...) publishing-=20 > function) (when (org-publish-needed-p filename pub-dir publishing-=20 > function tmp-pub-dir) (funcall publishing-function project-plist =20 > filename tmp-pub-dir) (org-publish-update-timestamp filename pub-dir =20= > publishing-function))) > (let* ((project ...) (project-plist ...) (ftname ...) (publishing-=20 > function ...) (base-dir ...) (pub-dir ...) tmp-pub-dir) (setq tmp-=20 > pub-dir (file-name-directory ...)) (if (listp publishing-function) =20 > (mapc ... publishing-function) (when ... ... ...))) > org-publish-file("/home/llg/devel/Internet/source/agile-software-=20 > development.org") > (let ((org-publish-use-timestamps-flag ...)) (org-publish-file =20 > (buffer-file-name))) > (save-window-excursion (let (...) (org-publish-file ...))) > org-publish-current-file(nil) > call-interactively(org-publish-current-file) > command-execute(org-publish-current-file) > command-line-1(("--load" "./Org2HTML.el" "--visit=3Dagile-software-=20= > development.org" "--funcall" "org-publish-current-file")) > command-line() > normal-top-level() > --8<---------------cut here---------------end--------------->8--- > > > I tried to understand what could be wrong, but don't see anything =20 > special with > the time-stamps. > > Any idea? > > Best regards, > Seb > > PS- 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 " \"assets/css/common.css\"/>" > :timestamp nil > :preamble " >
      >
      >
        >
      >
      >
      >

      Company

      > > >
      >

      3D\"assets/images/=20 success.png\" />

      >
      >
      > >
      > > " > :postamble " > >
      > >
      >
      All content copyright © 2009 Company, = =20 > all rights reserved.
      >
      >
      > " > :auto-preamble nil > :auto-postamble nil > :auto-index t ; Generate index.org =20 > automagically... > :index-filename "sitemap.org" ; ... call it sitemap.org ... > :index-title "Sitemap" ; ... with title 'Sitemap'. > ))) > --8<---------------cut here---------------end--------------->8--- > > --=20 > S=E9bastien Vauban > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode