From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Lu Subject: Re: Publish-current-file error Date: Tue, 2 Feb 2010 18:13:20 -0500 Message-ID: <3cbb63d01002021513s7df5589eu852d6fa0e5e3ee7b@mail.gmail.com> References: <3cbb63d01002021430l179200fei70be0d36c6bbb1cb@mail.gmail.com> <12521.1265150160@alphaville.usa.hp.com> <3cbb63d01002021447l61bb747m97af29bde7e368b5@mail.gmail.com> <12934.1265151708@alphaville.usa.hp.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0943683178==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NcRwF-0000P1-5p for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 18:13:43 -0500 Received: from [199.232.76.173] (port=41561 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcRwE-0000ON-MO for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 18:13:42 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NcRwD-0006eX-Dn for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 18:13:42 -0500 Received: from mail-yw0-f189.google.com ([209.85.211.189]:65018) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NcRwD-0006eR-2R for emacs-orgmode@gnu.org; Tue, 02 Feb 2010 18:13:41 -0500 Received: by ywh27 with SMTP id 27so627983ywh.1 for ; Tue, 02 Feb 2010 15:13:40 -0800 (PST) In-Reply-To: <12934.1265151708@alphaville.usa.hp.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: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org, Carsten Dominik --===============0943683178== Content-Type: multipart/alternative; boundary=0016e68ee229972057047ea64095 --0016e68ee229972057047ea64095 Content-Type: text/plain; charset=ISO-8859-1 Hey Nick, Thanks a lot for your detailed explanation, now I'm pretty clear about the error. But I just get the idea why we could not publish arbitrary org file as html to current directory, I guess it could be kind of troublesome that every time to set up the project first? What do you think? Chao On Tue, Feb 2, 2010 at 6:01 PM, Nick Dokos wrote: > Chao Lu wrote: > > > I just start a new org file, say, PHY.org, type very simple words, then > > tried > > M-x org-publish-current-file. > > > > The *backtrace* tells: > > -------- > > Debugger entered--Lisp error: (wrong-type-argument stringp nil) > > file-name-as-directory(nil) > > ... and as you can see, the problem is that file-name-as-directory is > called > with a nil argument, whereas it expects a string. > > > (let* ((project-plist ...) (base-dir ...) (include-list ...) (recurse > ...) > > (extension ...) (match ...)) (setq org-publish-temp-files nil) > > (org-publish-get-base-files-1 base-dir recurse match exclude-regexp > > exclude-regexp) (mapc (lambda ... ...) include-list) > org-publish-temp-files) > > > org-publish-get-base-files(("options" :section-numbers nil > > :table-of-contents nil :style "") nil) > > ... and this tells us that org-publish-get-base-files got called and > somewhere in the execution of the let* form, it got the error. > So you look at that let* form in org-publish-get-base-files and you > see this: > > (let* ((project-plist (cdr project)) > (base-dir (file-name-as-directory > (plist-get project-plist :base-directory))) > ... > > which tells me that you *have* to have a project-plist and it *has* > to have a :base-directory property in order to be able to publish. > You just cannot take an arbitrary org file and publish it without > providing the publishing framework for it. > > HTH, > Nick > > > > > > > > > Today I was trying to publish a single org file using > > > > org-publish-current-file, however, org refused to do so, the error > > > message > > > > is > > > > > > > > ==== > > > > let*: Wrong type argument: stringp, nil > > > > ==== > > > > > > > > I believe the org-publish function work well, for I could get the > > > > pre-defined project published smoothly. So do anyone has met similar > > > > problem? > > > > > > > > > > Please set debug-on-error to t and after recreating the error, post the > > > resulting backtrace. See the "Feedback" section of the Org manual for > more > > > details on how to report problems. > > > > > > HTH, > > > Nick > --0016e68ee229972057047ea64095 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hey Nick,

Thanks a lot for your detailed explanation, now I'm pr= etty clear about the error. But I just get the idea why we could not publis= h arbitrary org file as html to current directory, I guess it could be kind= of troublesome that every time to set up the project first?

What do you think?

Chao

On Tu= e, Feb 2, 2010 at 6:01 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
Chao Lu <loochao@= gmail.com> wrote:

> I just start a new org file, say, PHY.org, typ= e very simple words, then
> tried
> M-x org-publish-current-file.
>
> The *backtrace* tells:
> --------
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
> =A0 file-name-as-directory(nil)

... and as you can see, the problem is that file-name-as-directory is= called
with a nil argument, whereas it expects a string.

> =A0 (let* ((project-plist ...) (base-dir ...) (include-list ...) (recu= rse ...)
> (extension ...) (match ...)) (setq org-publish-temp-files nil)
> (org-publish-get-base-files-1 base-dir recurse match exclude-regexp > exclude-regexp) (mapc (lambda ... ...) include-list) org-publish-temp-= files)

> =A0 org-publish-get-base-files(("options" :section-numbers n= il
> :table-of-contents nil :style "<script
> type=3D\"text/javascript\">\n =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0/* <![CDATA[ */\n
> org_html_manager.set(" TOC ", 1);\n =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0org_html_manager.set("
> LOCAL_TOC ", 1);\n =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0org_html_manage= r.set(" VIEW_BUTTONS ", "
> true ");\n =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0org_html_manager.set(&q= uot; MOUSE_HINT ", " underline
> "); // or background-color like '#eeeeee'\n
> org_html_manager.setup ();\n =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* ]]> = */\n
> </script>") nil)

... and this tells us that org-publish-get-base-files got called and<= br> somewhere in the execution of the let* form, it got the error.
So you look at that let* form in org-publish-get-base-files and you
see this:

=A0(let* ((project-plist (cdr project))
=A0 =A0 =A0 =A0 (base-dir (file-name-as-directory
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(plist-get project-plist :base-dire= ctory)))
=A0 =A0 =A0 =A0 ...

which tells me that you *have* to have a project-plist and it *has*
to have a :base-directory property in order to be able to publish.
You just cannot take an arbitrary org file and publish it without
providing the publishing framework for it.

HTH,
Nick


> >
> > > Today I was trying to publish a single org file using
> > > org-publish-current-file, however, org refused to do so, the= error
> > message
> > > is
> > >
> > > =3D=3D=3D=3D
> > > let*: Wrong type argument: stringp, nil
> > > =3D=3D=3D=3D
> > >
> > > I believe the org-publish function work well, for I could ge= t the
> > > pre-defined project published smoothly. So do anyone has met= similar
> > > problem?
> > >
> >
> > Please set debug-on-error to t and after recreating the error, po= st the
> > resulting backtrace. See the "Feedback" section of the = Org manual for more
> > details on how to report problems.
> >
> > HTH,
> > Nick

--0016e68ee229972057047ea64095-- --===============0943683178== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0943683178==--