GNU bug report logs - #55845
[PATCH 0/1] Improve pager selection logic when less is not installed

Previous Next

Package: guix-patches;

Reported by: Taiju HIGASHI <higashi <at> taiju.info>

Date: Wed, 8 Jun 2022 10:22:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Taiju HIGASHI <higashi <at> taiju.info>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 55845 <at> debbugs.gnu.org, me <at> tobias.gr
Subject: Re: [bug#55845] [PATCH 1/1] ui: Improve pager selection logic when
 less is not installed.
Date: Fri, 10 Jun 2022 17:40:24 +0900
Maxime Devos <maximedevos <at> telenet.be> writes:

> Taiju HIGASHI schreef op vr 10-06-2022 om 09:39 [+0900]:
>> +     (with-environment-variables
>> +         `(("PATH" ,dir))
>
> Wait, looking at the definition of with-environment-variables, if PAGER
> was set when running "make check" (try "GUIX_PAGER=less make check
> TESTS=tests/ui.scm"), it will still be set when the test is run
> (unverified).  Maybe it should be unset?  Proposal:
>
> Change
>
>                   (match-lambda
>                     ((variable value)
>                      (setenv variable value)
>
> to
>
>                   (match-lambda
>                     ((variable #false)
>                      (unsetenv variable))
>                     ((variable value)
>                      (setenv variable value)
>
>
> and change the with-environment-variables to
>
>    (with-environment-variables
>       `(("PATH ,dir)
>         ("PAGER" #false)
>         ("GUIX_PAGER" #false))
>       [...]).
>
> and likewise for the other tests?

Sorry, I easily used with-environment-variable*s* because the interface
looked convenient, but perhaps I should have used
with-environment-variable defined in guix/tests.scm.
However, using this one does not seem to solve the problem. Should I
modify with-environment-variable*s*?

> (string=? ((@@ (guix ui) find-available-pager)) "guix-pager")))))
>
> Nitpick: find-available-pager is not an exported procedure, so due to
> optimisations, it can dissappear (be inlined into call-with-paginated-
> output-port).  So to be 100% robust, it needs to be exported, or a line
>
>   (set! find-avaible-pager find-available-pager) ; used in tests/ui.scm
>
> needs to be added in guix/ui.scm, or the tests needs to be adjusted
> to always use with-paginated-output-port instead of
> find-available-pager.


Thank you. I will modify it in one of the ways you suggested.

I did not understand the optimization behavior. Thank you very much.

Thanks,
-- 
Taiju




This bug report was last modified 2 years and 338 days ago.

Previous Next


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