From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MCGPKeOhoGJ4BQAAbAwnHQ (envelope-from ) for ; Wed, 08 Jun 2022 15:19:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id mJ6aKeOhoGLxSgEA9RJhRA (envelope-from ) for ; Wed, 08 Jun 2022 15:19:31 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5EF8D36129 for ; Wed, 8 Jun 2022 15:19:31 +0200 (CEST) Received: from localhost ([::1]:58340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nyvas-0004Xh-De for larch@yhetil.org; Wed, 08 Jun 2022 09:19:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyvaR-0004Ru-1Q for guix-patches@gnu.org; Wed, 08 Jun 2022 09:19:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nyvaQ-0006Fo-Dx for guix-patches@gnu.org; Wed, 08 Jun 2022 09:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nyvaQ-0001Fu-1L for guix-patches@gnu.org; Wed, 08 Jun 2022 09:19:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55845] [PATCH 1/1] ui: Improve pager selection logic when less is not installed. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 08 Jun 2022 13:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55845 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Taiju HIGASHI , 55845@debbugs.gnu.org Received: via spool by 55845-submit@debbugs.gnu.org id=B55845.16546943224801 (code B ref 55845); Wed, 08 Jun 2022 13:19:01 +0000 Received: (at 55845) by debbugs.gnu.org; 8 Jun 2022 13:18:42 +0000 Received: from localhost ([127.0.0.1]:42767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyva3-0001FJ-1f for submit@debbugs.gnu.org; Wed, 08 Jun 2022 09:18:42 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:53474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyvZm-0001Et-KJ for 55845@debbugs.gnu.org; Wed, 08 Jun 2022 09:18:38 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id gdJL2700F4UW6Th01dJLlj; Wed, 08 Jun 2022 15:18:21 +0200 Message-ID: From: Maxime Devos Date: Wed, 08 Jun 2022 15:18:20 +0200 In-Reply-To: <20220608102257.15042-1-higashi@taiju.info> References: <20220608102124.14865-1-higashi@taiju.info> <20220608102257.15042-1-higashi@taiju.info> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-zLsOdS6vquILpEudFZWb" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1654694301; bh=5l9hwFX0O0zBYzfhSNkcBd68OJA4O6ZXPiDC/G2MT6U=; h=Subject:From:To:Date:In-Reply-To:References; b=Pxzcbs9+fR73am7tAd4o0rTUBSnngqzVP/Oq+Hpj+5nPdcf+qUfNkbXXBRkwjrKYj Kv7j5bwcht5WeATSo5wGPlNFNRG0ErzO/qoTDlpd44uSdmH2GpGXzF+nZ3KbYCQabc FV5AtsNoqj0Ag2TTF00EIYMY8sPjhUEQ+cgyjc13N7HQMFj9HEJSOOFwncoCt24fnL FW2iVV6QPwANAXC8tCW8cyNVbbSd23+FB2g6tqOmFQ9/iJH6k2pOSqw9erq6GIfoNp Pt/k4VdrSua2xmd7EY53qd/5igKFoxMwaaY/S8v56QXrNrm7WBOs4g+DpAm+k5RlAN mZ6763V1V+j9Q== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654694371; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=5l9hwFX0O0zBYzfhSNkcBd68OJA4O6ZXPiDC/G2MT6U=; b=jDSghAqi/EkA3E8+Op9kW6y0yCh1AKwVxk3DMAz4o8QG0jCOlVRCEIyh8M4bbXL9WyKXG0 9wDpi6SUiWxEbCwWO8BhsBSSIvbCM+NmZaX2HNFP7EO7L378R4R2riC6z4DQkhmEsgvTnb 4YewpIv1TnJypbTBKJwUqcEaBk1EiTh7tCn/gtbyhI3JwSSdz6p+mKYIDZrMquBRFaF0z8 S3TjAy7a8w5hVku+oc4dFvFc1X/odySrtI6F1FZD8ABlQkLgnaKaJbZGM9nh3CBel4zB/9 O7+ZowNlGPAF44Zdwk8na9gFKiu4aQ7vPvcA85RvkahO09iY6TUErPxjwvY34w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654694371; a=rsa-sha256; cv=none; b=n2FUddQLlJhOqtTx857NNYmasUt4agsHLxzYBCPsYw+DlsBc3LMN+sS1VGgiMyZt9GxSeD uCxy5G6aiRFyPtawuyel9px/QW4uT+VPPf91ERF1KagFK0UMkJ7Hbz9HxWexQpGrTbW/21 4BkzkONVJTDP2QfO5ZAiRczZDnZTtRSWBiPzwU82c9W39Rb6W8niWrMUuFN5mEBCWvgKd2 X5szMAYnynfVyq7Jg1tYR57Fx9Jil1GIl1SYAns/ThB1QWV7pgH3A4oQLcYyUU7X8IeYmv NgQFuIMVq+vsntk13BpQ8TwLE8gfsdUgMUDes0nX7RyEFA+1mo3ybYU8b4QWhQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=Pxzcbs9+; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 3.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=Pxzcbs9+; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 5EF8D36129 X-Spam-Score: 3.90 X-Migadu-Scanner: scn1.migadu.com X-TUID: ik4BjglJGI0Z --=-zLsOdS6vquILpEudFZWb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Taiju HIGASHI schreef op wo 08-06-2022 om 19:22 [+0900]: > +(define available-pager > +=C2=A0 (if (which "less") > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "less" > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (which "more") > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "more" > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #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 --=-zLsOdS6vquILpEudFZWb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYqChnBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7j5RAPsEj5yYdIlfKWin4my2/ti4UWA2 QJt55+toXXZqqeRxtwEAjZmV/wVo9Um33TQVfFu3hk8Gwjhuw2O0Q+hass6Z+A8= =pR+i -----END PGP SIGNATURE----- --=-zLsOdS6vquILpEudFZWb--