diff lisp/ps-print.el @ 28576:1694ed739e69

Customization fix, doc fix. (ps-print-version): New version number (5.1.4). (ps-article-author, ps-article-subject, ps-info-file, ps-info-node) (ps-print-preprint): Adjust code. (ps-printer-name, ps-lpr-switches, ps-user-defined-prologue) (ps-print-prologue-header, ps-print-control-characters) (ps-spool-config): Customization fix.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 13 Apr 2000 19:15:23 +0000
parents 5236c7327cd6
children 419ab8689a3f
line wrap: on
line diff
--- a/lisp/ps-print.el	Thu Apr 13 19:12:54 2000 +0000
+++ b/lisp/ps-print.el	Thu Apr 13 19:15:23 2000 +0000
@@ -9,11 +9,11 @@
 ;; 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
-
-(defconst ps-print-version "5.1.3"
-  "ps-print.el, v 5.1.3 <2000/03/29 vinicius>
+;; Time-stamp:	<2000/04/09 14:06:12 vinicius>
+;; Version:	5.1.4
+
+(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,
@@ -196,6 +196,11 @@
 ;; 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
 ;; ---------------
@@ -1278,7 +1283,7 @@
    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
@@ -1306,7 +1311,7 @@
    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)
@@ -1331,7 +1336,7 @@
   :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
@@ -1349,7 +1354,8 @@
 
 (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
@@ -1446,7 +1452,7 @@
 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
@@ -1725,10 +1731,10 @@
   :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:
@@ -1756,7 +1762,7 @@
 	 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,
@@ -2974,10 +2980,10 @@
 		  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"))
@@ -4859,7 +4865,7 @@
   (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
@@ -4869,8 +4875,7 @@
   (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
@@ -4879,9 +4884,10 @@
 	    (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)))
@@ -4937,7 +4943,7 @@
   (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
@@ -4946,7 +4952,7 @@
   (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 ()