home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / lisp / mcl / 1608 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.9 KB  |  55 lines

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!apple!apple!cambridge.apple.com!cartier@math.uqam.ca
  2. From: cartier@math.uqam.ca (Guillaume Cartier)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Printing Blues (was "printing .lisp files")
  5. Message-ID: <9211172038.AA05436@mipsmath.math.uqam.ca>
  6. Date: 17 Nov 92 20:38:44 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 41
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10. Original-To: bright@ENH.NIST.GOV
  11. X-Sender: cartier@mipsmath.math.uqam.ca
  12. Original-Cc: info-mcl@cambridge.apple.com (Macintosh Common Lisp)
  13.  
  14. <---
  15. | When I print my .lisp files (in Fred Windows), they print with a header
  16. | that has the file name, date, page number.  When the path to the file is
  17. | long, the header gets garbled by overprinting.  Anyone know how to make the
  18. | header print out on more than one line so that all of the info is readable?
  19. --->
  20.  
  21.  
  22. Here's a very simple hack I use daily.
  23. The file name in the header will be truncated to only the file namestring.
  24.  
  25. It should be simple to adapt to your own preferences
  26. (i.e. truncating file names longer than 50 chars, etc...).
  27.  
  28. To understand the hack, look at the source for the draw-hardcopy method.
  29.  
  30.  
  31. (in-package "CCL")
  32.  
  33. (defvar *hardcopying*
  34.   nil)
  35.  
  36. (advise (:method draw-hardcopy (fred-window))
  37.         (let ((*hardcopying* t))
  38.           (:do-it))
  39.         :when :around
  40.         :name :hardcopy-header)
  41.  
  42. (advise namestring
  43.         (if (not *hardcopying*)
  44.             (:do-it)
  45.           (mac-file-namestring (:do-it)))
  46.         :when :around
  47.         :name :hardcopy-header)
  48.  
  49. *********************************************************************
  50. * Guillaume Cartier                 (514) 844-5294 (maison)         *
  51. * L.A.C.I.M.                        (514) 987-4290 (bureau)         *
  52. * Universite du Quebec a Montreal   (514) 987-8477 (telecopieur)    *
  53. * Montreal, Quebec, Canada          cartier@math.uqam.ca (internet) *
  54. *********************************************************************
  55.