emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to get to work non-interactive publishing?
@ 2012-05-18  2:40 Mikhail Titov
  2012-05-18 12:19 ` Eric Schulte
  0 siblings, 1 reply; 8+ messages in thread
From: Mikhail Titov @ 2012-05-18  2:40 UTC (permalink / raw)
  To: emacs-orgmode

Hello!

I can publish project if I don’t use –-batch . So the following works just fine:    emacs -nw --eval '(org-publish-project "myproj")'

However nothing happens if I try emacs --batch --eval '(org-publish-project "myproj")'

Does anybody have an idea how to pin point the problem? It just returns almost instantaneously with no output to stderr.

I do use ESS, and I have lots of R code some of which is intentionally non-cached. I’m running GNU Emacs 24.1.50.2 (revno: 108254) with default orgmode if it makes any difference.

Thank you,
Mikhail

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get to work non-interactive publishing?
  2012-05-18  2:40 How to get to work non-interactive publishing? Mikhail Titov
@ 2012-05-18 12:19 ` Eric Schulte
  2012-05-20  0:13   ` Mikhail Titov
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2012-05-18 12:19 UTC (permalink / raw)
  To: Mikhail Titov; +Cc: emacs-orgmode

"Mikhail Titov" <mlt@gmx.us> writes:

> Hello!
>
> I can publish project if I don’t use –-batch . So the following works
> just fine: emacs -nw --eval '(org-publish-project "myproj")'
>
> However nothing happens if I try emacs --batch --eval '(org-publish-project "myproj")'
>
> Does anybody have an idea how to pin point the problem? It just
> returns almost instantaneously with no output to stderr.
>
> I do use ESS, and I have lots of R code some of which is intentionally
> non-cached. I’m running GNU Emacs 24.1.50.2 (revno: 108254) with
> default orgmode if it makes any difference.
>
> Thank you,
> Mikhail
>

Hi Mikhail,

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 have a number of projects in which I
export using a batch Emacs process (generally from a make file).  My
Makefile rules tend to look like the following.

    EMACS=emacs
    BATCH_EMACS=$(EMACS) --batch -Q -l init.el document.org

    ...

    document.tex: document.org init.el
            $(BATCH_EMACS) -f org-export-as-latex

where init.el contains all of the init necessary for the particular
project.  For a complete working example see the replication materials
at http://www.jstatsoft.org/v46/i03.

Best,

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get to work non-interactive publishing?
  2012-05-20  0:13   ` Mikhail Titov
@ 2012-05-19 22:38     ` Eric Schulte
  2012-05-21 19:57       ` Mikhail Titov
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2012-05-19 22:38 UTC (permalink / raw)
  To: Mikhail Titov; +Cc: emacs-orgmode

Mikhail Titov <mlt@gmx.us> writes:

> On 05/18/2012 07:19 AM, Eric Schulte wrote:
>>> I can publish project if I don’t use –-batch . So the following works
>>> just fine: emacs -nw --eval '(org-publish-project "myproj")'
>>>
>>> However nothing happens if I try emacs --batch --eval '(org-publish-project "myproj")'
>>>
>>> Does anybody have an idea how to pin point the problem? It just
>>> returns almost instantaneously with no output to stderr.
>>>
>>> I do use ESS, and I have lots of R code some of which is intentionally
>>> non-cached. I’m running GNU Emacs 24.1.50.2 (revno: 108254) with
>>> default orgmode if it makes any difference.
>> 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 have a number of projects in which I
>> export using a batch Emacs process (generally from a make file).  My
>> Makefile rules tend to look like the following.
>>
>>     EMACS=emacs
>>     BATCH_EMACS=$(EMACS) --batch -Q -l init.el document.org
>>
>>     ...
>>
>>     document.tex: document.org init.el
>>             $(BATCH_EMACS) -f org-export-as-latex
>>
>> where init.el contains all of the init necessary for the particular
>> project.  For a complete working example see the replication materials
>> at http://www.jstatsoft.org/v46/i03.
> 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.
>

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?
>

I don't believe that there is an automated way to raise such warnings.
You could do a binary search through your init.

>
> I mean what is the point to make a separate init file other than
> speed?
>

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.

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.

Best,

>
> M.
>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get to work non-interactive publishing?
  2012-05-18 12:19 ` Eric Schulte
@ 2012-05-20  0:13   ` Mikhail Titov
  2012-05-19 22:38     ` Eric Schulte
  0 siblings, 1 reply; 8+ messages in thread
From: Mikhail Titov @ 2012-05-20  0:13 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

On 05/18/2012 07:19 AM, Eric Schulte wrote:
>> I can publish project if I don’t use –-batch . So the following works
>> just fine: emacs -nw --eval '(org-publish-project "myproj")'
>>
>> However nothing happens if I try emacs --batch --eval '(org-publish-project "myproj")'
>>
>> Does anybody have an idea how to pin point the problem? It just
>> returns almost instantaneously with no output to stderr.
>>
>> I do use ESS, and I have lots of R code some of which is intentionally
>> non-cached. I’m running GNU Emacs 24.1.50.2 (revno: 108254) with
>> default orgmode if it makes any difference.
> 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 have a number of projects in which I
> export using a batch Emacs process (generally from a make file).  My
> Makefile rules tend to look like the following.
>
>     EMACS=emacs
>     BATCH_EMACS=$(EMACS) --batch -Q -l init.el document.org
>
>     ...
>
>     document.tex: document.org init.el
>             $(BATCH_EMACS) -f org-export-as-latex
>
> where init.el contains all of the init necessary for the particular
> project.  For a complete working example see the replication materials
> at http://www.jstatsoft.org/v46/i03.
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.

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?

I mean what is the point to make a separate init file other than speed?

M.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get to work non-interactive publishing?
  2012-05-21 19:57       ` Mikhail Titov
