GNU bug report logs - #72426
29.2.50; comint-pager doesn't affect async-shell-command

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Fri, 2 Aug 2024 18:36:01 UTC

Severity: normal

Found in version 29.2.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 72426 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Spencer Baugh <sbaugh <at> janestreet.com>
Cc: 72426 <at> debbugs.gnu.org
Subject: Re: bug#72426: 29.2.50; comint-pager doesn't affect
 async-shell-command
Date: Sat, 3 Aug 2024 11:38:35 -0700
On 8/3/2024 8:38 AM, Eli Zaretskii wrote:
>> From: Spencer Baugh <sbaugh <at> janestreet.com>
>> Date: Sat, 3 Aug 2024 06:47:10 -0400
>> Cc: 72426 <at> debbugs.gnu.org
>>
>> comint-terminfo-terminal affects async-shell-command, why not this?
> 
> Ugh!  A mistake, IMNSHO.  But that ship sailed a long time ago, so we
> cannot fix the mistake.  We can avoid enlarging the mistake, though.
> 
>> If the fact that the variable is in comint is the problem, I can rename it and move it elsewhere.
> 
> I don't think functions that are almost primitives should pay
> attention to application-level features such as this one.

Perhaps we should be setting the pager in a similar way to how TERM is 
set in startup.el?

    ;; Subprocesses of Emacs do not have direct access to the terminal, so
    ;; unless told otherwise they should only assume a dumb terminal.
    ;; We are careful to do it late (after term-setup-hook), although the
    ;; new multi-tty code does not use $TERM any more there anyway.
    (setenv "TERM" "dumb")

I think the reasoning in that comment applies to PAGER as well: unless 
told otherwise, subprocesses probably shouldn't use pager like "less"; 
it's very unlikely to work correctly.

In that case, would it make sense to add something along these lines to 
startup.el?

    (when (executable-find "cat")
      (setenv "PAGER" "cat"))

The 'comint-pager' variable could still be useful though, since you can 
set it to a pager that's fancier than "cat" but that actually works in 
Comint (unlike "less"). For example, you could set a pager that does 
automatic syntax highlighting with ANSI escapes; Comint would be able to 
handle that.




This bug report was last modified 246 days ago.

Previous Next


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