GNU bug report logs - #62958
[PATCH] Set PAGER=cat in comint.el

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: Spencer Baugh <sbaugh@HIDDEN>; Keywords: patch; dated Wed, 19 Apr 2023 21:58:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 62958) by debbugs.gnu.org; 9 May 2023 18:57:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 09 14:57:12 2023
Received: from localhost ([127.0.0.1]:44504 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwSWO-0007jC-6g
	for submit <at> debbugs.gnu.org; Tue, 09 May 2023 14:57:12 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51818)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pwSWK-0007ix-H7
 for 62958 <at> debbugs.gnu.org; Tue, 09 May 2023 14:57:10 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwSWE-0002D9-EC; Tue, 09 May 2023 14:57:02 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=2OLuPatT4wTDib3SB2W89X5fpYBDXOOujccp/KAGYVE=; b=QWMLiur/bQfz
 4iHARhlrDnquUXGHlzP8cwlumwN6fgUP1lVmKGbHsCd5ngvZOKIuZH3m59j8jOyCqdHq1ISoSxWqd
 3LnvFRN4r+kUeL0Cbg0T87oNxp/Mn9zlt4FoEIEbGAArCKqPl+t3Vo23noGLhbkl3+in7Lb/V8+NI
 aD5ziPN9LrLEK9NQvdbxCDKjo3iGNG5HKpLjU/MvRKEhE5G2d430irKj+Glo3/MAIHdeLe8uOIdCz
 EV8O+35k8lFnlyaD1tNS68JcptGzYIG73UrFKLJzrzNgscV1BPOGQh1Rkh3xM1BDQmUVgenUhKlsX
 f9/oAVX+t8LrpUGkHSADsw==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwSWD-0002QW-Tx; Tue, 09 May 2023 14:57:02 -0400
Date: Tue, 09 May 2023 21:58:06 +0300
Message-Id: <83mt2d9vsx.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <ier1qjptokr.fsf@HIDDEN> (message from Spencer Baugh on
 Tue, 09 May 2023 13:13:56 -0400)
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN> <835y97jnfd.fsf@HIDDEN>
 <iera5yetxzv.fsf@HIDDEN> <83pm7aay70.fsf@HIDDEN>
 <874jol1rml.fsf@HIDDEN> <831qjpbj8j.fsf@HIDDEN>
 <ier7cthtqkt.fsf@HIDDEN> <83wn1ha220.fsf@HIDDEN>
 <ier4joltpiz.fsf@HIDDEN> <83sfc5a1ag.fsf@HIDDEN>
 <CAO=BR8N-=uQtNEaEmEQ_XynNYpSQmZVD1mWYC5_AYFEV6XYQ-w@HIDDEN>
 <83pm79a103.fsf@HIDDEN> <ier1qjptokr.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62958
Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Spencer Baugh <sbaugh@HIDDEN>
> Cc: sbaugh@HIDDEN,  62958 <at> debbugs.gnu.org
> Date: Tue, 09 May 2023 13:13:56 -0400
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> From: Spencer Baugh <sbaugh@HIDDEN>
> >> Date: Tue, 9 May 2023 13:01:07 -0400
> >> Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
> >> 
> >>  I'm asking why this is not already obvious from the fact that this is
> >>  a defcustom, by default off.  All your addition says is "don't disable
> >>  paging in all cases, sometimes it can be useful".  But we already said
> >>  that, in effect, by making the paging enabled by default.  So there's
> >>  no reason to have that text, as it isn't instrumental, and doesn't add
> >>  anything.
> >> 
> >> How does "this is a defcustom, by default off" communicate "you should use vc-print-log if you turn this
> >> on"?
> >
> > Why are we suddenly talking about vc-print-log when discussing a much
> > more general feature?
> 
> Because disabling pagination effectively breaks the shell command "git
> log" and vc-print-log is one alternative to running "git log", and I
> don't know how else the user would realize that.  (In my experience with
> talking to users about this, they usually don't)

A doc string of a general option is not the proper place for talking
about some very specific case when that option is used.  If the main
problem is vc-print-log, we should find another way of dealing with
it.




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

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


Received: (at 62958) by debbugs.gnu.org; 9 May 2023 17:14:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 09 13:14:03 2023
Received: from localhost ([127.0.0.1]:44397 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwQuY-00087I-Qe
	for submit <at> debbugs.gnu.org; Tue, 09 May 2023 13:14:03 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:37935)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1pwQuX-00086j-Sm
 for 62958 <at> debbugs.gnu.org; Tue, 09 May 2023 13:14:02 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
In-Reply-To: <83pm79a103.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 09 May
 2023 20:05:48 +0300")
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN> <835y97jnfd.fsf@HIDDEN>
 <iera5yetxzv.fsf@HIDDEN> <83pm7aay70.fsf@HIDDEN>
 <874jol1rml.fsf@HIDDEN> <831qjpbj8j.fsf@HIDDEN>
 <ier7cthtqkt.fsf@HIDDEN> <83wn1ha220.fsf@HIDDEN>
 <ier4joltpiz.fsf@HIDDEN> <83sfc5a1ag.fsf@HIDDEN>
 <CAO=BR8N-=uQtNEaEmEQ_XynNYpSQmZVD1mWYC5_AYFEV6XYQ-w@HIDDEN>
 <83pm79a103.fsf@HIDDEN>
Date: Tue, 09 May 2023 13:13:56 -0400
Message-ID: <ier1qjptokr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 62958
Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Spencer Baugh <sbaugh@HIDDEN>
>> Date: Tue, 9 May 2023 13:01:07 -0400
>> Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
>> 
>>  I'm asking why this is not already obvious from the fact that this is
>>  a defcustom, by default off.  All your addition says is "don't disable
>>  paging in all cases, sometimes it can be useful".  But we already said
>>  that, in effect, by making the paging enabled by default.  So there's
>>  no reason to have that text, as it isn't instrumental, and doesn't add
>>  anything.
>> 
>> How does "this is a defcustom, by default off" communicate "you should use vc-print-log if you turn this
>> on"?
>
> Why are we suddenly talking about vc-print-log when discussing a much
> more general feature?

Because disabling pagination effectively breaks the shell command "git
log" and vc-print-log is one alternative to running "git log", and I
don't know how else the user would realize that.  (In my experience with
talking to users about this, they usually don't)




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

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


Received: (at 62958) by debbugs.gnu.org; 9 May 2023 17:04:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 09 13:04:53 2023
Received: from localhost ([127.0.0.1]:44341 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwQlh-0007oP-4r
	for submit <at> debbugs.gnu.org; Tue, 09 May 2023 13:04:53 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60564)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pwQlf-0007o6-51
 for 62958 <at> debbugs.gnu.org; Tue, 09 May 2023 13:04:51 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwQlZ-0005gq-UY; Tue, 09 May 2023 13:04:45 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=RDZLouIFCEQEfBqJdLxgJFxnaLFTgtzwciI1khLirFc=; b=UJn0O48dhFOL
 qUN8Q+mzTkfPnLwlSsXT1o5Wvkb/UIv77KqC7HfHjxyPc0zkDfUiV/OLCApa3eSDy8RQ3NQ+DD8+E
 geF6/ly3FyEJ7spJ9Dl/nbz1ImhFHg29xEpZmRig22Cp6USN66WFStNFQzZG4DqGJc5psfx/USiJf
 SGiz7WAEJ5bFz+AtlbX0wTtt0bCj/80slRWTKCKVLMxTukktgxAxUQ+CmheRPfZgS0w/iUOrB8e7G
 27QFzFkvzVn0LRNpYYwWOVCVjgjVCDxeLWlTuugltW7nlWG8opr9EWccJeUONs1R3qQw0vwo6yG+h
 jQ2+7tPW/AIFCrPyNZpAjg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwQlY-0006sf-9Q; Tue, 09 May 2023 13:04:44 -0400
Date: Tue, 09 May 2023 20:05:48 +0300
Message-Id: <83pm79a103.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <CAO=BR8N-=uQtNEaEmEQ_XynNYpSQmZVD1mWYC5_AYFEV6XYQ-w@HIDDEN>
 (message from Spencer Baugh on Tue, 9 May 2023 13:01:07 -0400)
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN>
 <835y97jnfd.fsf@HIDDEN> <iera5yetxzv.fsf@HIDDEN>
 <83pm7aay70.fsf@HIDDEN>
 <874jol1rml.fsf@HIDDEN> <831qjpbj8j.fsf@HIDDEN>
 <ier7cthtqkt.fsf@HIDDEN>
 <83wn1ha220.fsf@HIDDEN> <ier4joltpiz.fsf@HIDDEN>
 <83sfc5a1ag.fsf@HIDDEN>
 <CAO=BR8N-=uQtNEaEmEQ_XynNYpSQmZVD1mWYC5_AYFEV6XYQ-w@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62958
Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Spencer Baugh <sbaugh@HIDDEN>
> Date: Tue, 9 May 2023 13:01:07 -0400
> Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
> 
>  I'm asking why this is not already obvious from the fact that this is
>  a defcustom, by default off.  All your addition says is "don't disable
>  paging in all cases, sometimes it can be useful".  But we already said
>  that, in effect, by making the paging enabled by default.  So there's
>  no reason to have that text, as it isn't instrumental, and doesn't add
>  anything.
> 
> How does "this is a defcustom, by default off" communicate "you should use vc-print-log if you turn this
> on"?

Why are we suddenly talking about vc-print-log when discussing a much
more general feature?




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

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


Received: (at 62958) by debbugs.gnu.org; 9 May 2023 17:02:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 09 13:02:18 2023
Received: from localhost ([127.0.0.1]:44322 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwQjB-0007ji-RW
	for submit <at> debbugs.gnu.org; Tue, 09 May 2023 13:02:18 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40750)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pwQj9-0007jV-SP
 for 62958 <at> debbugs.gnu.org; Tue, 09 May 2023 13:02:16 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwQj4-0005Ir-ME; Tue, 09 May 2023 13:02:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=V89oKCIod5RlJM3VnLj2TVfv5F49HJ5GvsUaDwYzdrY=; b=n9vzNbNR6+6c
 FCBz/ljPemvLSzHFcSpghvteorg3oj6z87it2gGNUmAngVAetPMLYKMys1sy/+B5zV4HVSKs/KQyt
 IrO3Dvl9TaYPFRy/uDdQSDyYBtrjkKRFRZfV+aE/JcVYZzUzfz4hORD1JryUrVxWSDg2h+7L3GeNH
 k+Rq5DfELIX87RGTyIgFFWdUu+rZgSlsxucNkCwhiwTr5TnAEMHgNbHgCTMa9DY48xGO5WL+JDFYG
 4LMG14E4YS2Pro5rGa5ETya/m8JiM8ZuadUesFrDv7Z3tEGRzQSNJrHJQmSNx1gCvge0qhRqAW1lw
 H17fwJU0mjZcqUawzsjiIA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwQj4-0007Pp-4s; Tue, 09 May 2023 13:02:10 -0400
Date: Tue, 09 May 2023 20:03:14 +0300
Message-Id: <83r0rpa14d.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: sbaugh@HIDDEN
In-Reply-To: <83sfc5a1ag.fsf@HIDDEN> (message from Eli Zaretskii on Tue, 09
 May 2023 19:59:35 +0300)
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN> <835y97jnfd.fsf@HIDDEN>
 <iera5yetxzv.fsf@HIDDEN> <83pm7aay70.fsf@HIDDEN>
 <874jol1rml.fsf@HIDDEN> <831qjpbj8j.fsf@HIDDEN>
 <ier7cthtqkt.fsf@HIDDEN> <83wn1ha220.fsf@HIDDEN>
 <ier4joltpiz.fsf@HIDDEN> <83sfc5a1ag.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62958
Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
> Date: Tue, 09 May 2023 19:59:35 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> I'm asking why this is not already obvious from the fact that this is
> a defcustom, by default off.  All your addition says is "don't disable
> paging in all cases, sometimes it can be useful".  But we already said
> that, in effect, by making the paging enabled by default.  So there's
> no reason to have that text, as it isn't instrumental, and doesn't add
> anything.

