Add comment on setting a pager

This commit is contained in:
Bram Schoenmakers 2023-04-12 22:40:10 +02:00
parent 9d54ca3e7d
commit a40ed0eda2

View file

@ -49,9 +49,16 @@ The LEDGER-FILE can be configured through the `comint-ledger-file-path'
variable, otherwise a prompt will appear to select a file."
(interactive (list (or comint-ledger-file-path
(read-file-name "Ledger file: "))))
(let* ((ledger-program comint-ledger-cli-path)
(let* (;; The ledger command interpreter ignores --no-pager, so if
;; no pager is set, less(1) is used. This is suboptimal
;; inside an Emacs buffer, so set the pager to cat(1)
;; instead.
(cat-executable (executable-find "cat"))
(process-environment (append process-environment
(list (concat "PAGER=" cat-executable))))
(ledger-program comint-ledger-cli-path)
(ledger-file-arguments (list "-f" ledger-file))
(process-environment (append process-environment '("PAGER=/bin/cat")))
(ledger-arguments (append ledger-file-arguments comint-ledger-cli-arguments))
(buffer (get-buffer-create comint-ledger-buffer-name))
(proc-alive (comint-check-proc buffer)))