diff lisp/packages/lpr.el @ 185:3d6bfa290dbd r20-3b19

Import from CVS: tag r20-3b19
author cvs
date Mon, 13 Aug 2007 09:55:28 +0200
parents 34a5b81f86ba
children
line wrap: on
line diff
--- a/lisp/packages/lpr.el	Mon Aug 13 09:54:24 2007 +0200
+++ b/lisp/packages/lpr.el	Mon Aug 13 09:55:28 2007 +0200
@@ -115,8 +115,27 @@
   (print-region-1 start end lpr-switches t))
 
 ;; XEmacs change
-(require 'message)	; Until We can get some sensible autoloads, or
+;; (require 'message)	; Until We can get some sensible autoloads, or
 			; message-flatten-list gets put somewhere decent.
+;; Sigh ...
+;; `ps-flatten-list' is defined here (copied from "message.el" and
+;; enhanced to handle dotted pairs as well) until we can get some
+;; sensible autoloads, or `flatten-list' gets put somewhere decent.
+
+;; (ps-flatten-list '((a . b) c (d . e) (f g h) i . j))
+;; => (a b c d e f g h i j)
+
+(defun lpr-flatten-list (&rest list)
+  (lpr-flatten-list-1 list))
+
+(defun lpr-flatten-list-1 (list)
+  (cond
+    ((null list) (list))
+    ((consp list)
+     (append (lpr-flatten-list-1 (car list))
+	     (lpr-flatten-list-1 (cdr list))))
+    (t (list list))))
+
 (defun print-region-1 (start end switches page-headers)
   ;; On some MIPS system, having a space in the job name
   ;; crashes the printer demon.  But using dashes looks ugly
@@ -139,7 +158,7 @@
 					 (list lpr-headers-switches)
 				        lpr-headers-switches)
 				     switches))))
-      (setq nswitches (message-flatten-list    ; XEmacs
+      (setq nswitches (lpr-flatten-list    ; XEmacs
 		       (mapcar '(lambda (arg)  ; Dynamic evaluation
 				  (cond ((stringp arg) arg)
 					((functionp arg) (apply arg nil))