Subject: How to trap errors in man?

From: Reuben Thomas <[email-masked]>
Date: Tue, 31 Jul 2012 12:53:43 +0100

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 initial script to do this used woman, but when there are man pages
in multiple sections with the same name, woman prompts for completion,
unlike the standalone info reader, which, like man, just fetches the
"first" man page of the right name.

Hence, I tried to adapt the script to use man instead of woman, but I
found it impossible, because of the way that man works asynchronously,
to trap the error when no man page is found. The problem is that the
error is trapped already, in Man-bgproc-sentinel, so the caller of
"man" cannot find out whether the call was successful.

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

-- 
http://rrt.sc3d.org