Subject: bug#62958: [PATCH] Set PAGER=cat in comint.el

From: Eli Zaretskii <[email-masked]>
Date: Thu, 20 Apr 2023 18:56:45 +0300

> From: Spencer Baugh <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 20 Apr 2023 11:47:42 -0400
> 
> Eli Zaretskii <[email-masked]> 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.