From 9b56d7c287f86a8563121c72125cb5db6c0756f9 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 15 Jun 2000 00:34:27 +0000 Subject: [PATCH] Extend help output procedures to accept a port as an argument. --- v7/src/edwin/hlpcom.scm | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/v7/src/edwin/hlpcom.scm b/v7/src/edwin/hlpcom.scm index 82a0d8308..6edae27be 100644 --- a/v7/src/edwin/hlpcom.scm +++ b/v7/src/edwin/hlpcom.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: hlpcom.scm,v 1.117 2000/06/15 00:25:39 cph Exp $ +;;; $Id: hlpcom.scm,v 1.118 2000/06/15 00:34:27 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology ;;; @@ -301,18 +301,20 @@ If you want VALUE to be a string, you must surround it with doublequotes." (define (with-output-to-help-display thunk) (with-output-to-temporary-buffer "*Help*" '(READ-ONLY) thunk)) -(define (write-description description) - (write-string (substitute-command-keys description))) +(define (write-description description #!optional port) + (write-string (substitute-command-keys description) + (if (default-object? port) (current-output-port) port))) -(define (print-key-bindings command column) - (let ((bindings (comtab-key-bindings (current-comtabs) command))) - (if (not (null? bindings)) +(define (print-key-bindings command column #!optional port) + (let ((port (if (default-object? port) (current-output-port) port)) + (bindings (comtab-key-bindings (current-comtabs) command))) + (if (pair? bindings) (begin - (write-string - (if (< column 30) - (make-string (- 30 column) #\space) - " ")) - (write-string (key-list-string bindings)))))) + (write-string (if (< column 30) + (make-string (- 30 column) #\space) + " ") + port) + (write-string (key-list-string bindings) port))))) (define (key-list-string xkeys) (let loop ((xkeys (sort xkeys xkeystring description))) -- 2.25.1