emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* A bit more feedback on org-publish-all
@ 2012-02-05 14:48 François Pinard
  2012-02-06  1:31 ` François Pinard
  0 siblings, 1 reply; 6+ messages in thread
From: François Pinard @ 2012-02-05 14:48 UTC (permalink / raw)
  To: emacs-orgmode

Hi, Orger friends.

When I execute org-publish-all, I would like to have some indication of
the progress, so I can follow what is going on.

The *Messages* buffer indeed gets crowded with many noisy lines, and I
can find hints about the project being processed though "Skipping
unmodified file SUCH-AND-SUCH" or "Loading .../PROJECT.cache" messages.
These lines may undoubtedly be useful when something goes wrong, but
otherwise, they just prevent the mini-buffer, say, to display some
clear "Publishing PROJECT..." message at the start of each project.

Such "Publishing PROJECT..." message would also be useful to me in
another way.  I'm using a script which launches "emacs -batch ... -f
org-publish-all" under the scene and filters its output to get rid of
all the noisy lines.  My hope is that errors, if any, will stand out.  I
could let such "Publishing" messages go through the filter, however.
Currently, I find that the script execution is a bit longish (I have a
few dozen projects), while being too silent.

I could probably manage with hooks of various kind and more
configuration to the org-publish-project-alist structure, but it would
look as overkill to me for getting such a benign feedback.

François

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

* Re: A bit more feedback on org-publish-all
  2012-02-05 14:48 A bit more feedback on org-publish-all François Pinard
@ 2012-02-06  1:31 ` François Pinard
  2012-02-06  3:38   ` Nick Dokos
  0 siblings, 1 reply; 6+ messages in thread
From: François Pinard @ 2012-02-06  1:31 UTC (permalink / raw)
  To: emacs-orgmode

pinard@iro.umontreal.ca (François Pinard) writes:

> When I execute org-publish-all, I would like to have some indication
> of the progress, so I can follow what is going on.  [...]  Such
> "Publishing PROJECT..." message would also be useful to me in another
> way.  [...] the script execution is a bit longish [...] while being
> too silent.

Hmph!

`emacs --batch' buffers its output.  So, "Publishing PROJECT" messages
would not be written timely, and the delaying would remove the
entertaining virtues.

Yet, such "Publishing PROJECT" messages would be helpful in case of any
error, as a kind of title prefixing it, and would ease debugging.

François

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

* Re: A bit more feedback on org-publish-all
  2012-02-06  1:31 ` François Pinard
@ 2012-02-06  3:38   ` Nick Dokos
  2012-02-06 14:56     ` François Pinard
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Dokos @ 2012-02-06  3:38 UTC (permalink / raw)
  To: =?utf-8?Q?Fran=C3=A7ois?= Pinard; +Cc: nicholas.dokos, emacs-orgmode

François Pinard <pinard@iro.umontreal.ca> wrote:

> pinard@iro.umontreal.ca (François Pinard) writes:
> 
> > When I execute org-publish-all, I would like to have some indication
> > of the progress, so I can follow what is going on.  [...]  Such
> > "Publishing PROJECT..." message would also be useful to me in another
> > way.  [...] the script execution is a bit longish [...] while being
> > too silent.
> 
> Hmph!
> 
> `emacs --batch' buffers its output.  So, "Publishing PROJECT" messages
> would not be written timely, and the delaying would remove the
> entertaining virtues.
> 
> Yet, such "Publishing PROJECT" messages would be helpful in case of any
> error, as a kind of title prefixing it, and would ease debugging.
> 

[I haven't looked at earlier messages in this thread, so I hope I
am not misinterpreting.]

(message "foo") prints to stderr in batch mode, which is an unbuffered
stream. E.g ``emacs --batch -l foo.el'' with foo.el containing

--8<---------------cut here---------------start------------->8---
(message "foo")
(sit-for 10)
--8<---------------cut here---------------end--------------->8---

prints out ``foo'' and then sits for 10 seconds before exiting.

Also, don't you get messages for every file? The only publishing I've
done recently is worg publishing (I publish locally to test any changes
I make before pushing). That gives me a fairly detailed list of what it
is doing. AFAICT, that's the default behavior, but there may be settings
I've overlooked. I would recommend looking at the worg publishing
mechanism in general. See

  http://orgmode.org/worg/worg-setup.html


particularly the sections entitled 

  - What .emacs.el file is used on the server?
  - I want it for my own server!

Nick

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

* Re: A bit more feedback on org-publish-all
  2012-02-06  3:38   ` Nick Dokos
@ 2012-02-06 14:56     ` François Pinard
  2012-02-06 15:21       ` Nick Dokos
  2012-02-06 15:27       ` Nick Dokos
  0 siblings, 2 replies; 6+ messages in thread
From: François Pinard @ 2012-02-06 14:56 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <nicholas.dokos@hp.com> writes:

> (message "foo") prints to stderr in batch mode, which is an unbuffered
> stream. E.g ``emacs --batch -l foo.el'' with foo.el containing

