guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#55845] [PATCH 1/1] ui: Improve pager selection logic when less is n


From: Maxime Devos
Subject: [bug#55845] [PATCH 1/1] ui: Improve pager selection logic when less is not installed.
Date: Wed, 08 Jun 2022 15:18:20 +0200
User-agent: Evolution 3.38.3-1

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

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]