GNU bug report logs - #12098
How to trap errors in man?

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Reuben Thomas <rrt@HIDDEN>; dated Tue, 31 Jul 2012 12:02:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 12098 <at> debbugs.gnu.org:


Received: (at 12098) by debbugs.gnu.org; 2 Aug 2012 05:28:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 02 01:28:13 2012
Received: from localhost ([127.0.0.1]:55820 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwnxF-0007mC-Ek
	for submit <at> debbugs.gnu.org; Thu, 02 Aug 2012 01:28:13 -0400
Received: from mail-wi0-f174.google.com ([209.85.212.174]:36788)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <thierry.volpiatto@HIDDEN>) id 1SwnxB-0007m2-KZ
	for 12098 <at> debbugs.gnu.org; Thu, 02 Aug 2012 01:28:12 -0400
Received: by wibhr14 with SMTP id hr14so3795627wib.15
	for <12098 <at> debbugs.gnu.org>; Wed, 01 Aug 2012 22:20:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:references:date:in-reply-to:message-id
	:user-agent:mime-version:content-type;
	bh=oCimwsR+gG5LNn69e8Yl3qIXZE0UDFZGpWH/F99BpjE=;
	b=Q648acNFVng4xs2qulJm4Ho88TwLo4362DXxGkmYDIBTj05/z4W46PvVsKTp4sL2ME
	yXwmm5O64Wm0ELGylpFOqtMbhre6CdNEMajwiwMCA7bMH6mjDXuczOODYnumZ3dQVAVD
	gjgNvF9CSkmNOzo8l8mZ5rI7wQNWtepF8LKl55xtkWeYcNaJLorgFKvVqqGwG+NTUJST
	0xh0jtk0Z41Qyil+vw1KrqA5K1aeCUx/KdR93+FlDzj85S6rX8rSYbhwdcdOS+iybAvq
	qRUPho6qzVdDi9IZpryi4MK4N33PDKMb79nUNRQvJSIjJUMfzDI3QYW3GerOn7vrnLX1
	63Qw==
Received: by 10.180.105.6 with SMTP id gi6mr1603547wib.4.1343884840124;
	Wed, 01 Aug 2012 22:20:40 -0700 (PDT)
Received: from thierry-MM061 (lbe83-2-78-243-104-167.fbx.proxad.net.
	[78.243.104.167])
	by mx.google.com with ESMTPS id bc2sm14436024wib.0.2012.08.01.22.20.38
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 01 Aug 2012 22:20:39 -0700 (PDT)
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#12098: How to trap errors in man?
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<87pq7b5uvr.fsf@HIDDEN> <87ehnrqanr.fsf@HIDDEN>
	<87txwnvwao.fsf@HIDDEN> <87a9yfq98z.fsf@HIDDEN>
	<876293q7tv.fsf@HIDDEN> <87ehnqb4i9.fsf@HIDDEN>
