home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / alt / lucidem / help / 255 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  2.3 KB

  1. From: danny@amil.co.il (Danny Bar-Dov)
  2. Message-ID: <9208130714.AA14302@amil.co.il>
  3. Subject: printing with different command
  4. Date: Thu, 13 Aug 1992 07:16:29 GMT
  5. Newsgroups: alt.lucid-emacs.help
  6. Path: sparky!uunet!wendy-fate.uu.net!help-lucid-emacs
  7. Sender: help-lucid-emacs-request@lucid.com
  8. Lines: 70
  9.  
  10. Finally we moved to lemacs-19.2. Only not without some problems.
  11. In 19.1 I hacked lpr.el a bit so that a local package which
  12. prints using enscript will work.
  13. Only in 19.2 lpr.el is loaded into lemacs.
  14. (and I use the supplied sun4 version - no time to compile :-)
  15.  
  16. Here is what I changed in lpr.el (I added the (provide ...) side
  17.  
  18. 20d19
  19. < (provide 'lpr)
  20. 69c68
  21. <           (setq switches (and (eq lpr-command "lpr") (cons "-p" switches)))))
  22. ---
  23. >           (setq switches (cons "-p" switches))))
  24. 73c72
  25. <                   (nconc (and (eq lpr-command "lpr")
  26. ---
  27. >                   (nconc (and (eq system-type 'berkeley-unix)
  28.  
  29. So now (require 'lpr) complains, and removing that then
  30. changing the lpr-command fails because of the "-p" flag.
  31.  
  32. Does anybody have a suggestion ?
  33.  
  34. I add the (short) laser package.
  35.  
  36. Danny
  37.  
  38. ------------------- cut here for laser.el -------------------
  39. ;;;
  40. ;;; PostScript LASER printer routines.
  41. ;;; adjusted for lemacs 19.1 by Dan Bar Dov June 18 1992
  42.  
  43. (require 'lpr) 
  44.  
  45. (defvar *laser-print-user-name* t
  46.   "Specifies whether to include the user name
  47.    in the print buffer / region titles.")
  48.  
  49. (defvar *enscript-switches* '("-fCourier-Oblique10" "-FTimes-BoldItalic10"))
  50.  
  51. (defun laser-print (p-what &optional switches)
  52.   "Print buffer / region using the ENSCRIPT command."
  53.   (let ((saved-witches lpr-switches)
  54.     (saved-command lpr-command))
  55.     (set-variable 'lpr-switches (or switches *enscript-switches*))
  56.     (setq lpr-command "/usr/local/bin/enscript")
  57.     (if (equal p-what 'buffer)
  58.     (print-buffer)
  59.       (lpr-region (region-beginning) (region-end)))
  60.     (set-variable 'lpr-switches saved-witches)
  61.     (setq lpr-command saved-command)))
  62.  
  63. (defun laser-print-region  ()
  64.   "Prints region by laser printer."
  65.   (interactive)
  66.   (laser-print 'region))
  67.  
  68. (defun laser-print-buffer  ()
  69.   "Prints region with header by laser printer."
  70.   (interactive)
  71.   (laser-print 'buffer))
  72.  
  73. (defun read-enscript-switches ()
  74.   (let ((args (read-string "Enter enscript switches: " *enscript-switches*)))
  75.     (list args))
  76.   )
  77.  
  78.  
  79. (defvar print-command nil)
  80.