From 207413e6ea2a17542711c306e6dbdbedc4ed0eaf Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Tue, 30 May 2023 12:16:52 -0400 Subject: bin: Enable use of pagers other then less. Previous logic assumed that the pager could accept the command line argument "--raw". Replace this logic by setting the environment variable "LESS". This idea is inspired by git. * bin/tissue (main): Set "LESS" environment variable. (tissue-search): Don't run pager with "--raw" argument. Signed-off-by: Arun Isaac --- bin/tissue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/tissue b/bin/tissue index 1355f53..7e10d16 100755 --- a/bin/tissue +++ b/bin/tissue @@ -4,6 +4,7 @@ exec guile --no-auto-compile -s "$0" "$@" ;;; tissue --- Text based issue tracker ;;; Copyright © 2022, 2023 Arun Isaac +;;; Copyright © 2023 Morgan Smith ;;; ;;; This file is part of tissue. ;;; @@ -96,8 +97,7 @@ Search issues using SEARCH-QUERY. (lambda (port) (search-map (cut print <> <> port) db (string-join args))) (or (getenv "PAGER") - "less") - "--raw")))))) + "less"))))))) (define tissue-show (match-lambda* @@ -500,6 +500,11 @@ Pull latest from upstream repositories. (display (condition-message c) (current-error-port)) (newline (current-error-port)) (exit #f))) + ;; Unless LESS is already configured, pass command-line options to + ;; less by setting LESS. This idea is inspired by + ;; git. https://git-scm.com/docs/git-config#git-config-corepager + (unless (getenv "LESS") + (setenv "LESS" "FRX")) ;; Add the top level of the git repository to the load path since ;; there may be user-written modules in the repository. (match args -- cgit v1.2.3