;;; ps-print.el --- print text from the buffer as PostScript
-;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1993-2013 Free Software Foundation, Inc.
;; Author: Jim Thompson (was <thompson@wg2.waii.com>)
;; Jacques Duthen (was <duthen@cegelec-red.fr>)
;; (setq ps-font-info-database '(<your stuff> <the standard stuff>))
;; or, use `ps-print-hook' (see section Hooks):
;; (add-hook 'ps-print-hook
-;; '(lambda ()
+;; (lambda ()
;; (or (assq 'Helvetica ps-font-info-database)
;; (setq ps-font-info-database (append ...)))))
;;
;; variables `ps-bold-faces', `ps-italic-faces' and `ps-underlined-faces'.
;; These variables contain lists of faces that ps-print should consider bold,
;; italic or underline; to set them, put code like the following into your
-;; .emacs file:
+;; init file:
;;
;; (setq ps-bold-faces '(my-blue-face))
;; (setq ps-italic-faces '(my-red-face))
(require 'lpr)
-(or (featurep 'lisp-float-type)
- (error "`ps-print' requires floating point support"))
-
-
(if (featurep 'xemacs)
- ()
+ (or (featurep 'lisp-float-type)
+ (error "`ps-print' requires floating point support"))
(unless (and (boundp 'emacs-major-version)
(>= emacs-major-version 23))
(error "`ps-print' only supports Emacs 23 and higher")))
;; Load XEmacs/Emacs definitions
-(eval-and-compile (require 'ps-def))
+(require 'ps-def)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
"Support for printing and PostScript."
:tag "PostScript"
:version "20"
- :group 'emacs)
+ :group 'external)
(defgroup ps-print nil
"PostScript generator for Emacs."
Any other value is treated as nil.
-If you set `ps-selected-pages' (see it for documentation), first the pages are
-filtered by `ps-selected-pages' and then by `ps-even-or-odd-pages'. For
-example, if we have:
+If you set option `ps-selected-pages', first the pages are
+filtered by option `ps-selected-pages' and then by `ps-even-or-odd-pages'.
+For example, if we have:
(setq ps-selected-pages '(1 4 (6 . 10) (12 . 16) 20))
-Combining with `ps-even-or-odd-pages' and `ps-n-up-printing', we have:
+Combining with `ps-even-or-odd-pages' and option `ps-n-up-printing', we have:
`ps-n-up-printing' = 1:
`ps-even-or-odd-pages' PAGES PRINTED
;;;###autoload
(defun ps-spool-buffer-with-faces ()
"Generate and spool a PostScript image of the buffer.
-Like `ps-spool-buffer', but includes font, color, and underline information in
-the generated image. This command works only if you are using a window system,
-so it has a way to determine color values.
+Like the command `ps-spool-buffer', but includes font, color, and underline
+information in the generated image. This command works only if you are using
+a window system, so it has a way to determine color values.
Use the command `ps-despool' to send the spooled images to the printer."
(interactive)
ps-print-height))))))
-(defun ps-print-preprint-region (prefix-arg)
+(defun ps-print-preprint-region (prefix)
(or (ps-mark-active-p)
(error "The mark is not set now"))
- (list (point) (mark) (ps-print-preprint prefix-arg)))
+ (list (point) (mark) (ps-print-preprint prefix)))
-(defun ps-print-preprint (prefix-arg)
- (and prefix-arg
- (or (numberp prefix-arg)
- (listp prefix-arg))
+(defun ps-print-preprint (prefix)
+ (and prefix
+ (or (numberp prefix)
+ (listp prefix))
(let* ((name (concat (file-name-nondirectory (or (buffer-file-name)
(buffer-name)))
".ps"))
(KIND XCOL YCOL XLIN YLIN REPEAT END XSTART YSTART)
Where:
-KIND is a valid value of `ps-n-up-filling'.
+KIND is a valid value of the variable `ps-n-up-filling'.
XCOL YCOL are the relative position for the next column.
XLIN YLIN are the relative position for the beginning of next line.
-REPEAT is the number of repetions for external loop.
-END is the number of repetions for internal loop and also the number of pages in
- a row.
+REPEAT is the number of repetitions for external loop.
+END is the number of repetitions for internal loop and also the number
+ of pages in a row.
XSTART YSTART are the relative position for the first page in a sheet.")
(ps-output " S\n")
wrappoint))
-(defun ps-basic-plot-string (from to &optional bg-color)
+(defun ps-basic-plot-string (from to &optional _bg-color)
(let* ((wrappoint (ps-find-wrappoint from to
(ps-avg-char-width 'ps-font-for-text)))
(to (car wrappoint))
(ps-output " S\n")
wrappoint))
-(defun ps-basic-plot-whitespace (from to &optional bg-color)
+(defun ps-basic-plot-whitespace (from to &optional _bg-color)
(let* ((wrappoint (ps-find-wrappoint from to
(ps-space-width 'ps-font-for-text)))
(to (car wrappoint)))
(error "Unprinted PostScript"))))
(cond ((fboundp 'add-hook)
- (funcall 'add-hook 'kill-emacs-hook 'ps-kill-emacs-check))
+ (unless noninteractive
+ (funcall 'add-hook 'kill-emacs-hook 'ps-kill-emacs-check)))
(kill-emacs-hook
(message "Won't override existing `kill-emacs-hook'"))
(t
;; But autoload them here to make the separation invisible.
\f
;;;### (autoloads (ps-mule-end-job ps-mule-begin-job ps-mule-initialize
-;;;;;; ps-multibyte-buffer) "ps-mule" "ps-mule.el" "371cbfd7a980b9fb80a68013dc44ef1f")
+;;;;;; ps-multibyte-buffer) "ps-mule" "ps-mule.el" "1f436e4d78c7dc983a503dac18298515")
;;; Generated autoloads from ps-mule.el
(defvar ps-multibyte-buffer nil "\