diff lisp/packages/ps-print.el @ 74:54cc21c15cbb r20-0b32

Import from CVS: tag r20-0b32
author cvs
date Mon, 13 Aug 2007 09:04:33 +0200
parents 131b0175ea99
children 6a378aca36af
line wrap: on
line diff
--- a/lisp/packages/ps-print.el	Mon Aug 13 09:03:47 2007 +0200
+++ b/lisp/packages/ps-print.el	Mon Aug 13 09:04:33 2007 +0200
@@ -1899,6 +1899,10 @@
       (if ps-razzle-dazzle
 	  (message "Formatting...done")))))
 
+;; XEmacs change
+(require 'message)	; Until We can get some sensible autoloads, or
+			; message-flatten-list gets put somewhere decent.
+;; Permit dynamic evaluation at print time of ps-lpr-switches
 (defun ps-do-despool (filename)
   (if (or (not (boundp 'ps-spool-buffer))
 	  (not ps-spool-buffer))
@@ -1921,12 +1925,21 @@
 	(set-buffer ps-spool-buffer)
 	(if (and (eq system-type 'ms-dos) (stringp dos-ps-printer))
 	    (write-region (point-min) (point-max) dos-ps-printer t 0)
-	  (let ((binary-process-input t)) ; for MS-DOS
+	  (let ((binary-process-input t)  ; for MS-DOS
+		(ps-lpr-sw (message-flatten-list    ; XEmacs
+			    (mapcar '(lambda (arg)  ; Dynamic evaluation
+				       (cond ((stringp arg) arg)
+					     ((functionp arg) (apply arg nil))
+					     ((symbolp arg) (eval arg))
+					     ((consp arg) (apply (car arg)
+								 (cdr arg)))
+					     (t nil)))
+				    ps-lpr-switches))))
 	    (apply 'call-process-region
 		   (point-min) (point-max) ps-lpr-command nil
 		   (if (fboundp 'start-process) 0 nil)
 		   nil
-		   ps-lpr-switches))))
+		   ps-lpr-sw))))
       (if ps-razzle-dazzle
 	  (message "Printing...done")))
     (kill-buffer ps-spool-buffer)))
@@ -2029,12 +2042,16 @@
 ;; article subjects shows up at the printer.  This function, bound to
 ;; prsc for the gnus *Summary* buffer means I don't have to switch
 ;; buffers first.
+;; sb:  Updated for Gnus 5.
 (defun ps-gnus-print-article-from-summary ()
   (interactive)
-  (if (get-buffer "*Article*")
-      (save-excursion
-	(set-buffer "*Article*")
-	(ps-spool-buffer-with-faces))))
+  (let ((ps-buf (if (boundp 'gnus-article-buffer)
+		    gnus-article-buffer
+		  "*Article*")))
+    (if (get-buffer ps-buf)
+	(save-excursion
+	  (set-buffer ps-buf)
+	  (ps-spool-buffer-with-faces)))))
 
 ;; See ps-gnus-print-article-from-summary.  This function does the
 ;; same thing for vm.