Re: [PATCH v4] help: colorize man pages
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- May 20, 2021, 18:00 UTC
- Message-ID
- <6dc0fcee-3415-e6f9-df30-c97de4385f56@gmail.com>
- In-Reply-To
- <60a6877fa8389_2747c20842@natae.notmuch>
On 20/05/2021 16:59, Felipe Contreras wrote:
Show 24 quoted lines
> Phillip Wood wrote:
>> On 20/05/2021 14:58, Felipe Contreras wrote:
>>> Phillip Wood wrote:
>>>> On 20/05/2021 05:07, Felipe Contreras wrote:
>>>>> [...]
>>>>> If the user has already set the LESS variable in his/her environment,
>>>>> that is respected, and nothing changes.
>>>>
>>>> However if they have specified the colors they would like by using the
>>>> LESS_TERMCAP_xx environment variables that the previous versions of this
>>>> patch used their choice is overridden by this new patch.
>>>
>>> That is true. We could add a check for that:
>>>
>>> if (getenv("LESS_TERMCAP_md"))
>>> return;
>>>
>>> However, it may not be necessary since many of the tips online set these
>>> variables inside a function.
>>
>> The only person who has tested this patch has reported a problem with
>> it, it seems unlikely that no other users will have similar issues.
>
> The check above will fix your problem, will it not?Yes it will if it is implemented which was not clear as your message suggested it may not be necessary. I think it would be safer to check LESS_TERMCAP_{md,us,so} and not set LESS if any of them are set as it is possible a user may only override some of them.
Best Wishes
Phillip