# HG changeset patch # User Eli Zaretskii # Date 893771424 0 # Node ID d4b4f44ce8dad528619648e99da33166dc5839f6 # Parent 7a44b61e263bb66237cd135df6b28bc33910e725 (ps-remove-duplicates): New function. (ps-begin-file): Use it. diff -r 7a44b61e263b -r d4b4f44ce8da lisp/ps-print.el --- a/lisp/ps-print.el Tue Apr 28 09:35:07 1998 +0000 +++ b/lisp/ps-print.el Tue Apr 28 13:50:24 1998 +0000 @@ -3142,6 +3142,16 @@ (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 @@ (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")