From 0140c6007b26bb13428eb16c5f8c3c94e38fb1a1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 28 Apr 1998 13:50:24 +0000 Subject: [PATCH] (ps-remove-duplicates): New function. (ps-begin-file): Use it. --- lisp/ps-print.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lisp/ps-print.el b/lisp/ps-print.el index e0f292cd06c..212c10b1977 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -3142,6 +3142,16 @@ page-height == bm + print-height + tm - ho - hh (and has-local-background (ps-output "} def\n")))) +;; Return a list of the distinct elements of LIST. +;; Elements are compared with `equal'. +(defun ps-remove-duplicates (list) + (let (new (tail list)) + (while tail + (or (member (car tail) new) + (setq new (cons (car tail) new))) + (setq tail (cdr tail))) + (nreverse new))) + (defun ps-begin-file () (ps-get-page-dimensions) (setq ps-showline-count (if ps-printing-region (car ps-printing-region) 1) @@ -3161,11 +3171,10 @@ page-height == bm + print-height + tm - ho - hh (if ps-landscape-mode "Landscape" "Portrait") "\n%% DocumentFonts: Times-Roman Times-Italic " (mapconcat 'identity - (remove-duplicates + (ps-remove-duplicates (append (ps-fonts 'ps-font-for-text) (list (ps-font 'ps-font-for-header 'normal) - (ps-font 'ps-font-for-header 'bold))) - :test 'equal) + (ps-font 'ps-font-for-header 'bold)))) " ") "\n%%Pages: (atend)\n" "%%EndComments\n\n") -- 2.39.2