From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: How to get to work non-interactive publishing? Date: Mon, 21 May 2012 14:10:47 -0400 Message-ID: <87zk91l80o.fsf@gmx.com> References: <005401cd349f$a4382600$eca87200$@us> <87r4uhk7df.fsf@gmx.com> <4FB8373D.2030305@gmx.us> <87pq9zbxua.fsf@gmx.com> <008101cd378b$e993c5d0$bcbb5170$@us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWYwj-0002QH-Ao for emacs-orgmode@gnu.org; Mon, 21 May 2012 16:11:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWYwh-0001am-7f for emacs-orgmode@gnu.org; Mon, 21 May 2012 16:11:12 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:36406) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SWYwh-0001aP-1x for emacs-orgmode@gnu.org; Mon, 21 May 2012 16:11:11 -0400 In-Reply-To: <008101cd378b$e993c5d0$bcbb5170$@us> (Mikhail Titov's message of "Mon, 21 May 2012 14:57:10 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Mikhail Titov Cc: emacs-orgmode@gnu.org "Mikhail Titov" writes: >> -----Original Message----- >> From: emacs-orgmode-bounces+mlt=3Dgmx.us@gnu.org [mailto:emacs-orgmode- >> bounces+mlt=3Dgmx.us@gnu.org] On Behalf Of Eric Schulte >> Sent: Saturday, May 19, 2012 5:39 PM >> To: Mikhail Titov >> Cc: emacs-orgmode@gnu.org >> Subject: Re: [O] How to get to work non-interactive publishing? >>=20 >> >>> I can publish project if I don=E2=80=99t use =E2=80=93-batch . So th= e following works >> >>> just fine: emacs -nw --eval '(org-publish-project "myproj")' >> >>> >> >>> However nothing happens if I try emacs --batch --eval '(org-publish- >> project "myproj")' >> ... >> >> Using batch mode shouldn't be causing any problems with the export >> >> process, is it possible that something in your personal config is not >> >> compatible with batch-mode >> ... >> > I really did not want to create a separate init file as I was quite >> > happy with existing dot emacs. You are right. Something was in the way. >> > After I created a separate file that loads only necessary stuff, it >> > published fine. >> > >>=20 >> Happy it works, if you find the offending element of your persona >> configuration you could remove it and continue to use your personal >> config for batch publishing. >> > >> > So weird emacs did not give any error before that something is not >> > quite right. Is there an option for emacs so that some module can say >> > it can't work in a batch mode? >> > >>=20 >> I don't believe that there is an automated way to raise such warnings. >> You could do a binary search through your init. > > Part of my question was if there is an easy way to find it other than by = dichotomy? I guess not :-) > >> > I mean what is the point to make a separate init file other than >> > speed? >> > >>=20 >> Your main init file is used to customize Emacs for interactive editing, >> many (if not most) of these settings won't apply to batch evaluation. >>=20 >> By separating your personal customization from the project init file >> used for publishing it becomes possible to distribute your project with >> the publication init file without sharing your personal configuration. > > That makes it clear. > > Another weird issue I experience when batch-publishing is that even > with a separate init file, I get different "htmlization" of babel > blocks. I mean if I load > > emacs -nw -Q -l myinit.el project_part.org > > and publish that with C-c C-e P , then I get nicely colored babel block i= n HTML starting like > >
  library=
(RODBC)
>
> However, if I do
>
> emacs -Q --batch -l myinit.el -f 'org-publish-all'
>
> then I get something like
>
> 
library(RODBC)
>
> It seems odd to me that same config results in different outputs when
> publishing interactively and in a batch mode. I would prefer colored
> output.
>
> What should I pay attention to? I have a feeling that something is not lo=
aded which does in interactive mode, or vice versa.
>

The library used to colorize source code relies on the actual Emacs
colorization mechanisms, which aren't available in batch mode.  The best
solution in this case is to save your colorized CSS information into a
.css file with `org-export-htmlize-generate-css', and then use that file
in all of your exports by setting `org-export-htmlize-output-type' to
'css.  This way your fontification will be consistent across batch or
regular export.

Best,

>
> Mikhail
>
>

--=20
Eric Schulte
http://cs.unm.edu/~eschulte