@ 2012-05-21 18:10         ` Eric Schulte
  2012-05-21 21:06           ` Mikhail Titov
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2012-05-21 18:10 UTC (permalink / raw)
  To: Mikhail Titov; +Cc: emacs-orgmode

"Mikhail Titov" <mlt@gmx.us> writes:

>> -----Original Message-----
>> From: emacs-orgmode-bounces+mlt=gmx.us@gnu.org [mailto:emacs-orgmode-
>> bounces+mlt=gmx.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?
>> 
>> >>> I can publish project if I don’t use –-batch . So the 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.
>> >
>> 
>> 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?
>> >
>> 
>> 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?
>> >
>> 
>> 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.
>> 
>> 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 in HTML starting like
>
> <pre class="src src-R">  <span style="color: #cd00cd;">library</span>(RODBC)
>
> However, if I do
>
> emacs -Q --batch -l myinit.el -f 'org-publish-all'
>
> then I get something like
>
> <pre class="src src-R"><span style="font-weight: bold; text-decoration: underline;">library</span>(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 loaded 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
>
>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get to work non-interactive publishing?
  2012-05-19 22:38     ` Eric Schulte
@ 2012-05-21 19:57       ` Mikhail Titov
  2012-05-21 18:10         ` Eric Schulte
  0 siblings, 1 reply; 8+ messages in thread
From: Mikhail Titov @ 2012-05-21 19:57 UTC (permalink / raw)
  To: 'Eric Schulte'; +Cc: emacs-orgmode

> -----Original Message-----
> From: emacs-orgmode-bounces+mlt=gmx.us@gnu.org [mailto:emacs-orgmode-
> bounces+mlt=gmx.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?
> 
> >>> I can publish project if I don’t use –-batch . So the 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.
> >
> 
> 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?
> >
> 
> 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?
> >
> 
> 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.
> 
> 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 in HTML starting like

<pre class="src src-R">  <span style="color: #cd00cd;">library</span>(RODBC)

However, if I do

emacs -Q --batch -l myinit.el -f 'org-publish-all'

then I get something like

<pre class="src src-R"><span style="font-weight: bold; text-decoration: underline;">library</span>(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 loaded which does in interactive mode, or vice versa.

Mikhail

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get to work non-interactive publishing?
  2012-05-21 18:10         ` Eric Schulte
@ 2012-05-21 21:06           ` Mikhail Titov
  2012-05-21 21:09             ` Mikhail Titov
  0 siblings, 1 reply; 8+ messages in thread
From: Mikhail Titov @ 2012-05-21 21:06 UTC (permalink / raw)
  To: 'Eric Schulte'; +Cc: emacs-orgmode

> -----Original Message-----
> From: Eric Schulte [mailto:eric.schulte@gmx.com]
> Sent: Monday, May 21, 2012 1:11 PM
> To: Mikhail Titov
> Cc: emacs-orgmode@gnu.org
> Subject: Re: [O] How to get to work non-interactive publishing?
> 
> ...
>
> > 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 in
> HTML starting like
> >
> > <pre class="src src-R">  <span style="color: #cd00cd;">library</span>(RODBC)
> >
> > However, if I do
> >
> > emacs -Q --batch -l myinit.el -f 'org-publish-all'
> >
> > then I get something like
> >
> > <pre class="src src-R"><span style="font-weight: bold; text-decoration:
> underline;">library</span>(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
> loaded 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.

Thank you for the explanation!

Also I just noticed [1]. For now, I can just use -nw and (kill-emacs) after publishing is done and deal with CSS fine tuning later.

[1] http://stackoverflow.com/questions/3591337/emacs-htmlize-in-batch-mode

M.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How to get to work non-interactive publishing?
  2012-05-21 21:06           ` Mikhail Titov
@ 2012-05-21 21:09             ` Mikhail Titov
  0 siblings, 0 replies; 8+ messages in thread
From: Mikhail Titov @ 2012-05-21 21:09 UTC (permalink / raw)
  To: 'Eric Schulte'; +Cc: emacs-orgmode

> -----Original Message-----
> From: emacs-orgmode-bounces+mlt=gmx.us@gnu.org [mailto:emacs-orgmode-
> bounces+mlt=gmx.us@gnu.org] On Behalf Of Mikhail Titov
> Sent: Monday, May 21, 2012 4:06 PM
> To: 'Eric Schulte'
> Cc: emacs-orgmode@gnu.org
> Subject: Re: [O] How to get to work non-interactive publishing?
> 
> ...
>
> > 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.
> 
> Thank you for the explanation!
> 
> Also I just noticed [1]. For now, I can just use -nw and (kill-emacs) after
> publishing is done and deal with CSS fine tuning later.

Did not read careful enough about crontab. I'll go CSS way.

> 
> [1] http://stackoverflow.com/questions/3591337/emacs-htmlize-in-batch-mode
> 
> M.
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-05-21 21:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-18  2:40 How to get to work non-interactive publishing? Mikhail Titov
2012-05-18 12:19 ` Eric Schulte
2012-05-20  0:13   ` Mikhail Titov
2012-05-19 22:38     ` Eric Schulte
2012-05-21 19:57       ` Mikhail Titov
2012-05-21 18:10         ` Eric Schulte
2012-05-21 21:06           ` Mikhail Titov
2012-05-21 21:09             ` Mikhail Titov

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).