-;; These functions are used in `ps-mule' to get charset of header and footer.
-;; To avoid unnecessary calls to functions in `ps-left-header',
-;; `ps-right-header', `ps-left-footer' and `ps-right-footer'.
-
-(defun ps-generate-string-list (content)
- (let (str)
- (while content
- (setq str (cons (cond
- ;; string
- ((stringp (car content))
- (car content))
- ;; function symbol
- ((and (symbolp (car content)) (fboundp (car content)))
- (concat "(" (funcall (car content)) ")"))
- ;; variable symbol
- ((and (symbolp (car content)) (boundp (car content)))
- (concat "(" (symbol-value (car content)) ")"))
- ;; otherwise, empty string
- (t
- ""))
- str)
- content (cdr content)))
- (nreverse str)))
-
-(defvar ps-lh-cache nil)
-(defvar ps-rh-cache nil)
-(defvar ps-lf-cache nil)
-(defvar ps-rf-cache nil)
-
-(defun ps-header-footer-string ()
- (and ps-print-header
- (setq ps-lh-cache (ps-generate-string-list ps-left-header)
- ps-rh-cache (ps-generate-string-list ps-right-header)))
- (and ps-print-footer
- (setq ps-lf-cache (ps-generate-string-list ps-left-footer)
- ps-rf-cache (ps-generate-string-list ps-right-footer)))
- (mapconcat 'identity
- (append ps-lh-cache ps-rh-cache ps-lf-cache ps-rf-cache)
- ""))
-