Date: Thu, 02 Aug 2012 07:20:28 +0200
In-Reply-To: <87ehnqb4i9.fsf@HIDDEN> (Juri Linkov's message of "Thu,
	02 Aug 2012 02:12:05 +0300")
Message-ID: <87obmtkgyr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 12098
Cc: 12098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

Juri Linkov <juri@HIDDEN> writes:

>> Also `Man-notify-method' should be more accessible (more let-bindable)
>> probably by making it local, but I may be wrong there (need to look at
>> the code).
>
> This will be possible when you let-bind both `Man-notify-method'
> and `Man-async':
>
>   (let ((Man-async nil) (Man-notify-method 'pushy)) (man "bash"))
Ok thanks.

>> Also while you are at it, it would be helpful to add a 't' value to the
>> require-match arg of completing-read in `man'.
>
> But what if `man' is unable to get a complete list of all available man pages?
> Then you can't read some man pages.  For instance, this happens when
> you install a new package with a man page, but Man-completion-cache
> is not updated.  This is a very rare problem, and you can still
> read the man page by entering its name without completion.
It would be better in this case to reload the cache e.g with a prefix
arg do (setq Man-completion-cache nil) before calling completing-read.
 

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at 12098 <at> debbugs.gnu.org:


Received: (at 12098) by debbugs.gnu.org; 1 Aug 2012 23:23:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 01 19:23:37 2012
Received: from localhost ([127.0.0.1]:55532 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwiGO-00088Q-GQ
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 19:23:36 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:59043
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1SwiGM-00088I-Cu
	for 12098 <at> debbugs.gnu.org; Wed, 01 Aug 2012 19:23:35 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 2E7E9451CBA6;
	Wed,  1 Aug 2012 16:16:05 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
Subject: Re: bug#12098: How to trap errors in man?
Organization: JURTA
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<87pq7b5uvr.fsf@HIDDEN> <87ehnrqanr.fsf@HIDDEN>
	<87txwnvwao.fsf@HIDDEN> <87a9yfq98z.fsf@HIDDEN>
	<876293q7tv.fsf@HIDDEN>
Date: Thu, 02 Aug 2012 02:12:05 +0300
In-Reply-To: <876293q7tv.fsf@HIDDEN> (Thierry Volpiatto's message of "Wed, 
	01 Aug 2012 11:29:00 +0200")
Message-ID: <87ehnqb4i9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12098
Cc: 12098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> Also `Man-notify-method' should be more accessible (more let-bindable)
> probably by making it local, but I may be wrong there (need to look at
> the code).

This will be possible when you let-bind both `Man-notify-method'
and `Man-async':

  (let ((Man-async nil) (Man-notify-method 'pushy)) (man "bash"))

> Also while you are at it, it would be helpful to add a 't' value to the
> require-match arg of completing-read in `man'.

But what if `man' is unable to get a complete list of all available man pages?
Then you can't read some man pages.  For instance, this happens when
you install a new package with a man page, but Man-completion-cache
is not updated.  This is a very rare problem, and you can still
read the man page by entering its name without completion.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at 12098 <at> debbugs.gnu.org:


Received: (at 12098) by debbugs.gnu.org; 1 Aug 2012 23:23:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 01 19:23:33 2012
Received: from localhost ([127.0.0.1]:55529 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwiGK-000887-W8
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 19:23:33 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:59032
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1SwiGJ-00087y-VY
	for 12098 <at> debbugs.gnu.org; Wed, 01 Aug 2012 19:23:32 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id C6BC3451CBB2;
	Wed,  1 Aug 2012 16:16:03 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Andy Moreton <andrewjmoreton@HIDDEN>
Subject: Re: bug#12098: How to trap errors in man?
Organization: JURTA
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<87pq7b5uvr.fsf@HIDDEN>
	<CAOnWdojuXbGxbznYWkJPrZOZyq=XRwp5WvN6PppMHCP0i9oLWw@HIDDEN>
	<vz139472d8o.fsf@HIDDEN>
Date: Thu, 02 Aug 2012 02:10:54 +0300
In-Reply-To: <vz139472d8o.fsf@HIDDEN> (Andy Moreton's message of "Wed, 01
	Aug 2012 10:05:59 +0100")
Message-ID: <87lihycjld.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12098
Cc: 12098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> things freezing for any reason should be something to be removed
> everywhere, not an excuse for allowing more badness.
>
> Async fetching and formatting of man pages is very useful if the man
> page is on a remote host running a different OS.

I guess the distinction is exactly like between sync and async
shell commands.  When you know that a command will finish quickly,
`shell-command' is more preferable, whereas `async-shell-command'
is better for a long-running process.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at 12098 <at> debbugs.gnu.org:


Received: (at 12098) by debbugs.gnu.org; 1 Aug 2012 11:19:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 01 07:19:19 2012
Received: from localhost ([127.0.0.1]:54270 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwWxS-0007R7-DZ
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 07:19:19 -0400
Received: from exprod7og120.obsmtp.com ([64.18.2.18]:52640)
	by debbugs.gnu.org with smtp (Exim 4.72)
	(envelope-from <rrt@HIDDEN>) id 1SwWxQ-0007Qy-0M
	for 12098 <at> debbugs.gnu.org; Wed, 01 Aug 2012 07:19:17 -0400
Received: from mail-yw0-f42.google.com ([209.85.213.42]) (using TLSv1) by
	exprod7ob120.postini.com ([64.18.6.12]) with SMTP
	ID DSNKUBkO9i/TwKjYvJALMTJ+GpUMq+pTSPy8@HIDDEN;
	Wed, 01 Aug 2012 04:11:51 PDT
Received: by mail-yw0-f42.google.com with SMTP id o21so6346084yho.15
	for <12098 <at> debbugs.gnu.org>; Wed, 01 Aug 2012 04:11:50 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:x-gm-message-state;
	bh=WyLzotA88PVHPq6+HTiFJ+tRZCQHvD8k57R7zQIgnJE=;
	b=h4Zj1KsHZVKZjQi/H2l4lrAPecJjVhWEtbDIzk2YmKivtvSjhAPEdBQ69YRbc1Ky5Y
	J/0HT1RmWwjmoqFtlt64gO7PU3iteAn+2XRwsuCRL2ug4D9+2BlXrkNk/SRcONoV3FSv
	mkQAHbl2G+kTlMzVKS5hiNXSyQ1JyqPx3a0UApei5z9genLTXFE3mnUu9HoWvZ44TbhH
	MsszPd65qaMjbz0gof0ViirYEAUW4UlnB7LPqoS9MOGma+jpEz55n2WYtt1/OdgF9Jzl
	qCrUjaMcZKZI3o6CR4qIwTmy2BdnHARqU/YNL1tjsCxtiyL0UyT3tdO7ygamYul39AS+
	Uqcg==
MIME-Version: 1.0
Received: by 10.50.182.229 with SMTP id eh5mr3634683igc.38.1343819510478; Wed,
	01 Aug 2012 04:11:50 -0700 (PDT)
Received: by 10.231.126.66 with HTTP; Wed, 1 Aug 2012 04:11:50 -0700 (PDT)
In-Reply-To: <87txwnxbbx.fsf@HIDDEN>
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<87pq7b5uvr.fsf@HIDDEN>
	<CAOnWdojuXbGxbznYWkJPrZOZyq=XRwp5WvN6PppMHCP0i9oLWw@HIDDEN>
	<87txwnxbbx.fsf@HIDDEN>
Date: Wed, 1 Aug 2012 12:11:50 +0100
Message-ID: <CAOnWdog0=DOWMts6E-TvJxpeOcB+CY5VpC31xboreHpGFE8nfA@HIDDEN>
Subject: Re: bug#12098: How to trap errors in man?
From: Reuben Thomas <rrt@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1
X-Gm-Message-State: ALoCoQlVOzJBkXkHU7OsfV6DqP9Uby4zXslHR2ZBLl6A4Rmv+zHBdyqgiVpQLV5cJw7YdeMjxeWf
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: 12098
Cc: 12098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.2 (----)

On 1 August 2012 09:23, Juri Linkov <juri@HIDDEN> wrote:
>
> You are right, the largest man page `man bash' takes just 2 sec to format,
> so perhaps it makes no sense to run the man command asynchronously nowadays.

I would certainly take that view if it were I who had to maintain the code!

> I don't know if it's possible with lack of multi-threading
> to yield to the command loop while waiting for the process output.
> But with the following patch you can run `man' synchronously
> by using just `(let ((Man-async nil)) (man "bash"))' when its
> default value is not nil.

That looks great if the patch were installed.

-- 
http://rrt.sc3d.org




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Aug 2012 09:37:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 01 05:37:00 2012
Received: from localhost ([127.0.0.1]:54056 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwVMS-000531-3n
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 05:37:00 -0400
Received: from eggs.gnu.org ([208.118.235.92]:42308)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwVMQ-00052u-9X
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 05:36:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwVFA-0003bI-E4
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 05:29:34 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:35090)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwVFA-0003bD-BN
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 05:29:28 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50731)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwVF4-00079j-KD
	for bug-gnu-emacs@HIDDEN; Wed, 01 Aug 2012 05:29:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwVF3-0003ae-L9
	for bug-gnu-emacs@HIDDEN; Wed, 01 Aug 2012 05:29:22 -0400
Received: from plane.gmane.org ([80.91.229.3]:36332)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwVF3-0003aV-E8
	for bug-gnu-emacs@HIDDEN; Wed, 01 Aug 2012 05:29:21 -0400
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwVEx-0006Zu-RH
	for bug-gnu-emacs@HIDDEN; Wed, 01 Aug 2012 11:29:15 +0200
Received: from lbe83-2-78-243-104-167.fbx.proxad.net ([78.243.104.167])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-gnu-emacs@HIDDEN>; Wed, 01 Aug 2012 11:29:15 +0200
Received: from thierry.volpiatto by lbe83-2-78-243-104-167.fbx.proxad.net with
	local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00
	for <bug-gnu-emacs@HIDDEN>; Wed, 01 Aug 2012 11:29:15 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
Subject: Re: bug#12098: How to trap errors in man?
Date: Wed, 01 Aug 2012 11:29:00 +0200
Lines: 33
Message-ID: <876293q7tv.fsf@HIDDEN>
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<87pq7b5uvr.fsf@HIDDEN> <87ehnrqanr.fsf@HIDDEN>
	<87txwnvwao.fsf@HIDDEN> <87a9yfq98z.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
X-Complaints-To: usenet@HIDDEN
X-Gmane-NNTP-Posting-Host: lbe83-2-78-243-104-167.fbx.proxad.net
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)
Cancel-Lock: sha1:rot6kjYoGv8FZ5igv+2p2HWT1sE=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -6.9 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)

Thierry Volpiatto <thierry.volpiatto@HIDDEN> writes:

> Juri Linkov <juri@HIDDEN> writes:
>
>>> `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.
>>
>> Yes, this is what is implemented with a new `Man-async'
>> in another post I just sent.
> Ah! good.
>
>> Do you agree that man should be synchronous by default?
> Yes.
>
> Also `Man-notify-method' should be more accessible (more let-bindable)
> probably by making it local, but I may be wrong there (need to look at
> the code).

Also while you are at it, it would be helpful to add a 't' value to the
require-match arg of completing-read in `man'.

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





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Aug 2012 09:14:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 01 05:14:07 2012
Received: from localhost ([127.0.0.1]:54021 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwV0J-0004Xc-1E
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 05:14:07 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50036)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwV0H-0004XW-3c
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 05:14:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUt3-0005NT-Ev
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 05:06:41 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:49336)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUt3-0005NP-51
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 05:06:37 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45108)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUsx-0006n2-B6
	for bug-gnu-emacs@HIDDEN; Wed, 01 Aug 2012 05:06:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUsr-0005MM-BY
	for bug-gnu-emacs@HIDDEN; Wed, 01 Aug 2012 05:06:31 -0400
Received: from plane.gmane.org ([80.91.229.3]:51757)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUsr-0005ME-4f
	for bug-gnu-emacs@HIDDEN; Wed, 01 Aug 2012 05:06:25 -0400
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUsl-00015e-Bc
	for bug-gnu-emacs@HIDDEN; Wed, 01 Aug 2012 11:06:19 +0200
Received: from uk.solarflare.com ([193.34.186.16])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-gnu-emacs@HIDDEN>; Wed, 01 Aug 2012 11:06:19 +0200
Received: from andrewjmoreton by uk.solarflare.com with local (Gmexim 0.1
	(Debian)) id 1AlnuQ-0007hv-00
	for <bug-gnu-emacs@HIDDEN>; Wed, 01 Aug 2012 11:06:19 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Andy Moreton <andrewjmoreton@HIDDEN>
Subject: Re: bug#12098: How to trap errors in man?
Date: Wed, 01 Aug 2012 10:05:59 +0100
Lines: 30
Message-ID: <vz139472d8o.fsf@HIDDEN>
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<87pq7b5uvr.fsf@HIDDEN>
	<CAOnWdojuXbGxbznYWkJPrZOZyq=XRwp5WvN6PppMHCP0i9oLWw@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Complaints-To: usenet@HIDDEN
X-Gmane-NNTP-Posting-Host: uk.solarflare.com
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (windows-nt)
Cancel-Lock: sha1:xLBcILuWZxK+LfJqcbrxzc0FTRw=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -6.9 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)

On Wed 01 Aug 2012, Reuben Thomas wrote:

> On 1 August 2012 01:15, Juri Linkov <juri@HIDDEN> wrote:
>>
>> The Emacs Info reader can format man pages with the help
>> of info-man.el.
>
> This doesn't appear to be standard.
>
>>> 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.
>
> There are plenty of things that freeze the session for much longer
> than the fraction of a second it takes to format most man pages! Even
> bash(1) only takes about a second. What workflow do you have in mind
> where a user starts a man page and then does something else for at
> most a few seconds? The idea of requesting some documentation and then
> doing something else for a few seconds is a bit odd to me…

things freezing for any reason should be something to be removed
everywhere, not an excuse for allowing more badness.

Async fetching and formatting of man pages is very useful if the man
page is on a remote host running a different OS.

   AndyM





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at 12098 <at> debbugs.gnu.org:


Received: (at 12098) by debbugs.gnu.org; 1 Aug 2012 09:05:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 01 05:05:55 2012
Received: from localhost ([127.0.0.1]:54001 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwUsN-0004M3-6I
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 05:05:55 -0400
Received: from mail-wi0-f174.google.com ([209.85.212.174]:52341)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <thierry.volpiatto@HIDDEN>) id 1SwUsM-0004Lw-0f
	for 12098 <at> debbugs.gnu.org; Wed, 01 Aug 2012 05:05:54 -0400
Received: by wibhr14 with SMTP id hr14so3022390wib.15
	for <12098 <at> debbugs.gnu.org>; Wed, 01 Aug 2012 01:58:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:references:date:in-reply-to:message-id
	:user-agent:mime-version:content-type;
	bh=udnZbFwLIowZcZ46imVxckOXasPmuzlaFYytqQl0fkQ=;
	b=R6Hs5feUh6e4o/EgRcUJBrkTKAyCyi2UZQUWXUrpHWX1ioHCOHt0mOMlKBak2X3nAn
	pDYosVC8el3ZGbAUm2xKNn2/tSENN7vKWgMxk1e1CavfaOrBTkj5ldie9AZVWslEqcFt
	J6qH9+rFyM+6HJPH2Tn9K4iOgue88Rr2QwYgr/s2hZbqxxXEMxOIF8LLByAOuOS1ZDVB
	SV9vJOjpQu3gTGINvPY3R1nPmEHGW7Cktlh8Z2i8X+rHmhLL8mVC/JiM+IWOgVhAWDZ7
	ovG2c0tX9YOULAM8FVWjm3P26w4mwIwjFyZtnwcTkPaJJQOdWeXO9VE3Gw8K4xsd8kli
	yIwg==
Received: by 10.216.179.205 with SMTP id h55mr8753142wem.100.1343811509394;
	Wed, 01 Aug 2012 01:58:29 -0700 (PDT)
Received: from thierry-MM061 (lbe83-2-78-243-104-167.fbx.proxad.net.
	[78.243.104.167])
	by mx.google.com with ESMTPS id eu4sm26889709wib.2.2012.08.01.01.58.27
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 01 Aug 2012 01:58:28 -0700 (PDT)
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#12098: How to trap errors in man?
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<87pq7b5uvr.fsf@HIDDEN> <87ehnrqanr.fsf@HIDDEN>
	<87txwnvwao.fsf@HIDDEN>
Date: Wed, 01 Aug 2012 10:58:20 +0200
In-Reply-To: <87txwnvwao.fsf@HIDDEN> (Juri Linkov's message of "Wed,
	01 Aug 2012 11:41:35 +0300")
Message-ID: <87a9yfq98z.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 12098
Cc: 12098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

Juri Linkov <juri@HIDDEN> writes:

>> `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.
>
> Yes, this is what is implemented with a new `Man-async'
> in another post I just sent.
Ah! good.

> Do you agree that man should be synchronous by default?
Yes.

Also `Man-notify-method' should be more accessible (more let-bindable)
probably by making it local, but I may be wrong there (need to look at
the code).

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at 12098 <at> debbugs.gnu.org:


Received: (at 12098) by debbugs.gnu.org; 1 Aug 2012 08:49:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 01 04:49:55 2012
Received: from localhost ([127.0.0.1]:53987 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwUcs-000404-F2
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 04:49:54 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:50044
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1SwUcn-0003zu-LB
	for 12098 <at> debbugs.gnu.org; Wed, 01 Aug 2012 04:49:50 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 9F7EC451CB31;
	Wed,  1 Aug 2012 01:42:24 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
Subject: Re: bug#12098: How to trap errors in man?
Organization: JURTA
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<87pq7b5uvr.fsf@HIDDEN> <87ehnrqanr.fsf@HIDDEN>
Date: Wed, 01 Aug 2012 11:41:35 +0300
In-Reply-To: <87ehnrqanr.fsf@HIDDEN> (Thierry Volpiatto's message of "Wed, 
	01 Aug 2012 10:27:52 +0200")
Message-ID: <87txwnvwao.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12098
Cc: 12098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

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

Yes, this is what is implemented with a new `Man-async'
in another post I just sent.

Do you agree that man should be synchronous by default?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at 12098 <at> debbugs.gnu.org:


Received: (at 12098) by debbugs.gnu.org; 1 Aug 2012 08:42:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 01 04:42:24 2012
Received: from localhost ([127.0.0.1]:53963 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwUVb-0003nC-AC
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 04:42:24 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:47605
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1SwUVW-0003mw-1r
	for 12098 <at> debbugs.gnu.org; Wed, 01 Aug 2012 04:42:21 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 2A6F2451CB7F;
	Wed,  1 Aug 2012 01:34:52 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Reuben Thomas <rrt@HIDDEN>
Subject: Re: bug#12098: How to trap errors in man?
Organization: JURTA
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<87pq7b5uvr.fsf@HIDDEN>
	<CAOnWdojuXbGxbznYWkJPrZOZyq=XRwp5WvN6PppMHCP0i9oLWw@HIDDEN>
Date: Wed, 01 Aug 2012 11:23:30 +0300
In-Reply-To: <CAOnWdojuXbGxbznYWkJPrZOZyq=XRwp5WvN6PppMHCP0i9oLWw@HIDDEN>
	(Reuben Thomas's message of "Wed, 1 Aug 2012 01:38:17 +0100")
Message-ID: <87txwnxbbx.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12098
Cc: 12098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> There are plenty of things that freeze the session for much longer
> than the fraction of a second it takes to format most man pages! Even
> bash(1) only takes about a second.

You are right, the largest man page `man bash' takes just 2 sec to format,
so perhaps it makes no sense to run the man command asynchronously nowadays.

The patch below introduces a new variable `Man-async' whose value
could be set to nil to run `man' synchronously.

> Are you sure about that bug number? I looked and it seems to be about
> window layout.

That's right, currently the async mode of man has its peculiarities:
it arranges window layouts after formatting is done, so formatting
can't fit into window layout.

So perhaps we should have two asynchronous modes:
1. delay changes in window configuration
   until the process is finished and man page is formatted.
2. prepare window layout before formatting;

I'm still not sure whether we need the former for backward compatibility,
so `Man-async' could have a special value for it.

> I can't see how to use this to communicate back to a particular caller
> that man failed; help?

I don't know if it's possible with lack of multi-threading
to yield to the command loop while waiting for the process output.
But with the following patch you can run `man' synchronously
by using just `(let ((Man-async nil)) (man "bash"))' when its
default value is not nil.

=== modified file 'lisp/man.el'
--- lisp/man.el	2012-07-11 23:13:41 +0000
+++ lisp/man.el	2012-08-01 08:23:10 +0000
@@ -144,6 +144,20 @@ (defcustom Man-reverse-face 'highlight
   :type 'face
   :group 'man)
 
+(defcustom Man-async nil
+  "Synchronicity of the manpage command.
+If nil, run the manpage command synchronously.
+If t, run the manpage command asynchronously
+preparing output windows before the process is started.
+If the value is `delayed', run the manpage command
+asynchronously but delay changes in window configuration
+until the process is finished and man page is formatted."
+  :type '(choice (const :tag "Synchronous" nil)
+                 (const :tag "Asynchronous" t)
+                 (const :tag "Delayed" delayed))
+  :group 'man
+  :version "24.2")
+
 ;; Use the value of the obsolete user option Man-notify, if set.
 (defcustom Man-notify-method (if (boundp 'Man-notify) Man-notify 'friendly)
   "Selects the behavior when manpage is ready.
@@ -904,16 +920,37 @@ (defun Man-getpage-in-background (topic)
 Return the buffer in which the manpage will appear."
   (let* ((man-args topic)
 	 (bufname (concat "*Man " man-args "*"))
-	 (buffer  (get-buffer bufname)))
+	 (buffer  (get-buffer bufname))
+	 (procbufname (concat " " bufname))
+	 procbuffer)
     (if buffer
 	(Man-notify-when-ready buffer)
       (require 'env)
-      (message "Invoking %s %s in the background" manual-program man-args)
-      (setq buffer (generate-new-buffer bufname))
-      (with-current-buffer buffer
-	(setq buffer-undo-list t)
-	(setq Man-original-frame (selected-frame))
-	(setq Man-arguments man-args))
+      (cond
+       ((eq Man-async 'delayed)
+	(message "Invoking %s %s in the background" manual-program man-args)
+	(setq buffer (generate-new-buffer bufname))
+	(with-current-buffer buffer
+	  (setq buffer-undo-list t)
+	  (setq Man-original-frame (selected-frame))
+	  (setq Man-arguments man-args)))
+       (t
+	(setq buffer (generate-new-buffer bufname))
+	(setq procbuffer (generate-new-buffer procbufname))
+	;; Display empty output buffer.
+	(unless (memq Man-notify-method '(polite quiet meek))
+	  (Man-notify-when-ready buffer))
+	(with-current-buffer buffer
+	  (insert (format "Invoking %s %s in the background\n"
+			  manual-program man-args))
+	  (setq buffer-undo-list t)
+	  (setq Man-original-frame (selected-frame))
+	  (setq Man-arguments man-args))
+	(with-current-buffer procbuffer
+	  (setq buffer-undo-list t)
+	  (setq Man-original-frame (selected-frame))
+	  (setq Man-arguments man-args))))
+
       (let ((process-environment (copy-sequence process-environment))
 	    ;; The following is so Awk script gets \n intact
 	    ;; But don't prevent decoding of the outside.
@@ -952,16 +989,26 @@ (defun Man-getpage-in-background (topic)
 			     (cond
 			      ((and (integerp Man-width) (> Man-width 0))
 			       Man-width)
-			      (Man-width (frame-width))
-			      ((window-width))))))
+			      (Man-width
+			       (if (eq Man-async 'delayed)
+				   (frame-width)
+				 (with-selected-window (get-buffer-window
+							buffer t)
+				   (frame-width))))
+			      (t
+			       (if (eq Man-async 'delayed)
+				   (window-width)
+				 (with-selected-window (get-buffer-window
+							buffer t)
+				   (window-width))))))))
 	(setenv "GROFF_NO_SGR" "1")
 	;; Since man-db 2.4.3-1, man writes plain text with no escape
 	;; sequences when stdout is not a tty.	In 2.5.0, the following
 	;; env-var was added to allow control of this (see Debian Bug#340673).
 	(setenv "MAN_KEEP_FORMATTING" "1")
-	(if (fboundp 'start-process)
+	(if (and Man-async (fboundp 'start-process))
 	    (set-process-sentinel
-	     (start-process manual-program buffer
+	     (start-process manual-program (if (eq Man-async 'delayed) buffer procbuffer)
 			    (if (memq system-type '(cygwin windows-nt))
 				shell-file-name
 			      "sh")
@@ -969,7 +1016,7 @@ (defun Man-getpage-in-background (topic)
 			    (format (Man-build-man-command) man-args))
 	     'Man-bgproc-sentinel)
 	  (let ((exit-status
-		 (call-process shell-file-name nil (list buffer nil) nil
+		 (call-process shell-file-name nil (list procbuffer nil) nil
 			       shell-command-switch
 			       (format (Man-build-man-command) man-args)))
 		(msg ""))
@@ -980,7 +1027,7 @@ (defun Man-getpage-in-background (topic)
 			   (format "exited abnormally with code %d"
 				   exit-status)))
 		(setq msg exit-status))
-	    (Man-bgproc-sentinel bufname msg)))))
+	    (Man-bgproc-sentinel procbufname msg)))))
     buffer))
 
 (defun Man-notify-when-ready (man-buffer)
@@ -1216,16 +1263,18 @@ (defun Man-bgproc-sentinel (process msg)
 synchronously, PROCESS is the name of the buffer where the manpage
 command is run.  Second argument MSG is the exit message of the
 manpage command."
-  (let ((Man-buffer (if (stringp process) (get-buffer process)
-		      (process-buffer process)))
-	(delete-buff nil)
-	(err-mess nil))
+  (let* ((Man-procbuffer (if (stringp process) (get-buffer process)
+			   (process-buffer process)))
+	 (Man-buffer (get-buffer (replace-regexp-in-string
+				  "\\` " "" (buffer-name Man-procbuffer))))
+	 (delete-buff nil)
+	 (err-mess nil))
 
     (if (null (buffer-name Man-buffer)) ;; deleted buffer
 	(or (stringp process)
 	    (set-process-buffer process nil))
 
-      (with-current-buffer Man-buffer
+      (with-current-buffer Man-procbuffer
 	(let ((case-fold-search nil))
 	  (goto-char (point-min))
 	  (cond ((or (looking-at "No \\(manual \\)*entry for")
@@ -1261,11 +1310,17 @@ (defun Man-bgproc-sentinel (process msg)
               (Man-fontify-manpage)
             (Man-cleanup-manpage))
 
+	  (unless (eq Man-async 'delayed)
+	    (copy-to-buffer Man-buffer (point-min) (point-max))))))
+
+      (unless delete-buff
+	(with-current-buffer (if (eq Man-async 'delayed) Man-procbuffer Man-buffer)
           (run-hooks 'Man-cooked-hook)
 	  (Man-mode)
 
@@ -1279,11 +1342,13 @@ (defun Man-bgproc-sentinel (process msg)
 	;; Man-notify-when-ready because it may switch buffers.
 
 	(if (not delete-buff)
-	    (Man-notify-when-ready Man-buffer))
+	    (when (or (eq Man-async 'delayed)
+		      (memq Man-notify-method '(polite quiet meek)))
+	      (Man-notify-when-ready Man-buffer)))
 
 	(if err-mess
 	    (error "%s" err-mess))
-	))))
+	)))
 
 (defun Man-page-from-arguments (args)
   ;; Skip arguments and only print the page name.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Aug 2012 08:35:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 01 04:35:43 2012
Received: from localhost ([127.0.0.1]:53906 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwUP5-0003cq-4m
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 04:35:42 -0400
Received: from eggs.gnu.org ([208.118.235.92]:36917)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUP2-0003ci-F6
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 04:35:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUHn-0001WB-6N
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 04:28:12 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:50705)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUHn-0001W7-2b
	for submit <at> debbugs.gnu.org; Wed, 01 Aug 2012 04:28:07 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53234)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUHl-0007dh-Vz
	for bug-gnu-emacs@HIDDEN; Wed, 01 Aug 2012 04:28:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUHk-0001Vo-Eo
	for bug-gnu-emacs@HIDDEN; Wed, 01 Aug 2012 04:28:05 -0400
Received: from plane.gmane.org ([80.91.229.3]:54300)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUHk-0001Vf-76
	for bug-gnu-emacs@HIDDEN; Wed, 01 Aug 2012 04:28:04 -0400
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1SwUHi-0002yQ-PZ
	for bug-gnu-emacs@HIDDEN; Wed, 01 Aug 2012 10:28:02 +0200
Received: from lbe83-2-78-243-104-167.fbx.proxad.net ([78.243.104.167])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-gnu-emacs@HIDDEN>; Wed, 01 Aug 2012 10:28:02 +0200
Received: from thierry.volpiatto by lbe83-2-78-243-104-167.fbx.proxad.net with
	local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00
	for <bug-gnu-emacs@HIDDEN>; Wed, 01 Aug 2012 10:28:02 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
Subject: Re: bug#12098: How to trap errors in man?
Date: Wed, 01 Aug 2012 10:27:52 +0200
Lines: 44
Message-ID: <87ehnrqanr.fsf@HIDDEN>
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<87pq7b5uvr.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
X-Complaints-To: usenet@HIDDEN
X-Gmane-NNTP-Posting-Host: lbe83-2-78-243-104-167.fbx.proxad.net
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)
Cancel-Lock: sha1:Ep0va7QIOuUvH/k2F98c+qnuago=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -6.9 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)

Juri Linkov <juri@HIDDEN> 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 





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at 12098 <at> debbugs.gnu.org:


Received: (at 12098) by debbugs.gnu.org; 1 Aug 2012 00:45:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 31 20:45:58 2012
Received: from localhost ([127.0.0.1]:53454 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwN4Y-0001a5-4E
	for submit <at> debbugs.gnu.org; Tue, 31 Jul 2012 20:45:58 -0400
Received: from exprod7og113.obsmtp.com ([64.18.2.179]:39232)
	by debbugs.gnu.org with smtp (Exim 4.72)
	(envelope-from <rrt@HIDDEN>) id 1SwN4U-0001Zg-CR
	for 12098 <at> debbugs.gnu.org; Tue, 31 Jul 2012 20:45:55 -0400
Received: from mail-yx0-f179.google.com ([209.85.213.179]) (using TLSv1) by
	exprod7ob113.postini.com ([64.18.6.12]) with SMTP
	ID DSNKUBh6edPb4LdRFvZYyyZUzqEPtTja6HoU@HIDDEN;
	Tue, 31 Jul 2012 17:38:32 PDT
Received: by mail-yx0-f179.google.com with SMTP id r13so6256533yen.38
	for <12098 <at> debbugs.gnu.org>; Tue, 31 Jul 2012 17:38:17 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding:x-gm-message-state;
	bh=jtdXdejiNfc8IAzwnKdtih/m2KK9deKzBZC36+CdXLY=;
	b=W3O7W9/4B7Zkynw0qXFpyFCEvOb5ehtFLpIgh/E8VG17icZ4qHCduQJEVG1e8Rb/S/
	YIgEXnughdiyCUYqsoH8wTAFQj3XHye+ZFp+nzQElAxMWr3ZqUNOs+6J2WIT0wOQrisd
	+cAer/9QPhxri2a+XUvvRmVY3i234F/PmLl1vyXHdqMkSRsxAN8G8m3V8i7fyfAqmo6I
	Wqus1tj4lQTlQRYN1tKF/WfrqfLwQMV6V+5FnqaG8a9R7yawlfoCxNPef2Fm/RArE+XQ
	9yXc7/y7/8B6N8OJPlgkmQbhnA0mSPIkQRGjacqH8JXs0IhwhB0SxDpaqPgIQzdZLRMv
	QObQ==
MIME-Version: 1.0
Received: by 10.50.95.136 with SMTP id dk8mr3704746igb.8.1343781497549; Tue,
	31 Jul 2012 17:38:17 -0700 (PDT)
Received: by 10.231.199.147 with HTTP; Tue, 31 Jul 2012 17:38:17 -0700 (PDT)
In-Reply-To: <87pq7b5uvr.fsf@HIDDEN>
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<87pq7b5uvr.fsf@HIDDEN>
Date: Wed, 1 Aug 2012 01:38:17 +0100
Message-ID: <CAOnWdojuXbGxbznYWkJPrZOZyq=XRwp5WvN6PppMHCP0i9oLWw@HIDDEN>
Subject: Re: bug#12098: How to trap errors in man?
From: Reuben Thomas <rrt@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-Gm-Message-State: ALoCoQk8Jm9ga0WFfIGhF1Wvw6L00dpkr8zNbIIYaiVyBN+Ym5XHa5sUupEL5JUBffWiUe3v1bTC
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: 12098
Cc: 12098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.2 (----)

On 1 August 2012 01:15, Juri Linkov <juri@HIDDEN> wrote:
>
> The Emacs Info reader can format man pages with the help
> of info-man.el.

This doesn't appear to be standard.

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

There are plenty of things that freeze the session for much longer
than the fraction of a second it takes to format most man pages! Even
bash(1) only takes about a second. What workflow do you have in mind
where a user starts a man page and then does something else for at
most a few seconds? The idea of requesting some documentation and then
doing something else for a few seconds is a bit odd to me=85

>  In bug#9084 we are trying to improve this by
> modifying man.el to work more like async shell
> commands.

Are you sure about that bug number? I looked and it seems to be about
window layout.

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

I can't see how to use this to communicate back to a particular caller
that man failed; help?

--=20
http://rrt.sc3d.org




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at 12098 <at> debbugs.gnu.org:


Received: (at 12098) by debbugs.gnu.org; 1 Aug 2012 00:31:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 31 20:31:27 2012
Received: from localhost ([127.0.0.1]:53426 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwMqU-0001Do-Jd
	for submit <at> debbugs.gnu.org; Tue, 31 Jul 2012 20:31:27 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:36140
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1SwMqR-0001Da-Mm
	for 12098 <at> debbugs.gnu.org; Tue, 31 Jul 2012 20:31:24 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id E7802451CB8B;
	Tue, 31 Jul 2012 17:24:00 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Reuben Thomas <rrt@HIDDEN>
Subject: Re: bug#12098: How to trap errors in man?
Organization: JURTA
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
Date: Wed, 01 Aug 2012 03:15:40 +0300
In-Reply-To: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	(Reuben Thomas's message of "Tue, 31 Jul 2012 12:53:43 +0100")
Message-ID: <87pq7b5uvr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 12098
Cc: 12098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

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

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at 12098 <at> debbugs.gnu.org:


Received: (at 12098) by debbugs.gnu.org; 31 Jul 2012 16:36:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 31 12:36:22 2012
Received: from localhost ([127.0.0.1]:52877 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwFQk-0007QM-1o
	for submit <at> debbugs.gnu.org; Tue, 31 Jul 2012 12:36:22 -0400
Received: from mtaout22.012.net.il ([80.179.55.172]:56979)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <eliz@HIDDEN>) id 1SwFQh-0007QA-7Q
	for 12098 <at> debbugs.gnu.org; Tue, 31 Jul 2012 12:36:20 -0400
Received: from conversion-daemon.a-mtaout22.012.net.il by
	a-mtaout22.012.net.il (HyperSendmail v2007.08) id
	<0M81005009MRWA00@HIDDEN> for
	12098 <at> debbugs.gnu.org; Tue, 31 Jul 2012 19:27:57 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il
	(HyperSendmail v2007.08) with ESMTPA id
	<0M810051A9QIW810@HIDDEN>;
	Tue, 31 Jul 2012 19:27:55 +0300 (IDT)
Date: Tue, 31 Jul 2012 19:27:51 +0300
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#12098: Acknowledgement (How to trap errors in man?)
In-reply-to: <CAOnWdoh+97DMPek=i5AxzDxkgXAkiwR-c+H-hBXTT8AMhW5kOw@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Reuben Thomas <rrt@HIDDEN>
Message-id: <833947gak8.fsf@HIDDEN>
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<handler.12098.B.13437360754310.ack <at> debbugs.gnu.org>
	<CAOnWdoh+97DMPek=i5AxzDxkgXAkiwR-c+H-hBXTT8AMhW5kOw@HIDDEN>
X-Spam-Score: -1.2 (-)
X-Debbugs-Envelope-To: 12098
Cc: 12098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.2 (-)

> Date: Tue, 31 Jul 2012 14:36:33 +0100
> From: Reuben Thomas <rrt@HIDDEN>
> 
> I found a workaround: unbind start-process, which causes man to be run
> synchronously, which means that there's no process-sentinel to trap
> any error, so the caller can trap it.

Please, when you have time, donate $0.02 to the MSDOS port of Emacs,
which made this possible.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at 12098 <at> debbugs.gnu.org:


Received: (at 12098) by debbugs.gnu.org; 31 Jul 2012 13:43:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 31 09:43:58 2012
Received: from localhost ([127.0.0.1]:52346 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwCju-0003TM-5l
	for submit <at> debbugs.gnu.org; Tue, 31 Jul 2012 09:43:58 -0400
Received: from exprod7og110.obsmtp.com ([64.18.2.173]:44630)
	by debbugs.gnu.org with smtp (Exim 4.72)
	(envelope-from <rrt@HIDDEN>) id 1SwCjs-0003TC-S6
	for 12098 <at> debbugs.gnu.org; Tue, 31 Jul 2012 09:43:57 -0400
Received: from mail-gg0-f171.google.com ([209.85.161.171]) (using TLSv1) by
	exprod7ob110.postini.com ([64.18.6.12]) with SMTP
	ID DSNKUBffYT1b6c4jdxHGK29p+Xx4nEAyjLi8@HIDDEN;
	Tue, 31 Jul 2012 06:36:37 PDT
Received: by mail-gg0-f171.google.com with SMTP id i1so7624533ggm.30
	for <12098 <at> debbugs.gnu.org>; Tue, 31 Jul 2012 06:36:33 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type:x-gm-message-state;
	bh=LLPkZfPedbbrEaLa6jtgxX0CsTluvYBpEaJeUcCzmRI=;
	b=lw7xVXGXadi3DYWMFwYwJ7SFL5C1cQdCPx0T8gAahPqzTngPQGsyy/mewiyIgYWYS+
	Gxn+2/hNdNJhkZX651a5NPjVRihKvyryB1EA1ClU6UZM4s4jWjsV/bnXkaToarJvs2Mm
	HYNVQ7zFEqryPQqWNqMwFzBx5vQpkbRWIqBLac52OqRyQ6rJ7tvmSR9FdliHoDf7MM/1
	WlzFiWZbFb9cDhCCEhpQDZIBIpreUSUd11c7bmHfarFu3CBDm6wZFx4PPjnASFSOgEzg
	cg6siGP60bk3JTMT3AstLvnQanyaIBAHxZKLx/RjACEbWpfrY1ikwL1W/HiQLW1tQh5Q
	9F5g==
MIME-Version: 1.0
Received: by 10.50.10.166 with SMTP id j6mr1999206igb.38.1343741793280; Tue,
	31 Jul 2012 06:36:33 -0700 (PDT)
Received: by 10.231.199.147 with HTTP; Tue, 31 Jul 2012 06:36:33 -0700 (PDT)
In-Reply-To: <handler.12098.B.13437360754310.ack <at> debbugs.gnu.org>
References: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
	<handler.12098.B.13437360754310.ack <at> debbugs.gnu.org>
Date: Tue, 31 Jul 2012 14:36:33 +0100
Message-ID: <CAOnWdoh+97DMPek=i5AxzDxkgXAkiwR-c+H-hBXTT8AMhW5kOw@HIDDEN>
Subject: Re: bug#12098: Acknowledgement (How to trap errors in man?)
From: Reuben Thomas <rrt@HIDDEN>
To: 12098 <at> debbugs.gnu.org
Content-Type: text/plain; charset=ISO-8859-1
X-Gm-Message-State: ALoCoQm9IwpYK+3pgH2+mgCL39p17LG6wPHGMb9S3TIr4Db+Z5fiZUqN8n5OfypLEZtXLjrvUHJe
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: 12098
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.2 (----)

I found a workaround: unbind start-process, which causes man to be run
synchronously, which means that there's no process-sentinel to trap
any error, so the caller can trap it.

Of course, this works for my application (a wrapper for standalone
Emacs), but it's not so good for use in code that is supposed to work
in a normal Emacs session.

-- 
http://rrt.sc3d.org




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 31 Jul 2012 12:01:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 31 08:01:15 2012
Received: from localhost ([127.0.0.1]:52228 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SwB8U-00017S-BR
	for submit <at> debbugs.gnu.org; Tue, 31 Jul 2012 08:01:15 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46019)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <rrt@HIDDEN>) id 1SwB8S-00017L-34
	for submit <at> debbugs.gnu.org; Tue, 31 Jul 2012 08:01:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rrt@HIDDEN>) id 1SwB1M-0004r7-37
	for submit <at> debbugs.gnu.org; Tue, 31 Jul 2012 07:53:53 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI
	autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:52820)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rrt@HIDDEN>)
	id 1SwB1L-0004r2-VS
	for submit <at> debbugs.gnu.org; Tue, 31 Jul 2012 07:53:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39235)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rrt@HIDDEN>) id 1SwB1K-000315-TP
	for bug-gnu-emacs@HIDDEN; Tue, 31 Jul 2012 07:53:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rrt@HIDDEN>) id 1SwB1H-0004pq-2Q
	for bug-gnu-emacs@HIDDEN; Tue, 31 Jul 2012 07:53:50 -0400
Received: from fencepost.gnu.org ([208.118.235.10]:41572)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rrt@HIDDEN>)
	id 1SwB1G-0004pm-Vm
	for bug-gnu-emacs@HIDDEN; Tue, 31 Jul 2012 07:53:46 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38428)
	by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <rrt@HIDDEN>) id 1SwB1G-0004Ym-Nk
	for bug-emacs@HIDDEN; Tue, 31 Jul 2012 07:53:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rrt@HIDDEN>) id 1SwB1F-0004pF-FT
	for bug-emacs@HIDDEN; Tue, 31 Jul 2012 07:53:46 -0400
Received: from exprod7og106.obsmtp.com ([64.18.2.165]:45915)
	by eggs.gnu.org with smtp (Exim 4.71) (envelope-from <rrt@HIDDEN>)
	id 1SwB1F-0004p0-7N
	for bug-emacs@HIDDEN; Tue, 31 Jul 2012 07:53:45 -0400
Received: from mail-gg0-f182.google.com ([209.85.161.182]) (using TLSv1) by
	exprod7ob106.postini.com ([64.18.6.12]) with SMTP
	ID DSNKUBfHSKeCeDWsh3V6JQApFMfok/hjScqC@HIDDEN;
	Tue, 31 Jul 2012 04:53:44 PDT
Received: by ggnm2 with SMTP id m2so6896487ggn.13
	for <bug-emacs@HIDDEN>; Tue, 31 Jul 2012 04:53:43 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=google.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type
	:x-gm-message-state;
	bh=weXGhc1EQuA4TyvqEu4/smFwDezI/U71GpD0+Dkam7Q=;
	b=awM6zxzEXQmc9Qmw6Mzx7/5DormRvRvLD1iupvuCjg8nST4/0Bc9l9CCJlRq7/IFsJ
	5j0ta+iCk1d993kUKIMbsnh9wJJLF1nw2PRP0SVmzt815/a9aUPYBMlVaaP4skWpzfbi
	brAl8ogS/Kff6XO9a0YxP42S6NQBGP6wCPov1TY3k2jSRSmCGNJ6xIf/AzE1QzmhN6H9
	v9J+beqCUiQqeTDPcYi6KZCEvT8s9VPK8BiAXBH54SJnFKQzBvWH9WownYkVV5/sNq+E
	S+FH10rtsYkCosSiK3C1olLpRZovhV39Kq8CUUjy5sC+AH3iAZc8/fhJCMH+CaIEc6ws
	zEgA==
MIME-Version: 1.0
Received: by 10.50.189.135 with SMTP id gi7mr404206igc.8.1343735623418; Tue,
	31 Jul 2012 04:53:43 -0700 (PDT)
Received: by 10.231.199.147 with HTTP; Tue, 31 Jul 2012 04:53:43 -0700 (PDT)
Date: Tue, 31 Jul 2012 12:53:43 +0100
Message-ID: <CAOnWdogGgfh-7n3pVCXtohfSHTg2utAczYy9qaJ3MJopVc+wJQ@HIDDEN>
Subject: How to trap errors in man?
From: Reuben Thomas <rrt@HIDDEN>
To: bug-emacs <bug-emacs@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1
X-Gm-Message-State: ALoCoQl4WMNA7YHoWUWjafAkY2tx6pHKBL5t7HGN1XI5zMLVlyV8pXb1jJB9P+1o+AXssGaDosuN
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -6.2 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.2 (------)

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




Acknowledgement sent to Reuben Thomas <rrt@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#12098; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.