comparison lisp/ps-print.el @ 15621:6be6d1990543

(ps-article-author, ps-info-file, ps-info-node): Don't die if header is missing.
author Karl Heuer <kwzh@gnu.org>
date Sun, 07 Jul 1996 17:35:32 +0000
parents 7844c0f756d0
children 05c14d5cce5c
comparison
equal deleted inserted replaced
15620:7844c0f756d0 15621:6be6d1990543
1952 ;; understands RFC-822 addresses and can pull the real name out where 1952 ;; understands RFC-822 addresses and can pull the real name out where
1953 ;; it's provided. To be placed in ps-left-headers. 1953 ;; it's provided. To be placed in ps-left-headers.
1954 (defun ps-article-author () 1954 (defun ps-article-author ()
1955 (save-excursion 1955 (save-excursion
1956 (goto-char (point-min)) 1956 (goto-char (point-min))
1957 (if (re-search-forward "^From:[ \t]+\\(.*\\)$") 1957 (if (re-search-forward "^From:[ \t]+\\(.*\\)$" nil t)
1958 (let ((fromstring (buffer-substring (match-beginning 1) (match-end 1)))) 1958 (let ((fromstring (buffer-substring (match-beginning 1) (match-end 1))))
1959 (cond 1959 (cond
1960 1960
1961 ;; Try first to match addresses that look like 1961 ;; Try first to match addresses that look like
1962 ;; thompson@wg2.waii.com (Jim Thompson) 1962 ;; thompson@wg2.waii.com (Jim Thompson)
2025 ;; Look in an article or mail message for the Subject: line. To be 2025 ;; Look in an article or mail message for the Subject: line. To be
2026 ;; placed in ps-left-headers. 2026 ;; placed in ps-left-headers.
2027 (defun ps-info-file () 2027 (defun ps-info-file ()
2028 (save-excursion 2028 (save-excursion
2029 (goto-char (point-min)) 2029 (goto-char (point-min))
2030 (if (re-search-forward "File:[ \t]+\\([^, \t\n]*\\)") 2030 (if (re-search-forward "File:[ \t]+\\([^, \t\n]*\\)" nil t)
2031 (buffer-substring (match-beginning 1) (match-end 1)) 2031 (buffer-substring (match-beginning 1) (match-end 1))
2032 "File ???"))) 2032 "File ???")))
2033 2033
2034 ;; Look in an article or mail message for the Subject: line. To be 2034 ;; Look in an article or mail message for the Subject: line. To be
2035 ;; placed in ps-left-headers. 2035 ;; placed in ps-left-headers.
2036 (defun ps-info-node () 2036 (defun ps-info-node ()
2037 (save-excursion 2037 (save-excursion
2038 (goto-char (point-min)) 2038 (goto-char (point-min))
2039 (if (re-search-forward "Node:[ \t]+\\([^,\t\n]*\\)") 2039 (if (re-search-forward "Node:[ \t]+\\([^,\t\n]*\\)" nil t)
2040 (buffer-substring (match-beginning 1) (match-end 1)) 2040 (buffer-substring (match-beginning 1) (match-end 1))
2041 "Node ???"))) 2041 "Node ???")))
2042 2042
2043 (defun ps-info-mode-hook () 2043 (defun ps-info-mode-hook ()
2044 (setq ps-left-header 2044 (setq ps-left-header