> (message "foo")
> (sit-for 10)

> prints out ``foo'' and then sits for 10 seconds before exiting.

Hi, Nick.

It seems you are right.  I initially guessed that -batch might have
Emacs to allocate an output buffer, or at least do it when output is not
directed to a terminal.  But it even works as you say if I do:

emacs 2>&1 --batch -l foo.el | cat

This is more similar to my actual usage, which really is:

        [...]
        write = sys.stderr.write
        for line in os.popen('emacs 2>&1 -batch'
                             ' -l ~/fp/notes/publish.el'
                             ' -f org-publish-all'):
            write(repr(line) + '\n')
            sys.stderr.flush()
            [...]

The write(...) and the flush() are only there for debugging: I wanted to
see if the lines are delivered timely or not (and I'm seemingly getting
the Emacs output in one blow).  I just do not understand why the
behavior differs between the "... | cat" line and the Python excerpt.
I'm surely missing something somewhere...  Sigh!

> Also, don't you get messages for every file?

Yes, and these messages usually say: "Skipping unmodified file ..."

On the "entertaining side", this is too much noise; I would have
preferred a mere line per project.  Not a big deal anyway for me.  On
the "debugging side", this is sufficient indeed.

> I would recommend looking at the worg publishing mechanism in
> general. See
>   http://orgmode.org/worg/worg-setup.html
> particularly the sections entitled 
>   - What .emacs.el file is used on the server?
>   - I want it for my own server!

Hey, thanks for this pointer, Nick; there seems to be useful hints or
tricks in there.  I'm saving it for later study.

I plan to progressively convert more of my previous pages to Org format,
and use it more for new pages too, as Org format and mode are so nice
for maintenance.  I plan to retain a few reStructuredText sources as
such, as reST also has it virtues for publishing.  I also hope that Org
publishing offers me opportunities for experimenting (OK, OK: toying!)
with new HTML/CSS avenues, I'm not familiar enough to be sure yet.

François

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

* Re: A bit more feedback on org-publish-all
  2012-02-06 14:56     ` François Pinard
@ 2012-02-06 15:21       ` Nick Dokos
  2012-02-06 15:27       ` Nick Dokos
  1 sibling, 0 replies; 6+ messages in thread
From: Nick Dokos @ 2012-02-06 15:21 UTC (permalink / raw)
  To: =?utf-8?Q?Fran=C3=A7ois?= Pinard; +Cc: nicholas.dokos, emacs-orgmode

François Pinard <pinard@iro.umontreal.ca> wrote:

> > Also, don't you get messages for every file?
> 
> Yes, and these messages usually say: "Skipping unmodified file ..."
> 
> On the "entertaining side", this is too much noise; I would have
> preferred a mere line per project.  Not a big deal anyway for me.  On
> the "debugging side", this is sufficient indeed.
> 

C-h v org-publish-list-skipped-files says:

,----
| org-publish-list-skipped-files is a variable defined in `org-publish.el'.
| Its value is t
| 
| Documentation:
| Non-nil means show message about files *not* published.
| 
`----

Nick

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

* Re: A bit more feedback on org-publish-all
  2012-02-06 14:56     ` François Pinard
  2012-02-06 15:21       ` Nick Dokos
@ 2012-02-06 15:27       ` Nick Dokos
  1 sibling, 0 replies; 6+ messages in thread
From: Nick Dokos @ 2012-02-06 15:27 UTC (permalink / raw)
  To: =?utf-8?Q?Fran=C3=A7ois?= Pinard; +Cc: nicholas.dokos, emacs-orgmode

François Pinard <pinard@iro.umontreal.ca> wrote:

> ... 
> This is more similar to my actual usage, which really is:
> 
>         [...]
>         write = sys.stderr.write
>         for line in os.popen('emacs 2>&1 -batch'
>                              ' -l ~/fp/notes/publish.el'
>                              ' -f org-publish-all'):
>             write(repr(line) + '\n')
>             sys.stderr.flush()
>             [...]
> 
> The write(...) and the flush() are only there for debugging: I wanted to
> see if the lines are delivered timely or not (and I'm seemingly getting
> the Emacs output in one blow).  I just do not understand why the
> behavior differs between the "... | cat" line and the Python excerpt.
> I'm surely missing something somewhere...  Sigh!
> 

I would recommend that you chuck the obsolete os.popen() permanently and
learn the subprocess module: you will be much happier. Setting bufsize=0
(which is the default) should give you unbuffered output from the process.

Nick

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

end of thread, other threads:[~2012-02-06 15:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-05 14:48 A bit more feedback on org-publish-all François Pinard
2012-02-06  1:31 ` François Pinard
2012-02-06  3:38   ` Nick Dokos
2012-02-06 14:56     ` François Pinard
2012-02-06 15:21       ` Nick Dokos
2012-02-06 15:27       ` Nick Dokos

Code repositories for project(s) associated with this 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).