;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters)
;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br>
;; Keywords: wp, print, PostScript
-;; Time-stamp: <2000/03/29 15:45:24 vinicius>
-;; Version: 5.1.3
+;; Time-stamp: <2000/04/09 14:06:12 vinicius>
+;; Version: 5.1.4
-(defconst ps-print-version "5.1.3"
- "ps-print.el, v 5.1.3 <2000/03/29 vinicius>
+(defconst ps-print-version "5.1.4"
+ "ps-print.el, v 5.1.4 <2000/04/09 vinicius>
Vinicius's last change version -- this file may have been edited as part of
Emacs without changes to the version number. When reporting bugs,
;; See definition of `call-process-region' for calling conventions. The fourth
;; and the sixth arguments are both nil.
;;
+;; If you're using NTEmacs, don't forget to customize the following variables:
+;; `ps-printer-name', `ps-lpr-command', `ps-lpr-switches' and
+;; `ps-spool-config'. See these variables documentation in the code or by
+;; typing, for example, C-h v ps-printer-name RET.
+;;
;;
;; The Page Layout
;; ---------------
PostScript Language Reference Manual (2nd edition)
Adobe Systems Incorporated"
:type '(choice :tag "User Defined Prologue"
- string symbol (other :tag "nil" nil))
+ string symbol (const :tag "none" nil))
:group 'ps-print-miscellany)
(defcustom ps-print-prologue-header nil
Adobe Systems Incorporated
Appendix G: Document Structuring Conventions -- Version 3.0"
:type '(choice :tag "Prologue Header"
- string symbol (other :tag "nil" nil))
+ string symbol (const :tag "none" nil))
:group 'ps-print-miscellany)
(defcustom ps-printer-name (and (boundp 'printer-name)
:type '(choice :tag "Printer Name"
(file :tag "Print to file")
(string :tag "Pipe to ps-lpr-command")
- (other :tag "Same as printer-name" nil))
+ (const :tag "Same as printer-name" nil))
:group 'ps-print-printer)
(defcustom ps-lpr-command lpr-command
(defcustom ps-lpr-switches lpr-switches
"*A list of extra switches to pass to `ps-lpr-command'."
- :type '(repeat string)
+ :type '(repeat :tag "PostScript lpr Switches"
+ (choice string symbol (repeat sexp)))
:group 'ps-print-printer)
(defcustom ps-print-region-function nil
Any other value is treated as nil."
:type '(choice :tag "Control Char"
(const 8-bit) (const control-8-bit)
- (const control) (other :tag "nil" nil))
+ (const control) (const :tag "nil" nil))
:group 'ps-print-miscellany)
(defcustom ps-n-up-printing 1
:type 'boolean
:group 'ps-print-headers)
-(defcustom ps-spool-config (if (memq system-type
- '(win32 w32 mswindows ms-dos windows-nt))
- nil
- 'lpr-switches)
+(defcustom ps-spool-config
+ (if (memq system-type '(win32 w32 mswindows ms-dos windows-nt))
+ nil
+ 'lpr-switches)
"*Specify who is responsable for setting duplex and page size switches.
Valid values are:
the printed file isn't ok, set `ps-spool-config' to nil."
:type '(choice :tag "Spool Config"
(const lpr-switches) (const setpagedevice)
- (other :tag "nil" nil))
+ (const :tag "nil" nil))
:group 'ps-print-headers)
(defcustom ps-spool-duplex nil ; Not many people have duplex printers,
ps-header-pad)
ps-print-height))))
-(defun ps-print-preprint (&optional filename)
- (and filename
- (or (numberp filename)
- (listp filename))
+(defun ps-print-preprint (prefix-arg)
+ (and prefix-arg
+ (or (numberp prefix-arg)
+ (listp prefix-arg))
(let* ((name (concat (file-name-nondirectory (or (buffer-file-name)
(buffer-name)))
".ps"))
(save-excursion
(goto-char (point-min))
(if (re-search-forward "^Subject:[ \t]+\\(.*\\)$" nil t)
- (buffer-substring-no-properties (match-beginning 1) (match-end 1))
+ (buffer-substring (match-beginning 1) (match-end 1))
"Subject ???")))
;; Look in an article or mail message for the From: line. Sorta-kinda
(save-excursion
(goto-char (point-min))
(if (re-search-forward "^From:[ \t]+\\(.*\\)$" nil t)
- (let ((fromstring (buffer-substring-no-properties (match-beginning 1)
- (match-end 1))))
+ (let ((fromstring (buffer-substring (match-beginning 1) (match-end 1))))
(cond
;; Try first to match addresses that look like
(substring fromstring (match-beginning 1) (match-end 1)))
;; Next try to match addresses that look like
- ;; Jim Thompson <thompson@wg2.waii.com>
- ((string-match "\\(.*\\)[ \t]+<.*>" fromstring)
- (substring fromstring (match-beginning 1) (match-end 1)))
+ ;; Jim Thompson <thompson@wg2.waii.com> or
+ ;; "Jim Thompson" <thompson@wg2.waii.com>
+ ((string-match "\\(\"?\\)\\(.*\\)\\1[ \t]+<.*>" fromstring)
+ (substring fromstring (match-beginning 2) (match-end 2)))
;; Couldn't find a real name -- show the address instead.
(t fromstring)))
(save-excursion
(goto-char (point-min))
(if (re-search-forward "File:[ \t]+\\([^, \t\n]*\\)" nil t)
- (buffer-substring-no-properties (match-beginning 1) (match-end 1))
+ (buffer-substring (match-beginning 1) (match-end 1))
"File ???")))
;; Look in an article or mail message for the Subject: line. To be
(save-excursion
(goto-char (point-min))
(if (re-search-forward "Node:[ \t]+\\([^,\t\n]*\\)" nil t)
- (buffer-substring-no-properties (match-beginning 1) (match-end 1))
+ (buffer-substring (match-beginning 1) (match-end 1))
"Node ???")))
(defun ps-info-mode-hook ()