Mercurial > emacs
comparison lisp/ps-print.el @ 86282:6fd01916efe1
ps-lpr-switches docstring fix.
author | Vinicius Jose Latorre <viniciusjl@ig.com.br> |
---|---|
date | Wed, 21 Nov 2007 15:27:22 +0000 |
parents | 4a4d5773bb72 |
children | 2256fea11eb1 |
comparison
equal
deleted
inserted
replaced
86281:415c55996da6 | 86282:6fd01916efe1 |
---|---|
12 ;; Keywords: wp, print, PostScript | 12 ;; Keywords: wp, print, PostScript |
13 ;; Version: 6.8.1 | 13 ;; Version: 6.8.1 |
14 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre | 14 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre |
15 | 15 |
16 (defconst ps-print-version "6.8.1" | 16 (defconst ps-print-version "6.8.1" |
17 "ps-print.el, v 6.8.1 <2007/11/09 vinicius> | 17 "ps-print.el, v 6.8.1 <2007/11/21 vinicius> |
18 | 18 |
19 Vinicius's last change version -- this file may have been edited as part of | 19 Vinicius's last change version -- this file may have been edited as part of |
20 Emacs without changes to the version number. When reporting bugs, please also | 20 Emacs without changes to the version number. When reporting bugs, please also |
21 report the version of Emacs, if any, that ps-print was distributed with. | 21 report the version of Emacs, if any, that ps-print was distributed with. |
22 | 22 |
1786 :type 'string | 1786 :type 'string |
1787 :version "20" | 1787 :version "20" |
1788 :group 'ps-print-printer) | 1788 :group 'ps-print-printer) |
1789 | 1789 |
1790 (defcustom ps-lpr-switches lpr-switches | 1790 (defcustom ps-lpr-switches lpr-switches |
1791 "*A list of extra switches to pass to `ps-lpr-command'." | 1791 "*List of extra switches to pass to `ps-lpr-command'. |
1792 | |
1793 The list element can be: | |
1794 | |
1795 string it should be an option for `ps-lpr-command' (which see). | |
1796 For example: \"-o Duplex=DuplexNoTumble\" | |
1797 | |
1798 symbol it can be a function or variable symbol. If it's a function | |
1799 symbol, it should be a function with no argument. The result | |
1800 of the function or the variable value should be a string or a | |
1801 list of strings. | |
1802 | |
1803 list the header should be a symbol function and the tail is the | |
1804 arguments for this function. This function should return a | |
1805 string or a list of strings. | |
1806 | |
1807 Any other value is silently ignored. | |
1808 | |
1809 It is recommended to set `ps-printer-name' (which see) instead of including an | |
1810 explicit switch on this list. | |
1811 | |
1812 See `ps-lpr-command'." | |
1792 :type '(repeat :tag "PostScript lpr Switches" | 1813 :type '(repeat :tag "PostScript lpr Switches" |
1793 (choice :menu-tag "PostScript lpr Switch" | 1814 (choice :menu-tag "PostScript lpr Switch" |
1794 :tag "PostScript lpr Switch" | 1815 :tag "PostScript lpr Switch" |
1795 string symbol (repeat sexp))) | 1816 string symbol (repeat sexp))) |
1796 :version "20" | 1817 :version "20" |
6857 (apply (or ps-print-region-function 'call-process-region) | 6878 (apply (or ps-print-region-function 'call-process-region) |
6858 (point-min) (point-max) ps-lpr-command nil | 6879 (point-min) (point-max) ps-lpr-command nil |
6859 (and (fboundp 'start-process) 0) | 6880 (and (fboundp 'start-process) 0) |
6860 nil | 6881 nil |
6861 (ps-flatten-list ; dynamic evaluation | 6882 (ps-flatten-list ; dynamic evaluation |
6862 (mapcar 'ps-eval-switch ps-lpr-switches))))) | 6883 (ps-string-list |
6884 (mapcar 'ps-eval-switch ps-lpr-switches)))))) | |
6863 (and ps-razzle-dazzle (message "Printing...done"))) | 6885 (and ps-razzle-dazzle (message "Printing...done"))) |
6864 (kill-buffer ps-spool-buffer))) | 6886 (kill-buffer ps-spool-buffer))) |
6887 | |
6888 (defun ps-string-list (arg) | |
6889 (let (lstr) | |
6890 (dolist (elm arg) | |
6891 (cond ((stringp elm) | |
6892 (setq lstr (cons elm lstr))) | |
6893 ((listp elm) | |
6894 (let ((s (ps-string-list elm))) | |
6895 (when s | |
6896 (setq lstr (cons s lstr))))) | |
6897 (t ))) ; ignore any other value | |
6898 (nreverse lstr))) | |
6865 | 6899 |
6866 ;; Dynamic evaluation | 6900 ;; Dynamic evaluation |
6867 (defun ps-eval-switch (arg) | 6901 (defun ps-eval-switch (arg) |
6868 (cond ((stringp arg) arg) | 6902 (cond ((stringp arg) arg) |
6869 ((functionp arg) (apply arg nil)) | 6903 ((functionp arg) (apply arg nil)) |