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

text formatting windows



    Date: Wed, 23 May 90 14:48:16 EDT
    From: rpg@cs.brown.edu


    Does anyone have code I could use for this purpose?

    I'm looking for the ability to do something like

    (format-text-as-paragraph <a long string> window-stream)

    I'm not looking to do anything fancy -- just splat a help message into
    a typeout window, ragged-right.  It just seems silly that with all
    that other great stuff out there (e.g., formatting-table) I should
    have to go through the whole rigamarole of positioning the cursor in a
    window and drawing strings char-by-char, or the equally onerous task
    of formatting the help message ahead of time for a particular
    window...

How about this:

;;; Get a reasonable fill column for this demonstration:
(FILLING-OUTPUT (T :FILL-COLUMN '(65 :CHARACTER))
  (TERPRI)
  (WRITE-STRING
	"Fourscore and seven years ago our forefathers brought forth on this continent a new nation, conceived in liberty, and dedicated to the one I love.

No, no, no, that's not right.  `... dedicated to the proposition that all men are created equal.'")  
  ;; Don't return the string:
  (VALUES))

produces:

Fourscore and seven years ago our forefathers brought forth on
this continent a new nation, conceived in liberty, and dedicated
to the one I love.

No, no, no, that's not right.  `... dedicated to the proposition
that all men are created equal.'