Subject: Re: bug#63778: [PATCH] Use comint-pager in eshell

From: Jim Porter <[email-masked]>
Date: Mon, 29 May 2023 22:14:18 -0700

On 5/28/2023 11:23 PM, Morgan Smith wrote:
> My main pain point was trying to figure out how to maintain the ability
> to set/unset the PAGER variable.  These current patches allow you to
> set/unset the PAGER variable iff you don't set comint-pager.  It even
> allows you to do stuff like 'PAGER=cat git log' (see
> eshell-handle-local-variables) without modifying buffer state (as it
> should).  Maintaining those capabilities when comint-pager is set seems
> very difficult so I gave up.

Thanks. I'll think this over for a bit and try some stuff out locally 
too. Looking at your second patch, I think I see where the pain lies: 
when getting PAGER, it always treats 'comint-pager' as taking precedence 
over the real env var, but when setting PAGER, it only sets the env var. 
Therefore, with 'comint-pager' set, setting PAGER won't have the 
intended effect (though maybe this doesn't apply to local variables).

There's probably a nice way to do this, but it might involve some tweaks 
to how Eshell handles variable aliases in general. I'll look into it more.