guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: redirected 'help' output?


From: Bill Schottstaedt
Subject: Re: redirected 'help' output?
Date: Thu, 2 Nov 2000 05:48:35 -0800

> > I'd like to redirect the output of "help" to a text widget, but
> > it's not obvious to me how to do this:
>
> Did you ever find a fix for this?

I ended up using a "soft port":

(define stdout (current-output-port))
(define snd-out
  (make-soft-port
   (vector
    (lambda (c) (snd-print c))
    (lambda (s) (snd-print s))
    (lambda () #f)
    #f
    (lambda () #f))
   "w"))

(set-current-output-port snd-out)

snd-print appends its argument to the text widget in question.

> help is a macro.  Here is what I use:
> (with-output-to-string
>  (lambda () ((macro-transformer help) (list 'help 'cons) the-environment)))

Thanks!  (It's not obvious to me why it matters in Scheme that
help is a macro, but this example will be useful).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]