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

Printing Blues (was "printing .lisp files")

| When I print my .lisp files (in Fred Windows), they print with a header
| that has the file name, date, page number.  When the path to the file is
| long, the header gets garbled by overprinting.  Anyone know how to make the
| header print out on more than one line so that all of the info is readable?

Here's a very simple hack I use daily.
The file name in the header will be truncated to only the file namestring.

It should be simple to adapt to your own preferences
(i.e. truncating file names longer than 50 chars, etc...).

To understand the hack, look at the source for the draw-hardcopy method.

(in-package "CCL")

(defvar *hardcopying*

(advise (:method draw-hardcopy (fred-window))
        (let ((*hardcopying* t))
        :when :around
        :name :hardcopy-header)

(advise namestring
        (if (not *hardcopying*)
          (mac-file-namestring (:do-it)))
        :when :around
        :name :hardcopy-header)

* Guillaume Cartier                 (514) 844-5294 (maison)         *
* L.A.C.I.M.                        (514) 987-4290 (bureau)         *
* Universite du Quebec a Montreal   (514) 987-8477 (telecopieur)    *
* Montreal, Quebec, Canada          cartier@math.uqam.ca (internet) *