comparison lisp/packages/ps-print.el @ 4:b82b59fe008d r19-15b3

Import from CVS: tag r19-15b3
author cvs
date Mon, 13 Aug 2007 08:46:56 +0200
parents ac2d302a0011
children 27bc7f280385
comparison
equal deleted inserted replaced
3:30df88044ec6 4:b82b59fe008d
1897 (delete-region (marker-position safe-marker) (point-max)))))) 1897 (delete-region (marker-position safe-marker) (point-max))))))
1898 1898
1899 (if ps-razzle-dazzle 1899 (if ps-razzle-dazzle
1900 (message "Formatting...done"))))) 1900 (message "Formatting...done")))))
1901 1901
1902 ;; XEmacs change
1903 ;; Permit dynamic evaluation at print time of ps-lpr-switches
1902 (defun ps-do-despool (filename) 1904 (defun ps-do-despool (filename)
1903 (if (or (not (boundp 'ps-spool-buffer)) 1905 (if (or (not (boundp 'ps-spool-buffer))
1904 (not ps-spool-buffer)) 1906 (not ps-spool-buffer))
1905 (message "No spooled PostScript to print") 1907 (message "No spooled PostScript to print")
1906 (ps-end-file) 1908 (ps-end-file)
1919 (message "Printing...")) 1921 (message "Printing..."))
1920 (save-excursion 1922 (save-excursion
1921 (set-buffer ps-spool-buffer) 1923 (set-buffer ps-spool-buffer)
1922 (if (and (eq system-type 'ms-dos) (stringp dos-ps-printer)) 1924 (if (and (eq system-type 'ms-dos) (stringp dos-ps-printer))
1923 (write-region (point-min) (point-max) dos-ps-printer t 0) 1925 (write-region (point-min) (point-max) dos-ps-printer t 0)
1924 (let ((binary-process-input t)) ; for MS-DOS 1926 (let ((binary-process-input t) ; for MS-DOS
1927 (ps-lpr-sw (message-flatten-list ; XEmacs
1928 (mapcar '(lambda (arg) ; Dynamic evaluation
1929 (cond ((stringp arg) arg)
1930 ((functionp arg) (apply arg nil))
1931 ((symbolp arg) (eval arg))
1932 ((consp arg) (apply (car arg)
1933 (cdr arg)))
1934 (t nil)))
1935 ps-lpr-switches))))
1925 (apply 'call-process-region 1936 (apply 'call-process-region
1926 (point-min) (point-max) ps-lpr-command nil 1937 (point-min) (point-max) ps-lpr-command nil
1927 (if (fboundp 'start-process) 0 nil) 1938 (if (fboundp 'start-process) 0 nil)
1928 nil 1939 nil
1929 ps-lpr-switches)))) 1940 ps-lpr-sw))))
1930 (if ps-razzle-dazzle 1941 (if ps-razzle-dazzle
1931 (message "Printing...done"))) 1942 (message "Printing...done")))
1932 (kill-buffer ps-spool-buffer))) 1943 (kill-buffer ps-spool-buffer)))
1933 1944
1934 (defun ps-kill-emacs-check () 1945 (defun ps-kill-emacs-check ()
2027 ;; Every now and then I forget to switch from the *Summary* buffer to 2038 ;; Every now and then I forget to switch from the *Summary* buffer to
2028 ;; the *Article* before hitting prsc, and a nicely formatted list of 2039 ;; the *Article* before hitting prsc, and a nicely formatted list of
2029 ;; article subjects shows up at the printer. This function, bound to 2040 ;; article subjects shows up at the printer. This function, bound to
2030 ;; prsc for the gnus *Summary* buffer means I don't have to switch 2041 ;; prsc for the gnus *Summary* buffer means I don't have to switch
2031 ;; buffers first. 2042 ;; buffers first.
2043 ;; sb: Updated for Gnus 5.
2032 (defun ps-gnus-print-article-from-summary () 2044 (defun ps-gnus-print-article-from-summary ()
2033 (interactive) 2045 (interactive)
2034 (if (get-buffer "*Article*") 2046 (let ((ps-buf (if (boundp 'gnus-article-buffer)
2035 (save-excursion 2047 gnus-article-buffer
2036 (set-buffer "*Article*") 2048 "*Article*")))
2037 (ps-spool-buffer-with-faces)))) 2049 (if (get-buffer ps-buf)
2050 (save-excursion
2051 (set-buffer ps-buf)
2052 (ps-spool-buffer-with-faces)))))
2038 2053
2039 ;; See ps-gnus-print-article-from-summary. This function does the 2054 ;; See ps-gnus-print-article-from-summary. This function does the
2040 ;; same thing for vm. 2055 ;; same thing for vm.
2041 (defun ps-vm-print-message-from-summary () 2056 (defun ps-vm-print-message-from-summary ()
2042 (interactive) 2057 (interactive)