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 #23 received at 55845 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Taiju HIGASHI <higashi <at> taiju.info>, 55845 <at> debbugs.gnu.org
Subject: Re: [bug#55845] [PATCH 1/1] ui: Improve pager selection logic when
 less is not installed.
Date: Wed, 08 Jun 2022 15:18:20 +0200
[Message part 1 (text/plain, inline)]
Taiju HIGASHI schreef op wo 08-06-2022 om 19:22 [+0900]:
> +(define available-pager
> +  (if (which "less")
> +      "less"
> +      (if (which "more")
> +          "more"
> +          #f)))

Can be simplified to something like,:

(define (find-available-pager)
  "[appropriate docstring]"
  (or (getenv "GUIX_PAGER") ;; <-- simplify 'if' chains by using 'or'
      (getenv "PAGER")
      (which "less")
      (which "more")
      ;; <--- TODO: how to handle no pager being found?
      ))

and

   (let ((pager-command-line (available-pager)))
     [...])

I've thunked find-available-pager here, such that call-with-paginated-
output-port respects the $PATH that is set before call-with-paginated-
output-port instead of the $PATH from when "guix ui" was loaded?

Ideally there would be some regression tests as well.

Greetings,
Maxime
[signature.asc (application/pgp-signature, inline)]

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.