Or let me turn the table and ask whether the following minor
rephrasing of what I proposed will satisfy you:

  Pagination is normally not needed, and might get in the way, when
  the output of the program is directed to an Emacs buffer, so in
  those cases pagination might need to be disabled.  To disable
  pagination, this variable's value should be a string that names a
  program, such as \"cat\", which passes through all of the output
  without any filtering or delays.  Comint will then set the PAGER
  variable to name that program, when it invokes external programs."




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

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


Received: (at 62958) by debbugs.gnu.org; 9 May 2023 17:01:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 09 13:01:25 2023
Received: from localhost ([127.0.0.1]:44317 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwQiL-0007i2-9k
	for submit <at> debbugs.gnu.org; Tue, 09 May 2023 13:01:25 -0400
Received: from mxout6.mail.janestreet.com ([64.215.233.21]:45125)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1pwQiJ-0007hm-6S
 for 62958 <at> debbugs.gnu.org; Tue, 09 May 2023 13:01:24 -0400
Received: from mail-ua1-f69.google.com ([209.85.222.69])
 by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128)
 (Exim 4.96) id 1pwQiC-0081cc-2K for 62958 <at> debbugs.gnu.org;
 Tue, 09 May 2023 13:01:18 -0400
Received: by mail-ua1-f69.google.com with SMTP id
 a1e0cc1a2514c-7809ab7c361so1665255241.0
 for <62958 <at> debbugs.gnu.org>; Tue, 09 May 2023 10:01:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=janestreet.com; s=google; t=1683651677; x=1686243677;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=8O7Z3GQpIoL9i+3JCSKLK77YcksypALEtshPiPEtmS8=;
 b=maHSMSdin1OKUeom9tjhuFaGCJb83YmQtI7fnDZVX3/bvzCqOapi9xtxEFCXWQuPyb
 4ynxpJu4mEGS2y3EcdZHtEOXiRjsX4rUu1a0TR5uRzAqNF5ev/heDWKAKeq4Egq89bs2
 MOBExOQdbri88KXuQmwIvMPQ/qhIZM1w1ijHw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1683651677; x=1686243677;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=8O7Z3GQpIoL9i+3JCSKLK77YcksypALEtshPiPEtmS8=;
 b=g1LBEx5pXgaETM0PTYKYPDDIEhn8oGICVzK0u2qNdAJwI/bl6B2l/LrwnhSb9CRNzG
 7zR95PPb7yPZbdpOzwHRkp1wv2FDnx9G1BP/PlttDZhBOwrscbaz0YUC1eGYaosgY42V
 tEilbf8emuxqTFf0wddjVB+IGjQZIR+41hH/9eo86o9pObddfJ75pBda27JOetGmn5O4
 S56SZpdSNAWXAJ1pXRVlwDuhSZb7YQbFrieqVYQVCRmLPxTztUN90jM0ZAzRfNkeurpy
 30wIlK+s/hVS3M5xJQvTYe0zSMBhS6eCW3p9tccRSeTGVB8+c/EjGvfPs1SmXQ4+6DDM
 2vIw==
X-Gm-Message-State: AC+VfDz2Gaz2iIQimSCU3mIost+TcmOg91o4fRomxLv07VpYDdH46riF
 P4huGtUrZ9OD8jWRAZPG3Mh/WbEwf5xaCvQNNMvypY3nwQ2ub2ZYcuLKNylujvqiJHGTNG73a2v
 bk/ZtIWrRlaxUsTmc1tqhPZkxkpfiOg==
X-Received: by 2002:a67:d005:0:b0:42e:41d9:4ea8 with SMTP id
 r5-20020a67d005000000b0042e41d94ea8mr5008752vsi.9.1683651677764; 
 Tue, 09 May 2023 10:01:17 -0700 (PDT)
X-Google-Smtp-Source: ACHHUZ6oAO9BlWmsp7BvcF1px1OhkuG1XXg/5jVFnOjQrZvaphNsMarNfvzWsxYk80fi5e49XlkdOGhVL2+PAzklfRg=
X-Received: by 2002:a67:d005:0:b0:42e:41d9:4ea8 with SMTP id
 r5-20020a67d005000000b0042e41d94ea8mr5008739vsi.9.1683651677535; Tue, 09 May
 2023 10:01:17 -0700 (PDT)
MIME-Version: 1.0
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN>
 <835y97jnfd.fsf@HIDDEN> <iera5yetxzv.fsf@HIDDEN>
 <83pm7aay70.fsf@HIDDEN>
 <874jol1rml.fsf@HIDDEN> <831qjpbj8j.fsf@HIDDEN>
 <ier7cthtqkt.fsf@HIDDEN>
 <83wn1ha220.fsf@HIDDEN> <ier4joltpiz.fsf@HIDDEN>
 <83sfc5a1ag.fsf@HIDDEN>
In-Reply-To: <83sfc5a1ag.fsf@HIDDEN>
From: Spencer Baugh <sbaugh@HIDDEN>
Date: Tue, 9 May 2023 13:01:07 -0400
Message-ID: <CAO=BR8N-=uQtNEaEmEQ_XynNYpSQmZVD1mWYC5_AYFEV6XYQ-w@HIDDEN>
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000002a51ec05fb45b440"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 62958
Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000002a51ec05fb45b440
Content-Type: text/plain; charset="UTF-8"

