Subject: bug#12098: How to trap errors in man?

From: Thierry Volpiatto <[email-masked]>
Date: Wed, 01 Aug 2012 10:27:52 +0200

Juri Linkov <[email-masked]> writes:

>> In a discussion on gnu-prog-discuss today, there was an attempt to
>> script Emacs as a standalone info reader. It was also desired to make
>> it format man pages (like the standalone info reader) for programs
>> that don't have an info manual.
>
> The Emacs Info reader can format man pages with the help
> of info-man.el.
>
>> Personally, I'd just rip out all the asynchronous stuff and make "man"
>> synchronous (I have man set to "bully" mode in my setup), but I am
>> guessing that would be an unpopular change,
>
> Yes, the delay when the whole session is freezing during formatting would
> be undesirable.  The current situation with asynchronous popping up buffers
> is not perfect either.  In bug#9084 we are trying to improve this by
> modifying man.el to work more like async shell commands.
`Man-getpage-in-background' use (if (fboundp 'start-process) to check if
it start an asynchronous process or not.
Why in Emacs-24 `start-process' would not exists?
Why instead don't you add an optional arg to `Man-getpage-in-background'
to make it synchronous?
It would be instead of (if (fboundp 'start-process):
(if synchronous start-man-synchronously start-man-async
This would allow to make an user variable that allow to choose if man is
async or not.
It is simple and change nothing to actual code.

>> so I'm wondering if there's some other way to make it possible to use
>> man synchronously and/or allow man's caller to find out about errors.
>
> You can use `Man-cooked-hook' that is called at the end of
> `Man-bgproc-sentinel'.  In this hook you can check whether the value of
> `Man-page-list' is nil.
>
>
>
>

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997