From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: wrong-type-argument when publishing to HTML Date: Thu, 3 Sep 2009 10:19:34 +0200 Message-ID: References: <87ab1dk1vd.fsf@mundaneum.com> <74559A82-3F03-49B6-AA50-282D9D9542BF@gmail.com> <873a74sb03.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 1Mj7Xk-0005Wh-84 for emacs-orgmode@gnu.org; Thu, 03 Sep 2009 04:19:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mj7Xe-0005Le-Tt for emacs-orgmode@gnu.org; Thu, 03 Sep 2009 04:19:43 -0400 Received: from [199.232.76.173] (port=59064 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mj7Xe-0005LB-N6 for emacs-orgmode@gnu.org; Thu, 03 Sep 2009 04:19:38 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:40321) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mj7Xe-0005Se-Bf for emacs-orgmode@gnu.org; Thu, 03 Sep 2009 04:19:38 -0400 Received: by ewy7 with SMTP id 7so328730ewy.31 for ; Thu, 03 Sep 2009 01:19:37 -0700 (PDT) In-Reply-To: <873a74sb03.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 3, 2009, at 10:11 AM, S=E9bastien Vauban wrote: > Hi Carsten, > > Carsten Dominik wrote: >> On Sep 2, 2009, at 1:44 PM, S=E9bastien Vauban wrote: >> >>> A colleague of mine gets the error `(wrong-type-argument stringp =20 >>> nil)' when >>> executing the command (from a script, under Ubuntu and Emacs =20 >>> 22.2.1 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--- >>> >>> 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 =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 ...) (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") >>> [...] >>> --8<---------------cut here---------------end--------------->8--- >>> >>> I tried to understand what could be wrong, but don't see anything =20= >>> 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 ">> \"assets/css/=20 >>> common.css\"/>" >>> :timestamp nil >>> [...] >>> :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--- >> >> This looks to me as if the the file being published is not in org-=20 >> 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 =20 >> 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 =20= > org') > solved the problem of my colleague. Thanks. You are welcome. - Carsten