On Tue, May 9, 2023, 12:58 Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Spencer Baugh <sbaugh@HIDDEN>
> > Cc: sbaugh@HIDDEN,  62958 <at> debbugs.gnu.org
> > Date: Tue, 09 May 2023 12:53:24 -0400
> >
> > > OK, but what's the purpose of the addition you were proposing?  It
> > > basically says that sometimes paging should not be disabled, but since
> > > this is a defcustom, and the default is not to disable paging, that
> > > already speaks volumes about the same issue, right?
> >
> > My addition says:
> > - sometimes paging should not be disabled (for programs like "git log")
> > - but if you're going to disable it anyway, commands like `vc-print-log'
> >   become more useful (because it's an alternative to "git log")
> >
> > The purpose of the addition is to communicate the second part.  (And
> > since I think the primary way most people will encounter this is through
> > "git log", I think it's worth mentioning `vc-print-log' specifically)
>
> I'm asking why this is not already obvious from the fact that this is
> a defcustom, by default off.  All your addition says is "don't disable
> paging in all cases, sometimes it can be useful".  But we already said
> that, in effect, by making the paging enabled by default.  So there's
> no reason to have that text, as it isn't instrumental, and doesn't add
> anything.
>

How does "this is a defcustom, by default off" communicate "you should use
vc-print-log if you turn this on"?

>

--0000000000002a51ec05fb45b440
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D=
"gmail_attr">On Tue, May 9, 2023, 12:58 Eli Zaretskii &lt;<a href=3D"mailto=
:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le=
ft:1ex">&gt; From: Spencer Baugh &lt;<a href=3D"mailto:sbaugh@HIDDEN=
m" target=3D"_blank" rel=3D"noreferrer">sbaugh@HIDDEN</a>&gt;<br>
&gt; Cc: <a href=3D"mailto:sbaugh@HIDDEN" target=3D"_blank" rel=3D"nore=
ferrer">sbaugh@HIDDEN</a>,=C2=A0 <a href=3D"mailto:62958@HIDDEN=
g" target=3D"_blank" rel=3D"noreferrer">62958 <at> debbugs.gnu.org</a><br>
&gt; Date: Tue, 09 May 2023 12:53:24 -0400<br>
&gt; <br>
&gt; &gt; OK, but what&#39;s the purpose of the addition you were proposing=
?=C2=A0 It<br>
&gt; &gt; basically says that sometimes paging should not be disabled, but =
since<br>
&gt; &gt; this is a defcustom, and the default is not to disable paging, th=
at<br>
&gt; &gt; already speaks volumes about the same issue, right?<br>
&gt; <br>
&gt; My addition says:<br>
&gt; - sometimes paging should not be disabled (for programs like &quot;git=
 log&quot;)<br>
&gt; - but if you&#39;re going to disable it anyway, commands like `vc-prin=
t-log&#39;<br>
&gt;=C2=A0 =C2=A0become more useful (because it&#39;s an alternative to &qu=
ot;git log&quot;)<br>
&gt; <br>
&gt; The purpose of the addition is to communicate the second part.=C2=A0 (=
And<br>
&gt; since I think the primary way most people will encounter this is throu=
gh<br>
&gt; &quot;git log&quot;, I think it&#39;s worth mentioning `vc-print-log&#=
39; specifically)<br>
<br>
I&#39;m asking why this is not already obvious from the fact that this is<b=
r>
a defcustom, by default off.=C2=A0 All your addition says is &quot;don&#39;=
t disable<br>
paging in all cases, sometimes it can be useful&quot;.=C2=A0 But we already=
 said<br>
that, in effect, by making the paging enabled by default.=C2=A0 So there&#3=
9;s<br>
no reason to have that text, as it isn&#39;t instrumental, and doesn&#39;t =
add<br>
anything.<br></blockquote></div></div><div dir=3D"auto"><br></div><div dir=
=3D"auto">How does &quot;this is a defcustom, by default off&quot; communic=
ate &quot;you should use vc-print-log if you turn this on&quot;?</div><div =
dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>

--0000000000002a51ec05fb45b440--




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

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


Received: (at 62958) by debbugs.gnu.org; 9 May 2023 16:58:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 09 12:58:42 2023
Received: from localhost ([127.0.0.1]:44303 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwQfi-0007ay-5z
	for submit <at> debbugs.gnu.org; Tue, 09 May 2023 12:58:42 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56736)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pwQfd-0007ai-GR
 for 62958 <at> debbugs.gnu.org; Tue, 09 May 2023 12:58:41 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwQfY-0004WZ-0b; Tue, 09 May 2023 12:58:32 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=mMqy4lfRrFWzkRfj1gacay1NcJnvIxyIcqedkkhH274=; b=KekdG/qrQz4k
 N+ZhW+SIU05POxEfzz7rncLhgH82w1nkl7o0BCpYmWZUSMCgzFDBQaONfiunDtOLRS6g/Hj+fPR9L
 YyOwLIFxBn2XnxCIdYoaUfXxn0xG9yuX4DdxZIFvUci98n1p1qUSAga/dAqnt9qil9XwLXgK2ScUa
 QQJ1yAYwIr3ln+oyy2QUbpgfLzazPfk7/4O5xegWkN9gsHCI4ZoxMTWu3rpLa13AHGMvPukg3aUj4
 p9pdaWQm58c/l9LlRd+erG68FBS9xmJPnoHW7pBMJMJqf+SmFJAT9YAs+Bk88zM+je9ZwR2ZUuynz
 FlFeBMV1RXfqojb8zTzbSw==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwQfX-0000an-G7; Tue, 09 May 2023 12:58:31 -0400
Date: Tue, 09 May 2023 19:59:35 +0300
Message-Id: <83sfc5a1ag.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <ier4joltpiz.fsf@HIDDEN> (message from Spencer Baugh on
 Tue, 09 May 2023 12:53:24 -0400)
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN> <835y97jnfd.fsf@HIDDEN>
 <iera5yetxzv.fsf@HIDDEN> <83pm7aay70.fsf@HIDDEN>
 <874jol1rml.fsf@HIDDEN> <831qjpbj8j.fsf@HIDDEN>
 <ier7cthtqkt.fsf@HIDDEN> <83wn1ha220.fsf@HIDDEN>
 <ier4joltpiz.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62958
Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Spencer Baugh <sbaugh@HIDDEN>
> Cc: sbaugh@HIDDEN,  62958 <at> debbugs.gnu.org
> Date: Tue, 09 May 2023 12:53:24 -0400
> 
> > OK, but what's the purpose of the addition you were proposing?  It
> > basically says that sometimes paging should not be disabled, but since
> > this is a defcustom, and the default is not to disable paging, that
> > already speaks volumes about the same issue, right?
> 
> My addition says:
> - sometimes paging should not be disabled (for programs like "git log")
> - but if you're going to disable it anyway, commands like `vc-print-log'
>   become more useful (because it's an alternative to "git log")
> 
> The purpose of the addition is to communicate the second part.  (And
> since I think the primary way most people will encounter this is through
> "git log", I think it's worth mentioning `vc-print-log' specifically)

I'm asking why this is not already obvious from the fact that this is
a defcustom, by default off.  All your addition says is "don't disable
paging in all cases, sometimes it can be useful".  But we already said
that, in effect, by making the paging enabled by default.  So there's
no reason to have that text, as it isn't instrumental, and doesn't add
anything.




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

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


Received: (at 62958) by debbugs.gnu.org; 9 May 2023 16:53:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 09 12:53:34 2023
Received: from localhost ([127.0.0.1]:44298 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwQak-0007Nv-8F
	for submit <at> debbugs.gnu.org; Tue, 09 May 2023 12:53:34 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:54599)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1pwQag-0007Nd-2o
 for 62958 <at> debbugs.gnu.org; Tue, 09 May 2023 12:53:33 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
In-Reply-To: <83wn1ha220.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 09 May
 2023 19:43:03 +0300")
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN> <835y97jnfd.fsf@HIDDEN>
 <iera5yetxzv.fsf@HIDDEN> <83pm7aay70.fsf@HIDDEN>
 <874jol1rml.fsf@HIDDEN> <831qjpbj8j.fsf@HIDDEN>
 <ier7cthtqkt.fsf@HIDDEN> <83wn1ha220.fsf@HIDDEN>
Date: Tue, 09 May 2023 12:53:24 -0400
Message-ID: <ier4joltpiz.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 62958
Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Spencer Baugh <sbaugh@HIDDEN>
>> Cc: sbaugh@HIDDEN,  62958 <at> debbugs.gnu.org
>> Date: Tue, 09 May 2023 12:30:42 -0400
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> 
>> >> From: sbaugh@HIDDEN
>> >> Date: Tue, 09 May 2023 14:55:31 +0000 (UTC)
>> >> Cc: Spencer Baugh <sbaugh@HIDDEN>, 62958 <at> debbugs.gnu.org
>> >> 
>> >> Eli Zaretskii <eliz@HIDDEN> writes:
>> >> 
>> >> >> From: Spencer Baugh <sbaugh@HIDDEN>
>> >> >> Cc: 62958 <at> debbugs.gnu.org
>> >> >> Date: Mon, 08 May 2023 15:38:12 -0400
>> >> >> 
>> >> >> >   Pagination is not needed, and gets in the way, when the output of
>> >> >> >   the program is directed to an Emacs buffer, so in those cases
>> >> >> >   pagination should be disabled.  To disable pagination, this
>> >> >> >   variable's value should be a string that names a program, such
>> >> >> >   as \"cat\", which passes through all of the output without any
>> >> >> >   filtering or delays.  Comint will then set the PAGER variable
>> >> >> >   to name that program, when it invokes external programs."
>> >> >> 
>> >> >> I think it's worth noting the fact that there are programs which depend
>> >> >> on pagination for their normal functionality.  How about this short
>> >> >> additional paragraph added after your text:
>> >> >> 
>> >> >> "Disabling pagination means programs will produce their entire output
>> >> >> immediately.  If only part of the output is useful, this can be
>> >> >> wasteful.  For some programs, this can be avoided by using commands (for
>> >> >> example, `vc-print-log') which run the program, limit the output it
>> >> >> produces, and let the user interactively browse the output inside
>> >> >> Emacs."
>> >> >
>> >> > Sorry, I don't understand: why would it matter that a program produces
>> >> > its output immediately when that output is redirected to an Emacs
>> >> > buffer?  Whatever the amount of output, the user can always page
>> >> > through it interactively and conveniently using the normal movement
>> >> > commands, no?  What am I missing?
>> >> 
>> >> If the command produces a lot of output it can take a long time to run
>> >> and slow down Emacs.
>> >> 
>> >> For example, if a user disables pagination, runs M-x shell, and then
>> >> runs "git log" in the Emacs repo, it takes ~3.5 minutes to run and
>> >> produces ~1.5 million lines.  Even if all they want is to see the 10
>> >> most recent commits.  There are several negative effects of this, in
>> >> decreasing order of importance:
>> >> 
>> >> - The shell buffer now has way more output, which slows down navigation
>> >> and operations on that buffer forever after, including font lock.
>> >> - The user's shell is blocked during that whole time, preventing further
>> >> shell commands.
>> >> - git log producing unnecessary output wastes CPU and IO.
>> >> 
>> >> If "git log" is run with a pager, it can complete as soon as the user
>> >> exits the pager, and it only produces a few lines.
>> >
>> > But this is impossible in general, AFAIU: most comint clients aren't
>> > prepared for interactive paging anyway.  If someone wants paging, they
>> > should use "M-x term" or "M-x ansi-term", the terminal emulators that
>> > Emacs provides.
>> 
>> Yes.  I of course know that, that's why I filed this bug :)
>> 
>> Nevertheless, today by default many programs run in comint clients will
>> run a pager, and even though it is a hassle and gets in the way inside
>> Emacs, it does prevent some programs from producing lots of output and
>> yielding the negative effects I mentioned previously:
>> 
>> >> - The shell buffer now has way more output, which slows down navigation
>> >> and operations on that buffer forever after, including font lock.
>> >> - The user's shell is blocked during that whole time, preventing further
>> >> shell commands.
>> >> - git log producing unnecessary output wastes CPU and IO.
>> 
>> Because of these negative effects which will start happening for some
>> programs when the user disables pagination, I think it's important for
>> users to know that there's alternatives for such programs: namely, using
>> native Emacs interfaces like vc-print-log.
>
> OK, but what's the purpose of the addition you were proposing?  It
> basically says that sometimes paging should not be disabled, but since
> this is a defcustom, and the default is not to disable paging, that
> already speaks volumes about the same issue, right?

My addition says:
- sometimes paging should not be disabled (for programs like "git log")
- but if you're going to disable it anyway, commands like `vc-print-log'
  become more useful (because it's an alternative to "git log")

The purpose of the addition is to communicate the second part.  (And
since I think the primary way most people will encounter this is through
"git log", I think it's worth mentioning `vc-print-log' specifically)




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

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


Received: (at 62958) by debbugs.gnu.org; 9 May 2023 16:42:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 09 12:42:10 2023
Received: from localhost ([127.0.0.1]:44279 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwQPi-0006vD-5G
	for submit <at> debbugs.gnu.org; Tue, 09 May 2023 12:42:10 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39308)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pwQPe-0006ug-QD
 for 62958 <at> debbugs.gnu.org; Tue, 09 May 2023 12:42:08 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwQPZ-0001Ap-91; Tue, 09 May 2023 12:42:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=DkO2I/FSp3LVbOgndWYgkRX9xwT8die6w3FVXCKsuuE=; b=Jx6SIg3s3CqF
 CPUhh0yGiA+MzB86R67ArqKKkGSl8RFogcxyWLVr+JXJ6/x98WI4AoRmHoPHB5+28kImOTfN6mIWT
 3QmXHT5T0ShD6xbKK8iTwR/I9nTY5WMBJNly+UFHH+WLWUHR5B3876vbhrxWn8c1xUVUMGLJI9eMw
 7NSQt3D5xAuY/lJPal7WHrcDduMmr2AAl7gHmthqy1eNFbOOZOhDdto9rCsJ0yTWiec0+Jv+UywzU
 YI0xrhTS1f4XFSE+vytqv/3CjLp6MszAEOSE0+YyvtuAVvWc9mgBinPSABJjXLGqc+3I4yWgROkCZ
 Y7lOoc4Xn2JLh0jHGVTuBA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwQPY-0002PE-Ot; Tue, 09 May 2023 12:42:01 -0400
Date: Tue, 09 May 2023 19:43:03 +0300
Message-Id: <83wn1ha220.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <ier7cthtqkt.fsf@HIDDEN> (message from Spencer Baugh on
 Tue, 09 May 2023 12:30:42 -0400)
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN> <835y97jnfd.fsf@HIDDEN>
 <iera5yetxzv.fsf@HIDDEN> <83pm7aay70.fsf@HIDDEN>
 <874jol1rml.fsf@HIDDEN> <831qjpbj8j.fsf@HIDDEN>
 <ier7cthtqkt.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62958
Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Spencer Baugh <sbaugh@HIDDEN>
> Cc: sbaugh@HIDDEN,  62958 <at> debbugs.gnu.org
> Date: Tue, 09 May 2023 12:30:42 -0400
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> From: sbaugh@HIDDEN
> >> Date: Tue, 09 May 2023 14:55:31 +0000 (UTC)
> >> Cc: Spencer Baugh <sbaugh@HIDDEN>, 62958 <at> debbugs.gnu.org
> >> 
> >> Eli Zaretskii <eliz@HIDDEN> writes:
> >> 
> >> >> From: Spencer Baugh <sbaugh@HIDDEN>
> >> >> Cc: 62958 <at> debbugs.gnu.org
> >> >> Date: Mon, 08 May 2023 15:38:12 -0400
> >> >> 
> >> >> >   Pagination is not needed, and gets in the way, when the output of
> >> >> >   the program is directed to an Emacs buffer, so in those cases
> >> >> >   pagination should be disabled.  To disable pagination, this
> >> >> >   variable's value should be a string that names a program, such
> >> >> >   as \"cat\", which passes through all of the output without any
> >> >> >   filtering or delays.  Comint will then set the PAGER variable
> >> >> >   to name that program, when it invokes external programs."
> >> >> 
> >> >> I think it's worth noting the fact that there are programs which depend
> >> >> on pagination for their normal functionality.  How about this short
> >> >> additional paragraph added after your text:
> >> >> 
> >> >> "Disabling pagination means programs will produce their entire output
> >> >> immediately.  If only part of the output is useful, this can be
> >> >> wasteful.  For some programs, this can be avoided by using commands (for
> >> >> example, `vc-print-log') which run the program, limit the output it
> >> >> produces, and let the user interactively browse the output inside
> >> >> Emacs."
> >> >
> >> > Sorry, I don't understand: why would it matter that a program produces
> >> > its output immediately when that output is redirected to an Emacs
> >> > buffer?  Whatever the amount of output, the user can always page
> >> > through it interactively and conveniently using the normal movement
> >> > commands, no?  What am I missing?
> >> 
> >> If the command produces a lot of output it can take a long time to run
> >> and slow down Emacs.
> >> 
> >> For example, if a user disables pagination, runs M-x shell, and then
> >> runs "git log" in the Emacs repo, it takes ~3.5 minutes to run and
> >> produces ~1.5 million lines.  Even if all they want is to see the 10
> >> most recent commits.  There are several negative effects of this, in
> >> decreasing order of importance:
> >> 
> >> - The shell buffer now has way more output, which slows down navigation
> >> and operations on that buffer forever after, including font lock.
> >> - The user's shell is blocked during that whole time, preventing further
> >> shell commands.
> >> - git log producing unnecessary output wastes CPU and IO.
> >> 
> >> If "git log" is run with a pager, it can complete as soon as the user
> >> exits the pager, and it only produces a few lines.
> >
> > But this is impossible in general, AFAIU: most comint clients aren't
> > prepared for interactive paging anyway.  If someone wants paging, they
> > should use "M-x term" or "M-x ansi-term", the terminal emulators that
> > Emacs provides.
> 
> Yes.  I of course know that, that's why I filed this bug :)
> 
> Nevertheless, today by default many programs run in comint clients will
> run a pager, and even though it is a hassle and gets in the way inside
> Emacs, it does prevent some programs from producing lots of output and
> yielding the negative effects I mentioned previously:
> 
> >> - The shell buffer now has way more output, which slows down navigation
> >> and operations on that buffer forever after, including font lock.
> >> - The user's shell is blocked during that whole time, preventing further
> >> shell commands.
> >> - git log producing unnecessary output wastes CPU and IO.
> 
> Because of these negative effects which will start happening for some
> programs when the user disables pagination, I think it's important for
> users to know that there's alternatives for such programs: namely, using
> native Emacs interfaces like vc-print-log.

OK, but what's the purpose of the addition you were proposing?  It
basically says that sometimes paging should not be disabled, but since
this is a defcustom, and the default is not to disable paging, that
already speaks volumes about the same issue, right?




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

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


Received: (at 62958) by debbugs.gnu.org; 9 May 2023 16:30:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 09 12:30:50 2023
Received: from localhost ([127.0.0.1]:44270 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwQEk-0006b6-G2
	for submit <at> debbugs.gnu.org; Tue, 09 May 2023 12:30:50 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:57623)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1pwQEi-0006ar-EA
 for 62958 <at> debbugs.gnu.org; Tue, 09 May 2023 12:30:48 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
In-Reply-To: <831qjpbj8j.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 09 May
 2023 18:46:36 +0300")
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN> <835y97jnfd.fsf@HIDDEN>
 <iera5yetxzv.fsf@HIDDEN> <83pm7aay70.fsf@HIDDEN>
 <874jol1rml.fsf@HIDDEN> <831qjpbj8j.fsf@HIDDEN>
Date: Tue, 09 May 2023 12:30:42 -0400
Message-ID: <ier7cthtqkt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 62958
Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: sbaugh@HIDDEN
>> Date: Tue, 09 May 2023 14:55:31 +0000 (UTC)
>> Cc: Spencer Baugh <sbaugh@HIDDEN>, 62958 <at> debbugs.gnu.org
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> 
>> >> From: Spencer Baugh <sbaugh@HIDDEN>
>> >> Cc: 62958 <at> debbugs.gnu.org
>> >> Date: Mon, 08 May 2023 15:38:12 -0400
>> >> 
>> >> >   Pagination is not needed, and gets in the way, when the output of
>> >> >   the program is directed to an Emacs buffer, so in those cases
>> >> >   pagination should be disabled.  To disable pagination, this
>> >> >   variable's value should be a string that names a program, such
>> >> >   as \"cat\", which passes through all of the output without any
>> >> >   filtering or delays.  Comint will then set the PAGER variable
>> >> >   to name that program, when it invokes external programs."
>> >> 
>> >> I think it's worth noting the fact that there are programs which depend
>> >> on pagination for their normal functionality.  How about this short
>> >> additional paragraph added after your text:
>> >> 
>> >> "Disabling pagination means programs will produce their entire output
>> >> immediately.  If only part of the output is useful, this can be
>> >> wasteful.  For some programs, this can be avoided by using commands (for
>> >> example, `vc-print-log') which run the program, limit the output it
>> >> produces, and let the user interactively browse the output inside
>> >> Emacs."
>> >
>> > Sorry, I don't understand: why would it matter that a program produces
>> > its output immediately when that output is redirected to an Emacs
>> > buffer?  Whatever the amount of output, the user can always page
>> > through it interactively and conveniently using the normal movement
>> > commands, no?  What am I missing?
>> 
>> If the command produces a lot of output it can take a long time to run
>> and slow down Emacs.
>> 
>> For example, if a user disables pagination, runs M-x shell, and then
>> runs "git log" in the Emacs repo, it takes ~3.5 minutes to run and
>> produces ~1.5 million lines.  Even if all they want is to see the 10
>> most recent commits.  There are several negative effects of this, in
>> decreasing order of importance:
>> 
>> - The shell buffer now has way more output, which slows down navigation
>> and operations on that buffer forever after, including font lock.
>> - The user's shell is blocked during that whole time, preventing further
>> shell commands.
>> - git log producing unnecessary output wastes CPU and IO.
>> 
>> If "git log" is run with a pager, it can complete as soon as the user
>> exits the pager, and it only produces a few lines.
>
> But this is impossible in general, AFAIU: most comint clients aren't
> prepared for interactive paging anyway.  If someone wants paging, they
> should use "M-x term" or "M-x ansi-term", the terminal emulators that
> Emacs provides.

Yes.  I of course know that, that's why I filed this bug :)

Nevertheless, today by default many programs run in comint clients will
run a pager, and even though it is a hassle and gets in the way inside
Emacs, it does prevent some programs from producing lots of output and
yielding the negative effects I mentioned previously:

>> - The shell buffer now has way more output, which slows down navigation
>> and operations on that buffer forever after, including font lock.
>> - The user's shell is blocked during that whole time, preventing further
>> shell commands.
>> - git log producing unnecessary output wastes CPU and IO.

Because of these negative effects which will start happening for some
programs when the user disables pagination, I think it's important for
users to know that there's alternatives for such programs: namely, using
native Emacs interfaces like vc-print-log.




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

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


Received: (at 62958) by debbugs.gnu.org; 9 May 2023 15:45:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 09 11:45:57 2023
Received: from localhost ([127.0.0.1]:44182 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwPXI-0005A7-KQ
	for submit <at> debbugs.gnu.org; Tue, 09 May 2023 11:45:56 -0400
Received: from eggs.gnu.org ([209.51.188.92]:55486)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pwPXD-00059r-Gk
 for 62958 <at> debbugs.gnu.org; Tue, 09 May 2023 11:45:55 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwPX6-0005uT-GT; Tue, 09 May 2023 11:45:45 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=Cks429Xil6H62HILpbHxS8vQd2603hwrHebfIzEc2dg=; b=drboSxWnhjcQ
 Ycxt86MOMb9OaS04SdfQSrZwrj43DgNbdD+c8FiIOeKgls6Csa0h6ufa7j6enxC8bIkzdDndELFDh
 hpkmzerVvuJtO5z8YHWz/SaYaQDREn/gassbRrOcUeObkcrMMDnH4e9/gd9+th2yKUMM5B3x1mhpr
 UCGiBPjg4tuTS7F4DZan6Du4oN7ZvEAaIwbpQOMtKB1E1bWZPf6jVt49TgwWb7uK8Zy2T2p2dp8qX
 ATB+mp+6K9Dm86kb11hZBBFuEYJ+ii3mT/ij5HHEy7GavJxGjqzxNEjpBcRvzfn1tS8v3VRSNsBKV
 0JsghccIH/E95qlp16m4xA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwPWv-0000uz-2j; Tue, 09 May 2023 11:45:44 -0400
Date: Tue, 09 May 2023 18:46:36 +0300
Message-Id: <831qjpbj8j.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: sbaugh@HIDDEN
In-Reply-To: <874jol1rml.fsf@HIDDEN> (sbaugh@HIDDEN)
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN> <835y97jnfd.fsf@HIDDEN>
 <iera5yetxzv.fsf@HIDDEN> <83pm7aay70.fsf@HIDDEN>
 <874jol1rml.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62958
Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: sbaugh@HIDDEN
> Date: Tue, 09 May 2023 14:55:31 +0000 (UTC)
> Cc: Spencer Baugh <sbaugh@HIDDEN>, 62958 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> From: Spencer Baugh <sbaugh@HIDDEN>
> >> Cc: 62958 <at> debbugs.gnu.org
> >> Date: Mon, 08 May 2023 15:38:12 -0400
> >> 
> >> >   Pagination is not needed, and gets in the way, when the output of
> >> >   the program is directed to an Emacs buffer, so in those cases
> >> >   pagination should be disabled.  To disable pagination, this
> >> >   variable's value should be a string that names a program, such
> >> >   as \"cat\", which passes through all of the output without any
> >> >   filtering or delays.  Comint will then set the PAGER variable
> >> >   to name that program, when it invokes external programs."
> >> 
> >> I think it's worth noting the fact that there are programs which depend
> >> on pagination for their normal functionality.  How about this short
> >> additional paragraph added after your text:
> >> 
> >> "Disabling pagination means programs will produce their entire output
> >> immediately.  If only part of the output is useful, this can be
> >> wasteful.  For some programs, this can be avoided by using commands (for
> >> example, `vc-print-log') which run the program, limit the output it
> >> produces, and let the user interactively browse the output inside
> >> Emacs."
> >
> > Sorry, I don't understand: why would it matter that a program produces
> > its output immediately when that output is redirected to an Emacs
> > buffer?  Whatever the amount of output, the user can always page
> > through it interactively and conveniently using the normal movement
> > commands, no?  What am I missing?
> 
> If the command produces a lot of output it can take a long time to run
> and slow down Emacs.
> 
> For example, if a user disables pagination, runs M-x shell, and then
> runs "git log" in the Emacs repo, it takes ~3.5 minutes to run and
> produces ~1.5 million lines.  Even if all they want is to see the 10
> most recent commits.  There are several negative effects of this, in
> decreasing order of importance:
> 
> - The shell buffer now has way more output, which slows down navigation
> and operations on that buffer forever after, including font lock.
> - The user's shell is blocked during that whole time, preventing further
> shell commands.
> - git log producing unnecessary output wastes CPU and IO.
> 
> If "git log" is run with a pager, it can complete as soon as the user
> exits the pager, and it only produces a few lines.

But this is impossible in general, AFAIU: most comint clients aren't
prepared for interactive paging anyway.  If someone wants paging, they
should use "M-x term" or "M-x ansi-term", the terminal emulators that
Emacs provides.




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

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


Received: (at 62958) by debbugs.gnu.org; 9 May 2023 14:55:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 09 10:55:40 2023
Received: from localhost ([127.0.0.1]:44134 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwOke-0003ke-Ek
	for submit <at> debbugs.gnu.org; Tue, 09 May 2023 10:55:40 -0400
Received: from s.wrqvtbkv.outbound-mail.sendgrid.net ([149.72.123.24]:52200)
 by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from
 <bounces+21787432-10d2-62958=debbugs.gnu.org@HIDDEN>)
 id 1pwOkb-0003kN-BJ
 for 62958 <at> debbugs.gnu.org; Tue, 09 May 2023 10:55:39 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com;
 h=from:subject:in-reply-to:references:mime-version:to:cc:content-type:
 content-transfer-encoding:cc:content-type:from:subject:to;
 s=s1; bh=429qDEOXiltlveYwlM4awZv+3E62gnzPJnN01FnATno=;
 b=Lc6DZP20SaVCMSGT8LOUKbx87R43Gbzdx0jrI9tJR7pKGGuTuKfw5NKdq7hvMcDEZB8t
 Ro/omyT8XNyBMgKKZ7YPZGbQRtIe5blin5oKN/5FktdAaiKUgdVSXDtcLMAoQQlyh9/OX5
 rVdcwm9x7+3bNq/c5vQhdOsrllDzaGAw9pogEOvilNb3M78EqF/Au5UJQaxkqX09r2E70J
 0CUbCZF4XAPQdCll/JttVYdSBgx5JhnbhPlpszRa4CH1GHH3fAde3Kl1PoaM2x48stKgun
 29J33vmGM4k33JIsngcBS4DaT+IFvkc4TeYNEyHAo1w6cHmPpF70BXZcfe04brVA==
Received: by filterdrecv-59cb65cf6d-sfxbf with SMTP id
 filterdrecv-59cb65cf6d-sfxbf-1-645A5EE3-46
 2023-05-09 14:55:31.803446724 +0000 UTC m=+6229481.086482838
Received: from earth.catern.com (unknown) by geopod-ismtpd-18 (SG) with ESMTP
 id JLNv_oMcRLKqEYrR1ojfCg Tue, 09 May 2023 14:55:31.555 +0000 (UTC)
X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost;
 envelope-from=sbaugh@HIDDEN; receiver=<UNKNOWN> 
Received: from localhost (localhost [IPv6:::1])
 by earth.catern.com (Postfix) with ESMTPSA id 078EF6009F;
 Tue,  9 May 2023 10:55:30 -0400 (EDT)
From: sbaugh@HIDDEN
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
In-Reply-To: <83pm7aay70.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 09 May
 2023 08:08:51 +0300")
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN> <835y97jnfd.fsf@HIDDEN>
 <iera5yetxzv.fsf@HIDDEN> <83pm7aay70.fsf@HIDDEN>
Date: Tue, 09 May 2023 14:55:31 +0000 (UTC)
Message-ID: <874jol1rml.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbKvpy28pmjEbiMHnWFqxK?=
 =?us-ascii?Q?jwcdDXq1g9gqdq2IVTcO8xf=2FV80XceuO5OqPIGO?=
 =?us-ascii?Q?HoM9SIm8uxTuAQdwRs4EYsOP3eiI4P2SYISU2AO?=
 =?us-ascii?Q?ZaTcMgA80g2Ne4SsJtU+9celxJlDqq1iD58pnao?=
 =?us-ascii?Q?LseW7JAqOSWyphQmeyzYZxIdSpkZcbN=2F8uA=3D=3D?=
To: Eli Zaretskii <eliz@HIDDEN>
X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q==
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 2.5 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: Eli Zaretskii <eliz@HIDDEN> writes: >> From: Spencer Baugh
 <sbaugh@HIDDEN> >> Cc: 62958 <at> debbugs.gnu.org >> Date: Mon, 08 May
 2023 15:38:12 -0400 >> >> > Pagination is not needed, and gets in the way,
 when the output of >> > the [...] 
 Content analysis details:   (2.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in
 bl.spamcop.net
 [Blocked - see <https://www.spamcop.net/bl.shtml?149.72.123.24>]
 1.3 RCVD_IN_VALIDITY_RPBL  RBL: Relay in Validity RPBL,
 https://senderscore.org/blocklistlookup/
 [149.72.123.24 listed in bl.score.senderscore.com]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 RCVD_IN_MSPIKE_BL      Mailspike blocklisted
 0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay
 lines 0.0 RCVD_IN_MSPIKE_ZBI     No description available.
X-Debbugs-Envelope-To: 62958
Cc: Spencer Baugh <sbaugh@HIDDEN>, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.5 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Eli Zaretskii <eliz@HIDDEN> writes: >> From: Spencer Baugh
    <sbaugh@HIDDEN> >> Cc: 62958 <at> debbugs.gnu.org >> Date: Mon, 08 May
    2023 15:38:12 -0400 >> >> > Pagination is not needed, and gets in the way,
    when the output of >> > the [...] 
 
 Content analysis details:   (1.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in
                             bl.spamcop.net
               [Blocked - see <https://www.spamcop.net/bl.shtml?149.72.123.24>]
  1.3 RCVD_IN_VALIDITY_RPBL  RBL: Relay in Validity RPBL,
                             https://senderscore.org/blocklistlookup/
                             [149.72.123.24 listed in bl.score.senderscore.com]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 RCVD_IN_MSPIKE_BL      Mailspike blocklisted
  0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay
                             lines
  0.0 RCVD_IN_MSPIKE_ZBI     No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Spencer Baugh <sbaugh@HIDDEN>
>> Cc: 62958 <at> debbugs.gnu.org
>> Date: Mon, 08 May 2023 15:38:12 -0400
>> 
>> >   Pagination is not needed, and gets in the way, when the output of
>> >   the program is directed to an Emacs buffer, so in those cases
>> >   pagination should be disabled.  To disable pagination, this
>> >   variable's value should be a string that names a program, such
>> >   as \"cat\", which passes through all of the output without any
>> >   filtering or delays.  Comint will then set the PAGER variable
>> >   to name that program, when it invokes external programs."
>> 
>> I think it's worth noting the fact that there are programs which depend
>> on pagination for their normal functionality.  How about this short
>> additional paragraph added after your text:
>> 
>> "Disabling pagination means programs will produce their entire output
>> immediately.  If only part of the output is useful, this can be
>> wasteful.  For some programs, this can be avoided by using commands (for
>> example, `vc-print-log') which run the program, limit the output it
>> produces, and let the user interactively browse the output inside
>> Emacs."
>
> Sorry, I don't understand: why would it matter that a program produces
> its output immediately when that output is redirected to an Emacs
> buffer?  Whatever the amount of output, the user can always page
> through it interactively and conveniently using the normal movement
> commands, no?  What am I missing?

If the command produces a lot of output it can take a long time to run
and slow down Emacs.

For example, if a user disables pagination, runs M-x shell, and then
runs "git log" in the Emacs repo, it takes ~3.5 minutes to run and
produces ~1.5 million lines.  Even if all they want is to see the 10
most recent commits.  There are several negative effects of this, in
decreasing order of importance:

- The shell buffer now has way more output, which slows down navigation
and operations on that buffer forever after, including font lock.
- The user's shell is blocked during that whole time, preventing further
shell commands.
- git log producing unnecessary output wastes CPU and IO.

If "git log" is run with a pager, it can complete as soon as the user
exits the pager, and it only produces a few lines.




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

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


Received: (at 62958) by debbugs.gnu.org; 9 May 2023 05:07:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 09 01:07:57 2023
Received: from localhost ([127.0.0.1]:42211 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwFZs-0005PU-QD
	for submit <at> debbugs.gnu.org; Tue, 09 May 2023 01:07:57 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37724)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pwFZr-0005PE-B5
 for 62958 <at> debbugs.gnu.org; Tue, 09 May 2023 01:07:55 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwFZl-0001fd-RZ; Tue, 09 May 2023 01:07:49 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=EzveeWyKGM4p2zDy6u4DM+B1/Lau66DJ/f+6z1QHZdU=; b=GvcdEB1Z0gac
 LxWPwPZdT6KHUuJqSHp25XW2GpPei7T2favHhgvRJNseN7GktclIfyehY4re3ZiVb/fyvSFv6CEID
 HTRLptteRvCnajDb7Rx2QLTA2W2x76UmGD98g+0PsAuS94GSwz7TOkVjoULXIxGPz5W0wR6aXe704
 D1UFrortsJdbw/TCbnRqSmqY7CBh9tp9A7kvK99MtjsaXABoXw3Rl5dnQ5LMa4iNhkTb7uJuURuqd
 qvVp+sHMn83swC+QiKr0vTpjupDS9QnZXeMUV4mCrRqbdukbIipGzeXtSYFFmSX00/6wDsjvRqM6B
 Dc5jVzlzSGR0pjtZPukVaQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwFZk-0003Sk-JI; Tue, 09 May 2023 01:07:49 -0400
Date: Tue, 09 May 2023 08:08:51 +0300
Message-Id: <83pm7aay70.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <iera5yetxzv.fsf@HIDDEN> (message from Spencer Baugh on
 Mon, 08 May 2023 15:38:12 -0400)
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN> <835y97jnfd.fsf@HIDDEN>
 <iera5yetxzv.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62958
Cc: 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Spencer Baugh <sbaugh@HIDDEN>
> Cc: 62958 <at> debbugs.gnu.org
> Date: Mon, 08 May 2023 15:38:12 -0400
> 
> >   Pagination is not needed, and gets in the way, when the output of
> >   the program is directed to an Emacs buffer, so in those cases
> >   pagination should be disabled.  To disable pagination, this
> >   variable's value should be a string that names a program, such
> >   as \"cat\", which passes through all of the output without any
> >   filtering or delays.  Comint will then set the PAGER variable
> >   to name that program, when it invokes external programs."
> 
> I think it's worth noting the fact that there are programs which depend
> on pagination for their normal functionality.  How about this short
> additional paragraph added after your text:
> 
> "Disabling pagination means programs will produce their entire output
> immediately.  If only part of the output is useful, this can be
> wasteful.  For some programs, this can be avoided by using commands (for
> example, `vc-print-log') which run the program, limit the output it
> produces, and let the user interactively browse the output inside
> Emacs."

Sorry, I don't understand: why would it matter that a program produces
its output immediately when that output is redirected to an Emacs
buffer?  Whatever the amount of output, the user can always page
through it interactively and conveniently using the normal movement
commands, no?  What am I missing?





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

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


Received: (at 62958) by debbugs.gnu.org; 8 May 2023 19:38:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 08 15:38:22 2023
Received: from localhost ([127.0.0.1]:41700 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pw6gf-0004ji-Nk
	for submit <at> debbugs.gnu.org; Mon, 08 May 2023 15:38:22 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:56897)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1pw6gd-0004jT-La
 for 62958 <at> debbugs.gnu.org; Mon, 08 May 2023 15:38:20 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
In-Reply-To: <835y97jnfd.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 05 May
 2023 09:35:18 +0300")
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN> <835y97jnfd.fsf@HIDDEN>
Date: Mon, 08 May 2023 15:38:12 -0400
Message-ID: <iera5yetxzv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 62958
Cc: 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Spencer Baugh <sbaugh@HIDDEN>
>> Cc: 62958 <at> debbugs.gnu.org
>> Date: Thu, 20 Apr 2023 12:01:49 -0400
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> > Is this about removing the leading directories from the value of
>> > executable-find?  If so, that is trivial to do, and is not the main
>> > point of what I wrote.
>> 
>> Yes.  But anyway, the default is nil now, so it should be fine.  Unless
>> you'd like the custom option of "cat" to not show up on non-UNIX
>> platforms, somehow?
>> 
>> >> > Should this test that comint-pager is a string?
>> >> 
>> >> I don't think that's necessary; doing
>> >> (if (stringp comint-pager) (list (format "PAGER=%s" comint-pager)))
>> >> would have unexpected behavior if comint-pager was accidentally set to a
>> >> non-string; doing
>> >> (when comint-pager (progn (assert (stringp comint-pager))
>> >>   (list (format "PAGER=%s" comint-pager))))
>> >> is a bit verbose and looks weird and is probably not that important.
>> >
>> > So we are okay with the user setting the variable to a symbol or a
>> > list or a vector?
>> 
>> Fair enough, I added a check:
>
> Thanks.  This is almost ready to go, I have only 2 minor comments:
>
>
>> diff --git a/lisp/comint.el b/lisp/comint.el
>> index 682b555a33c..a145751565f 100644
>> --- a/lisp/comint.el
>> +++ b/lisp/comint.el
>> @@ -258,6 +258,49 @@ comint-input-ring-file-name
>>  		 file)
>>    :group 'comint)
>>  
>> +(defcustom comint-pager nil
>> +  "If non-nil, name of the program to use as a pager.
>> +
>> +If non-nil, comint sets the PAGER environment variable to this
>> +value before starting a subprocess.  PAGER controls the pager
>> +that will be used.  If you prefer to not use a pager, you can set
>> +this variable to \"cat\".
>> +
>> +If nil, the PAGER environment variable is not set and the default
>> +pager will be used.  On Unix systems, typically this is \"less\".
>> +
>> +Some programs start a pager before producing output.  A pager
>> +supports viewing text page by page, so that if the parent program
>> +produces more output than will fit on the screen, that output can
>> +be viewed incrementally.
>> +
>> +When a program is running under Emacs, this behavior can be
>> +undesirable, since Emacs itself supports viewing text page by
>> +page, and a pager requires input from the user before it will
>> +show more text.  Furthermore, comint is not a full fledged
>> +terminal emulator, so a pager will typically behave badly.
>> +
>> +However, pagers also provide backpressure: They will not consume
>> +more output from the parent program than the user has actually
>> +viewed, which on Unix means the output pipe will fill up and the
>> +parent program will be stopped from producing unnecessary output.
>> +Many programs (such as \"git log\") take advantage of this by
>> +producing large amounts of output by default and relying on the
>> +pager to not consume text that the user doesn't view.
>> +
>> +Emacs and comint do not keep track of what text the user has
>> +viewed, so they can't provide backpressure like a pager does.
>> +This means users who do not use a pager should be careful to not
>> +run commands which produce a lot of output.  Users can avoid this
>> +by limiting the amount of output (such as with \"git log -n10\")
>> +or by using native Emacs interfaces instead (such as
>> +`vc-print-log')."
>
> This is too long, IMO.  There's no need for such a long doc string.  I
> have tried to make it shorter without losing important details:
>
>     "If non-nil, the program to use to disable pagination of program output.
>
>   Some programs produce large amounts of output, and have provision for
>   pagination of their output through a filter program, commonly known
>   as a \"pager\".  The pager allows the user to interactively browse
>   the output one page at a time.
>   Some programs paginate their output by default, by always starting
>   a pager.  The program they use as the pager is specified by the
>   environment variable PAGER; if that variable is not defined, they
>   use some fixed default, such as \"less\".
>
>   Pagination is not needed, and gets in the way, when the output of
>   the program is directed to an Emacs buffer, so in those cases
>   pagination should be disabled.  To disable pagination, this
>   variable's value should be a string that names a program, such
>   as \"cat\", which passes through all of the output without any
>   filtering or delays.  Comint will then set the PAGER variable
>   to name that program, when it invokes external programs."

I think it's worth noting the fact that there are programs which depend
on pagination for their normal functionality.  How about this short
additional paragraph added after your text:

"Disabling pagination means programs will produce their entire output
immediately.  If only part of the output is useful, this can be
wasteful.  For some programs, this can be avoided by using commands (for
example, `vc-print-log') which run the program, limit the output it
produces, and let the user interactively browse the output inside
Emacs."




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

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


Received: (at 62958) by debbugs.gnu.org; 5 May 2023 06:34:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 05 02:34:45 2023
Received: from localhost ([127.0.0.1]:52976 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pup1h-0007xD-89
	for submit <at> debbugs.gnu.org; Fri, 05 May 2023 02:34:45 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51694)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pup1e-0007wi-1L
 for 62958 <at> debbugs.gnu.org; Fri, 05 May 2023 02:34:44 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pup1Y-0003yi-Gd; Fri, 05 May 2023 02:34:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=pMzGOqcJP9JqRrkaUNpdbo65sJXcr3pSgzHyUWcN73o=; b=lfRHW2vMRzTt
 9KhOFyuI4batDIhMnUBWu0uzZZXHf72jbuOhEo/bF8g1+hyMesO/APSNWmvmqbCz+te8x8iX73N2Y
 81QhLXNdss3CmdbyVIW1zmv4XnzDjfJwlCBEap4mCVeNWqQpsyynOaBlRiviZlqtYPw+wpFurr89i
 MzTMdlePD6Vqbwf+GzWGy+dnnGGrhklFkqyyHAyO3aIsXthqxHPIjnCMeMYNZe1Q3CnaObiMl5JCr
 gk8opRqCItzIJDlox3m02+wojp1y4uh0K8AaHp2LEYss1mn97XtkQPztPB2QGNhkbI9SoQwc2grYT
 e7zV82w810vp1kEZOTGYtg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pup1Q-0003ot-5E; Fri, 05 May 2023 02:34:36 -0400
Date: Fri, 05 May 2023 09:35:18 +0300
Message-Id: <835y97jnfd.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <ierjzy6zgnm.fsf@HIDDEN> (message from Spencer Baugh on
 Thu, 20 Apr 2023 12:01:49 -0400)
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
 <ierjzy6zgnm.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62958
Cc: 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Spencer Baugh <sbaugh@HIDDEN>
> Cc: 62958 <at> debbugs.gnu.org
> Date: Thu, 20 Apr 2023 12:01:49 -0400
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> > Is this about removing the leading directories from the value of
> > executable-find?  If so, that is trivial to do, and is not the main
> > point of what I wrote.
> 
> Yes.  But anyway, the default is nil now, so it should be fine.  Unless
> you'd like the custom option of "cat" to not show up on non-UNIX
> platforms, somehow?
> 
> >> > Should this test that comint-pager is a string?
> >> 
> >> I don't think that's necessary; doing
> >> (if (stringp comint-pager) (list (format "PAGER=%s" comint-pager)))
> >> would have unexpected behavior if comint-pager was accidentally set to a
> >> non-string; doing
> >> (when comint-pager (progn (assert (stringp comint-pager))
> >>   (list (format "PAGER=%s" comint-pager))))
> >> is a bit verbose and looks weird and is probably not that important.
> >
> > So we are okay with the user setting the variable to a symbol or a
> > list or a vector?
> 
> Fair enough, I added a check:

Thanks.  This is almost ready to go, I have only 2 minor comments:


> diff --git a/lisp/comint.el b/lisp/comint.el
> index 682b555a33c..a145751565f 100644
> --- a/lisp/comint.el
> +++ b/lisp/comint.el
> @@ -258,6 +258,49 @@ comint-input-ring-file-name
>  		 file)
>    :group 'comint)
>  
> +(defcustom comint-pager nil
> +  "If non-nil, name of the program to use as a pager.
> +
> +If non-nil, comint sets the PAGER environment variable to this
> +value before starting a subprocess.  PAGER controls the pager
> +that will be used.  If you prefer to not use a pager, you can set
> +this variable to \"cat\".
> +
> +If nil, the PAGER environment variable is not set and the default
> +pager will be used.  On Unix systems, typically this is \"less\".
> +
> +Some programs start a pager before producing output.  A pager
> +supports viewing text page by page, so that if the parent program
> +produces more output than will fit on the screen, that output can
> +be viewed incrementally.
> +
> +When a program is running under Emacs, this behavior can be
> +undesirable, since Emacs itself supports viewing text page by
> +page, and a pager requires input from the user before it will
> +show more text.  Furthermore, comint is not a full fledged
> +terminal emulator, so a pager will typically behave badly.
> +
> +However, pagers also provide backpressure: They will not consume
> +more output from the parent program than the user has actually
> +viewed, which on Unix means the output pipe will fill up and the
> +parent program will be stopped from producing unnecessary output.
> +Many programs (such as \"git log\") take advantage of this by
> +producing large amounts of output by default and relying on the
> +pager to not consume text that the user doesn't view.
> +
> +Emacs and comint do not keep track of what text the user has
> +viewed, so they can't provide backpressure like a pager does.
> +This means users who do not use a pager should be careful to not
> +run commands which produce a lot of output.  Users can avoid this
> +by limiting the amount of output (such as with \"git log -n10\")
> +or by using native Emacs interfaces instead (such as
> +`vc-print-log')."

This is too long, IMO.  There's no need for such a long doc string.  I
have tried to make it shorter without losing important details:

    "If non-nil, the program to use to disable pagination of program output.

  Some programs produce large amounts of output, and have provision for
  pagination of their output through a filter program, commonly known
  as a \"pager\".  The pager allows the user to interactively browse
  the output one page at a time.
  Some programs paginate their output by default, by always starting
  a pager.  The program they use as the pager is specified by the
  environment variable PAGER; if that variable is not defined, they
  use some fixed default, such as \"less\".

  Pagination is not needed, and gets in the way, when the output of
  the program is directed to an Emacs buffer, so in those cases
  pagination should be disabled.  To disable pagination, this
  variable's value should be a string that names a program, such
  as \"cat\", which passes through all of the output without any
  filtering or delays.  Comint will then set the PAGER variable
  to name that program, when it invokes external programs."

> +  :type '(choice (const :tag "Use default PAGER" nil)
> +                 (const :tag "Don't do paging (PAGER=cat)" "cat")
> +		 string)

Could we have a helpful :tag for the 'string' alternative?  It would
be good to explain there what kind of strings should be used: either a
full absolute file name or a basename that can be found via PATH.




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

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


Received: (at 62958) by debbugs.gnu.org; 26 Apr 2023 09:15:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 26 05:15:15 2023
Received: from localhost ([127.0.0.1]:54266 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1prbF5-0007mp-7y
	for submit <at> debbugs.gnu.org; Wed, 26 Apr 2023 05:15:15 -0400
Received: from eggs.gnu.org ([209.51.188.92]:44690)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1prbF2-0007mY-Hd
 for 62958 <at> debbugs.gnu.org; Wed, 26 Apr 2023 05:15:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1prbEw-0004be-0C; Wed, 26 Apr 2023 05:15:06 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=6F2Uwu0vGyAhyOuSRs5rT6qqPnBI9HFmI1vB/HtqU5s=; b=rrpHuqU98juC
 AOhDAMb5Md9bO8cGccuo2AGt6BUVKHkSq0AA7DMQnlkq4bRib9k4MGFtNpJf4hcHR7qnpwfOgQeSj
 bvU+UwEU4yo0w2F5o257d9b3SwptLEAkXeGgE2bcKNxyZ1mXjmwlUMrOG6Sfk83GdAh7nTpieiUmM
 k/SJPyPEQcJx4t2rq/R1hT9jPR48EvhME/IgMH+rMTo+pfYV1z82fsjwFbah5C7ozwZLrTEHCbYbS
 Q8z7Zbk9D3DaF4FYdIsX8LRLzLWtvpjkaNejIlSGuAbG/og7C2/bWC8kdkYVZqeKEeqv92ZexYgAX
 b8Y6gnXmaG8h/z13l83YLw==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1prbEv-0001h4-9x; Wed, 26 Apr 2023 05:15:05 -0400
Date: Wed, 26 Apr 2023 12:15:34 +0300
Message-Id: <831qk7uhqh.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
In-Reply-To: <875y9jaxj9.fsf@HIDDEN> (message from Philip Kaludercic on
 Wed, 26 Apr 2023 07:54:34 +0000)
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <875y9jaxj9.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62958
Cc: sbaugh@HIDDEN, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Philip Kaludercic <philipk@HIDDEN>
> Cc: Spencer Baugh <sbaugh@HIDDEN>,  62958 <at> debbugs.gnu.org
> Date: Wed, 26 Apr 2023 07:54:34 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >> Changing the default to "cat" in this way might be a bit
> >> controversial...
> >
> > Sorry, this default cannot be universally correct.  You assume that
> > 'cat' is always available, which is not true on non-Posix platforms.
> > So at the very least the value should be set according to
> > executable-find.
> 
> What systems respect PAGER (and would have it presumably set to
> something like less), but would not provide cat?

PAGER is not a system-provided feature, it is provided by the programs
which honor the variable.  Any such program, when ported to a system
where there's no 'cat', will still support PAGER.




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

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


Received: (at 62958) by debbugs.gnu.org; 26 Apr 2023 07:54:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 26 03:54:12 2023
Received: from localhost ([127.0.0.1]:54179 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1prZyd-0005QF-Vk
	for submit <at> debbugs.gnu.org; Wed, 26 Apr 2023 03:54:12 -0400
Received: from mout01.posteo.de ([185.67.36.65]:45473)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1prZya-0005Q0-WA
 for 62958 <at> debbugs.gnu.org; Wed, 26 Apr 2023 03:54:10 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 0C3B324035A
 for <62958 <at> debbugs.gnu.org>; Wed, 26 Apr 2023 09:54:02 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1682495643; bh=nGjgeW4s9+tsgiSu7hW177HNut4Fk2MNlDTcoiRdQgc=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=liQutT7hbWNdL5KLZbBD0hMjPhYSSQyx5SYktcl/8cbSmGk2BDE20Me9Z/XMLQnVX
 qD/oehImSH8OPH8OBcvYQTJxzAiuuYUzMU+Kx26E6+C9cPJy5ktdHVKENapFozIjYR
 QGtaK3AXt7JGqZzcW4pbLvdGKYK2xXkmKIYF8Q44goC6CWvyWpccEFFINDwVKz+YRF
 DqIV2e7cJX0TDoHlytt9GfkhLAQBimqdd8nstnVP5bMsyvnwomf9k77RevCUw5VfRi
 gvVQ9pp0P+TgqO1M/DCXffTiIrAldnj9r5StT7Al1e9M9oz8eeshHMQiL1Wy/nIxAy
 OFqNtvr2589Bg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Q5rjQ2srSz9rxD;
 Wed, 26 Apr 2023 09:54:02 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
In-Reply-To: <83edof6oln.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 20 Apr
 2023 09:43:00 +0300")
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; keydata=
 mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI
 BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0
 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB
 BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE
 Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK
 NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof
 z4oM
Date: Wed, 26 Apr 2023 07:54:34 +0000
Message-ID: <875y9jaxj9.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62958
Cc: Spencer Baugh <sbaugh@HIDDEN>, 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Spencer Baugh <sbaugh@HIDDEN>
>> Date: Wed, 19 Apr 2023 17:57:38 -0400
>> 
>> Simply adding (setenv "PAGER" "cat") globally is not correct, since
>> that will break modes like term, which support paging quite well.
>> It's only and exactly the comint-derived modes which don't need
>> paging.
>> 
>> Changing the default to "cat" in this way might be a bit
>> controversial...
>
> Sorry, this default cannot be universally correct.  You assume that
> 'cat' is always available, which is not true on non-Posix platforms.
> So at the very least the value should be set according to
> executable-find.

What systems respect PAGER (and would have it presumably set to
something like less), but would not provide cat?




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

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


Received: (at 62958) by debbugs.gnu.org; 20 Apr 2023 16:02:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 20 12:02:00 2023
Received: from localhost ([127.0.0.1]:38569 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ppWjP-000415-H3
	for submit <at> debbugs.gnu.org; Thu, 20 Apr 2023 12:01:59 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:50693)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1ppWjK-00040q-QZ
 for 62958 <at> debbugs.gnu.org; Thu, 20 Apr 2023 12:01:58 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
In-Reply-To: <83zg724kea.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 20 Apr
 2023 18:56:45 +0300")
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN> <83zg724kea.fsf@HIDDEN>
Date: Thu, 20 Apr 2023 12:01:49 -0400
Message-ID: <ierjzy6zgnm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 62958
Cc: 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:
>> From: Spencer Baugh <sbaugh@HIDDEN>
>> Cc: 62958 <at> debbugs.gnu.org
>> Date: Thu, 20 Apr 2023 11:47:42 -0400
>> 
>> Eli Zaretskii <eliz@HIDDEN> writes:
>> 
>> > Sorry, this default cannot be universally correct.  You assume that
>> > 'cat' is always available, which is not true on non-Posix platforms.
>> > So at the very least the value should be set according to
>> > executable-find.
>> 
>> executable-find is not correct in the case of "cat" unfortunately,
>> because there are programs (git, for one) which if they see PAGER=cat,
>> just don't start a pager at all, for greater efficiency.  (which is
>> desirable behavior)
>
> Is this about removing the leading directories from the value of
> executable-find?  If so, that is trivial to do, and is not the main
> point of what I wrote.

Yes.  But anyway, the default is nil now, so it should be fine.  Unless
you'd like the custom option of "cat" to not show up on non-UNIX
platforms, somehow?

>> > Should this test that comint-pager is a string?
>> 
>> I don't think that's necessary; doing
>> (if (stringp comint-pager) (list (format "PAGER=%s" comint-pager)))
>> would have unexpected behavior if comint-pager was accidentally set to a
>> non-string; doing
>> (when comint-pager (progn (assert (stringp comint-pager))
>>   (list (format "PAGER=%s" comint-pager))))
>> is a bit verbose and looks weird and is probably not that important.
>
> So we are okay with the user setting the variable to a symbol or a
> list or a vector?

Fair enough, I added a check:

diff --git a/lisp/comint.el b/lisp/comint.el
index 682b555a33c..a145751565f 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -258,6 +258,49 @@ comint-input-ring-file-name
 		 file)
   :group 'comint)
 
+(defcustom comint-pager nil
+  "If non-nil, name of the program to use as a pager.
+
+If non-nil, comint sets the PAGER environment variable to this
+value before starting a subprocess.  PAGER controls the pager
+that will be used.  If you prefer to not use a pager, you can set
+this variable to \"cat\".
+
+If nil, the PAGER environment variable is not set and the default
+pager will be used.  On Unix systems, typically this is \"less\".
+
+Some programs start a pager before producing output.  A pager
+supports viewing text page by page, so that if the parent program
+produces more output than will fit on the screen, that output can
+be viewed incrementally.
+
+When a program is running under Emacs, this behavior can be
+undesirable, since Emacs itself supports viewing text page by
+page, and a pager requires input from the user before it will
+show more text.  Furthermore, comint is not a full fledged
+terminal emulator, so a pager will typically behave badly.
+
+However, pagers also provide backpressure: They will not consume
+more output from the parent program than the user has actually
+viewed, which on Unix means the output pipe will fill up and the
+parent program will be stopped from producing unnecessary output.
+Many programs (such as \"git log\") take advantage of this by
+producing large amounts of output by default and relying on the
+pager to not consume text that the user doesn't view.
+
+Emacs and comint do not keep track of what text the user has
+viewed, so they can't provide backpressure like a pager does.
+This means users who do not use a pager should be careful to not
+run commands which produce a lot of output.  Users can avoid this
+by limiting the amount of output (such as with \"git log -n10\")
+or by using native Emacs interfaces instead (such as
+`vc-print-log')."
+  :version "30.1"
+  :type '(choice (const :tag "Use default PAGER" nil)
+                 (const :tag "Don't do paging (PAGER=cat)" "cat")
+		 string)
+  :group 'comint)
+
 (defvar comint-input-ring-file-prefix nil
   "The prefix to skip when parsing the input ring file.
 This is useful in Zsh when the extended_history option is on.")
@@ -864,6 +907,10 @@ comint-exec-1
 	 (nconc
           (comint-term-environment)
 	  (list (format "INSIDE_EMACS=%s,comint" emacs-version))
+          (when comint-pager
+            (if (stringp comint-pager)
+                (list (format "PAGER=%s" comint-pager))
+              (error "comint-pager should be a string: %s" comint-pager)))
 	  process-environment))
 	(default-directory
 	  (if (file-accessible-directory-p default-directory)




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

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


Received: (at 62958) by debbugs.gnu.org; 20 Apr 2023 15:56:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 20 11:56:43 2023
Received: from localhost ([127.0.0.1]:38565 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ppWeI-0003r9-Nf
	for submit <at> debbugs.gnu.org; Thu, 20 Apr 2023 11:56:43 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34620)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ppWeD-0003qq-P6
 for 62958 <at> debbugs.gnu.org; Thu, 20 Apr 2023 11:56:41 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ppWe8-0007eK-3A; Thu, 20 Apr 2023 11:56:32 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=9T0soKzcKwVhIzhKm/9BlvxWjr2TSiZGNVsa2mjhowg=; b=cvBBM0SWmPKy
 hZ7+I7iUuOhwmpK0ovPf2M2aidcsrS/toVZPi4n67UkL9wkm+RZ6RZXGPHdXwDdB72786KbAeSKPi
 VNQwlgd2R9l2eDSjee+LlO5ljTAxgjZRj1sveoY7S7shzkZv+zNcNgbXOifxPtdGHIIJWfGRFfPgq
 HSqT+Co4a/stHx2M+uZzgmYKCNOQ5Tx4DBKinMNaYF9P6emxTa0M9CDLS+VZXZpxY3FvESfrkcGAc
 8UkaNnsRxaH7k/vVRXUMU5iOU1vUdRyR+qLV2/DgTKgRhzuPS7QYABUdDecKQ+wcc8ftH0cuynT+3
 BU3XIv7uo33sL8qoaf03Xg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ppWe7-0005Gs-JQ; Thu, 20 Apr 2023 11:56:31 -0400
Date: Thu, 20 Apr 2023 18:56:45 +0300
Message-Id: <83zg724kea.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <iermt32zhb5.fsf@HIDDEN> (message from Spencer Baugh on
 Thu, 20 Apr 2023 11:47:42 -0400)
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
 <iermt32zhb5.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62958
Cc: 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Spencer Baugh <sbaugh@HIDDEN>
> Cc: 62958 <at> debbugs.gnu.org
> Date: Thu, 20 Apr 2023 11:47:42 -0400
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Sorry, this default cannot be universally correct.  You assume that
> > 'cat' is always available, which is not true on non-Posix platforms.
> > So at the very least the value should be set according to
> > executable-find.
> 
> executable-find is not correct in the case of "cat" unfortunately,
> because there are programs (git, for one) which if they see PAGER=cat,
> just don't start a pager at all, for greater efficiency.  (which is
> desirable behavior)

Is this about removing the leading directories from the value of
executable-find?  If so, that is trivial to do, and is not the main
point of what I wrote.

> > Should this test that comint-pager is a string?
> 
> I don't think that's necessary; doing
> (if (stringp comint-pager) (list (format "PAGER=%s" comint-pager)))
> would have unexpected behavior if comint-pager was accidentally set to a
> non-string; doing
> (when comint-pager (progn (assert (stringp comint-pager))
>   (list (format "PAGER=%s" comint-pager))))
> is a bit verbose and looks weird and is probably not that important.

So we are okay with the user setting the variable to a symbol or a
list or a vector?

Thanks.




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

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


Received: (at 62958) by debbugs.gnu.org; 20 Apr 2023 15:47:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 20 11:47:54 2023
Received: from localhost ([127.0.0.1]:38560 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ppWVl-0003Qv-7v
	for submit <at> debbugs.gnu.org; Thu, 20 Apr 2023 11:47:53 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:37989)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1ppWVg-0003Pp-E2
 for 62958 <at> debbugs.gnu.org; Thu, 20 Apr 2023 11:47:50 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
In-Reply-To: <83edof6oln.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 20 Apr
 2023 09:43:00 +0300")
References: <ier8reny1pp.fsf@HIDDEN> <83edof6oln.fsf@HIDDEN>
Date: Thu, 20 Apr 2023 11:47:42 -0400
Message-ID: <iermt32zhb5.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 62958
Cc: 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Spencer Baugh <sbaugh@HIDDEN>
>> Date: Wed, 19 Apr 2023 17:57:38 -0400
>> 
>> Simply adding (setenv "PAGER" "cat") globally is not correct, since
>> that will break modes like term, which support paging quite well.
>> It's only and exactly the comint-derived modes which don't need
>> paging.
>> 
>> Changing the default to "cat" in this way might be a bit
>> controversial...
>
> Sorry, this default cannot be universally correct.  You assume that
> 'cat' is always available, which is not true on non-Posix platforms.
> So at the very least the value should be set according to
> executable-find.

executable-find is not correct in the case of "cat" unfortunately,
because there are programs (git, for one) which if they see PAGER=cat,
just don't start a pager at all, for greater efficiency.  (which is
desirable behavior)

> Having said that, I'm not really sure the default should be "cat" even
> if it is available, since AFAIK you are the only one who is unhappy
> with the current situation.  So why not leave the default value as it
> is, i.e. nil?

Yes okay, I'll leave the default as it is.

>> +(defcustom comint-pager "cat"
>> +  "If non-nil, the value to use for PAGER.
>
> This is too terse.  It should at least say that the value should be a
> program name, a string.  Bonus point for explaining what is PAGER, for
> those who don't necessarily know off-hand.

Hm, yes, I have updated the docstring to explain the issue, it's worth
having a good explanation.  Hopefully this isn't too verbose now :)

>> +gWhen this is nil, comint doesn't set PAGER at all."
>    ^
> Typo.  Also, "set PAGER" is again too terse.
>
>> +  :version "30.1"
>> +  :type '(choice (const :tag "Don't set PAGER" nil)
>> +                 (const :tag "cat" "cat")
>
> The tag of "cat" is too terse again.  It should at least include the
> word "program" somewhere.
>
>> @@ -864,6 +873,7 @@ comint-exec-1
>>  	 (nconc
>>            (comint-term-environment)
>>  	  (list (format "INSIDE_EMACS=%s,comint" emacs-version))
>> +          (when comint-pager (list (format "PAGER=%s" comint-pager)))
>
> Should this test that comint-pager is a string?

I don't think that's necessary; doing
(if (stringp comint-pager) (list (format "PAGER=%s" comint-pager)))
would have unexpected behavior if comint-pager was accidentally set to a
non-string; doing
(when comint-pager (progn (assert (stringp comint-pager))
  (list (format "PAGER=%s" comint-pager))))
is a bit verbose and looks weird and is probably not that important.

Revised patch:

commit a375cb9c1260edb40a92f11fdec7f6910538135d
Author: Spencer Baugh <sbaugh@HIDDEN>
Date:   Wed Apr 19 17:44:54 2023 -0400

  Set PAGER=cat in comint.el
  
  Paging can be undesirable in comint-derived commands such as
  async-shell-command and M-x shell.  It is a frequent footgun for new
  Emacs users when they try to run commands which start a pager in such
  modes.
  
  Simply adding (setenv "PAGER" "cat") globally is not correct, since
  that will break modes like term, which support paging quite well.
  It's only and exactly the comint-derived modes which don't need
  paging.
  
  * lisp/comint.el (comint-pager):
  Add.
  (comint-exec-1):
  Use comint-pager to set PAGER.


diff --git a/lisp/comint.el b/lisp/comint.el
index 682b555a33c..37e189e4bbf 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -258,6 +258,49 @@ comint-input-ring-file-name
 		 file)
   :group 'comint)
 
+(defcustom comint-pager nil
+  "If non-nil, name of the program to use as a pager.
+
+If non-nil, comint sets the PAGER environment variable to this
+value before starting a subprocess.  PAGER controls the pager
+that will be used.  If you prefer to not use a pager, you can set
+this variable to \"cat\".
+
+If nil, the PAGER environment variable is not set and the default
+pager will be used.  On Unix systems, typically this is \"less\".
+
+Some programs start a pager before producing output.  A pager
+supports viewing text page by page, so that if the parent program
+produces more output than will fit on the screen, that output can
+be viewed incrementally.
+
+When a program is running under Emacs, this behavior can be
+undesirable, since Emacs itself supports viewing text page by
+page, and a pager requires input from the user before it will
+show more text.  Furthermore, comint is not a full fledged
+terminal emulator, so a pager will typically behave badly.
+
+However, pagers also provide backpressure: They will not consume
+more output from the parent program than the user has actually
+viewed, which on Unix means the output pipe will fill up and the
+parent program will be stopped from producing unnecessary output.
+Many programs (such as \"git log\") take advantage of this by
+producing large amounts of output by default and relying on the
+pager to not consume text that the user doesn't view.
+
+Emacs and comint do not keep track of what text the user has
+viewed, so they can't provide backpressure like a pager does.
+This means users who do not use a pager should be careful to not
+run commands which produce a lot of output.  Users can avoid this
+by limiting the amount of output (such as with \"git log -n10\")
+or by using native Emacs interfaces instead (such as
+`vc-print-log').")
+  :version "30.1"
+  :type '(choice (const :tag "Don't set PAGER" nil)
+                 (const :tag "Don't do paging (PAGER=cat)" "cat")
+		 string)
+  :group 'comint)
+
 (defvar comint-input-ring-file-prefix nil
   "The prefix to skip when parsing the input ring file.
 This is useful in Zsh when the extended_history option is on.")
@@ -864,6 +907,7 @@ comint-exec-1
 	 (nconc
           (comint-term-environment)
 	  (list (format "INSIDE_EMACS=%s,comint" emacs-version))
+          (when comint-pager (list (format "PAGER=%s" comint-pager)))
 	  process-environment))
 	(default-directory
 	  (if (file-accessible-directory-p default-directory)




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

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


Received: (at 62958) by debbugs.gnu.org; 20 Apr 2023 06:42:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 20 02:42:59 2023
Received: from localhost ([127.0.0.1]:36345 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ppO0R-00074Z-GM
	for submit <at> debbugs.gnu.org; Thu, 20 Apr 2023 02:42:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:50294)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ppO0M-00074J-CP
 for 62958 <at> debbugs.gnu.org; Thu, 20 Apr 2023 02:42:58 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ppO0G-000427-JO; Thu, 20 Apr 2023 02:42:48 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=HxrY+PtRhz9m2CTiHyP3/VYNz+yDGDeatD+1whZz9BQ=; b=hGGoIYxi77sI
 AB4brFF9o/sP5qTWkOcTt39+snzvLXngJRU2hun2J91k5SQMpm/IVis/8hru9QqpnzUKnRcANWVn2
 fnpx8Rrk+xAcYRo/QQSlDJRw7qR/NXmG0zVGhj30QP2i+h1e/uFDVZJ7ajturc/FfdOVQ1IRdOZ2e
 ehNA/dYAaehgMa7q2UoqFas9obAwP747OVNnkieNWc8ZU2w43r18YHvEIyeaGfVPbol22ujCmosiK
 39bNMEXgmIeqLMOOX/f/yEeDV9jU5c5eTL5wDJptZ6WzwhS5FC3WBUVYSQl75SPBgiCYjTMKuuj+6
 eoK1LLQjX3od9gISKrb2xA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ppO0F-0006Qm-4L; Thu, 20 Apr 2023 02:42:48 -0400
Date: Thu, 20 Apr 2023 09:43:00 +0300
Message-Id: <83edof6oln.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <ier8reny1pp.fsf@HIDDEN> (message from Spencer Baugh on
 Wed, 19 Apr 2023 17:57:38 -0400)
Subject: Re: bug#62958: [PATCH] Set PAGER=cat in comint.el
References: <ier8reny1pp.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62958
Cc: 62958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Spencer Baugh <sbaugh@HIDDEN>
> Date: Wed, 19 Apr 2023 17:57:38 -0400
> 
> Simply adding (setenv "PAGER" "cat") globally is not correct, since
> that will break modes like term, which support paging quite well.
> It's only and exactly the comint-derived modes which don't need
> paging.
> 
> Changing the default to "cat" in this way might be a bit
> controversial...

Sorry, this default cannot be universally correct.  You assume that
'cat' is always available, which is not true on non-Posix platforms.
So at the very least the value should be set according to
executable-find.

Having said that, I'm not really sure the default should be "cat" even
if it is available, since AFAIK you are the only one who is unhappy
with the current situation.  So why not leave the default value as it
is, i.e. nil?

> +(defcustom comint-pager "cat"
> +  "If non-nil, the value to use for PAGER.

This is too terse.  It should at least say that the value should be a
program name, a string.  Bonus point for explaining what is PAGER, for
those who don't necessarily know off-hand.

> +gWhen this is nil, comint doesn't set PAGER at all."
   ^
Typo.  Also, "set PAGER" is again too terse.

> +  :version "30.1"
> +  :type '(choice (const :tag "Don't set PAGER" nil)
> +                 (const :tag "cat" "cat")

The tag of "cat" is too terse again.  It should at least include the
word "program" somewhere.

> @@ -864,6 +873,7 @@ comint-exec-1
>  	 (nconc
>            (comint-term-environment)
>  	  (list (format "INSIDE_EMACS=%s,comint" emacs-version))
> +          (when comint-pager (list (format "PAGER=%s" comint-pager)))

Should this test that comint-pager is a string?




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

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


Received: (at submit) by debbugs.gnu.org; 19 Apr 2023 21:57:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 19 17:57:47 2023
Received: from localhost ([127.0.0.1]:36035 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ppFoB-0006vY-Ad
	for submit <at> debbugs.gnu.org; Wed, 19 Apr 2023 17:57:47 -0400
Received: from lists.gnu.org ([209.51.188.17]:33638)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1ppFo6-0006vN-A9
 for submit <at> debbugs.gnu.org; Wed, 19 Apr 2023 17:57:45 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sbaugh@HIDDEN>)
 id 1ppFo6-0004xC-37
 for bug-gnu-emacs@HIDDEN; Wed, 19 Apr 2023 17:57:42 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sbaugh@HIDDEN>)
 id 1ppFo4-00006O-4T
 for bug-gnu-emacs@HIDDEN; Wed, 19 Apr 2023 17:57:41 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Set PAGER=cat in comint.el
Date: Wed, 19 Apr 2023 17:57:38 -0400
Message-ID: <ier8reny1pp.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@HIDDEN;
 helo=mxout5.mail.janestreet.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: text/plain

Tags: patch


Paging is useless and annoying in comint-derived commands such as
async-shell-command and M-x shell.  It is a frequent footgun for new
Emacs users when they try to run commands which start a pager in such
modes.  I know a number of users who set PAGER=cat in their Emacs to
avoid it.

Simply adding (setenv "PAGER" "cat") globally is not correct, since
that will break modes like term, which support paging quite well.
It's only and exactly the comint-derived modes which don't need
paging.

Changing the default to "cat" in this way might be a bit
controversial...

In GNU Emacs 29.0.60 (build 3, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.15.12, Xaw scroll bars) of 2023-03-13 built on
 igm-qws-u22796a
Repository revision: e759905d2e0828eac4c8164b09113b40f6899656
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: CentOS Linux 7 (Core)

Configured using:
 'configure --with-x-toolkit=lucid --with-modules
 --with-gif=ifavailable'


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-Set-PAGER-cat-in-comint.el.patch

From 0069a0253c73567b131ddc75d57e29d405d11a72 Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@HIDDEN>
Date: Wed, 19 Apr 2023 17:44:54 -0400
Subject: [PATCH] Set PAGER=cat in comint.el

Paging is useless and annoying in comint-derived commands such as
async-shell-command and M-x shell.  It is a frequent footgun for new
Emacs users when they try to run commands which start a pager in such
modes.  I know a number of users who set PAGER=cat in their Emacs to
avoid it.

Simply adding (setenv "PAGER" "cat") globally is not correct, since
that will break modes like term, which support paging quite well.
It's only and exactly the comint-derived modes which don't need
paging.

Changing the default to "cat" in this way might be a bit
controversial...

* lisp/comint.el (comint-pager):
Add, defaulted to "cat".
(comint-exec-1):
Use comint-pager to set PAGER.
---
 lisp/comint.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lisp/comint.el b/lisp/comint.el
index 682b555a33c..915907c1bb9 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -258,6 +258,15 @@ comint-input-ring-file-name
 		 file)
   :group 'comint)
 
+(defcustom comint-pager "cat"
+  "If non-nil, the value to use for PAGER.
+gWhen this is nil, comint doesn't set PAGER at all."
+  :version "30.1"
+  :type '(choice (const :tag "Don't set PAGER" nil)
+                 (const :tag "cat" "cat")
+		 string)
+  :group 'comint)
+
 (defvar comint-input-ring-file-prefix nil
   "The prefix to skip when parsing the input ring file.
 This is useful in Zsh when the extended_history option is on.")
@@ -864,6 +873,7 @@ comint-exec-1
 	 (nconc
           (comint-term-environment)
 	  (list (format "INSIDE_EMACS=%s,comint" emacs-version))
+          (when comint-pager (list (format "PAGER=%s" comint-pager)))
 	  process-environment))
 	(default-directory
 	  (if (file-accessible-directory-p default-directory)
-- 
2.30.2


--=-=-=--




Acknowledgement sent to Spencer Baugh <sbaugh@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#62958; 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: Tue, 9 May 2023 19:00:02 UTC

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