From 3fb78aa6158134497c17e5288a8ee9af64d1fac0 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 13 Oct 2023 13:49:29 -0700 Subject: Support compiling. --- mnpgr.tl | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/mnpgr.tl b/mnpgr.tl index 72a87b0..b43959c 100755 --- a/mnpgr.tl +++ b/mnpgr.tl @@ -31,15 +31,16 @@ (@else (output-text else :norm)))) (output-text "\n" :norm))))) -(ensure-dir mnpgr-dir) +(compile-only ;; I.e. do not execute these forms during compilation + (ensure-dir mnpgr-dir) -(match @(or `@page(@section)` ;; for "man whatever" - `@page\\.@section`) ;; for "man -l file.1" - (getenv "MAN_PN") - (with-resources ((rendered-file (path-cat mnpgr-dir `@page.@section`) - (remove-path rendered-file))) - (with-stream (s (open-file rendered-file "w")) - (let ((ofilt (make-overstrike-filter (lambda (str) (put-string str s))))) - (whilet ((line (get-line))) - [ofilt line]))) - (sh `vim +'@{vim-commands}' '@{rendered-file}' < /dev/tty`))) + (match @(or `@page(@section)` ;; for "man whatever" + `@page\\.@section`) ;; for "man -l file.1" + (getenv "MAN_PN") + (with-resources ((rendered-file (path-cat mnpgr-dir `@page.@section`) + (remove-path rendered-file))) + (with-stream (s (open-file rendered-file "w")) + (let ((ofilt (make-overstrike-filter (lambda (str) (put-string str s))))) + (whilet ((line (get-line))) + [ofilt line]))) + (sh `vim +'@{vim-commands}' '@{rendered-file}' < /dev/tty`)))) -- cgit v1.2.3