comparison lisp/packages/lpr.el @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children 27bc7f280385
comparison
equal deleted inserted replaced
1:c0c6a60d29db 2:ac2d302a0011
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details. 18 ;; General Public License for more details.
19 19
20 ;; You should have received a copy of the GNU General Public License 20 ;; You should have received a copy of the GNU General Public License
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free 21 ;; along with XEmacs; see the file COPYING. If not, write to the Free
22 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23 ;; 02111-1307, USA.
23 24
24 ;;; Synched up with: FSF 19.30. 25 ;;; Synched up with: FSF 19.34.
25 26
26 ;;; Commentary: 27 ;;; Commentary:
27 28
28 ;; Commands to send the region or a buffer your printer. Entry points 29 ;; Commands to send the region or a buffer your printer. Entry points
29 ;; are `lpr-buffer', `print-buffer', lpr-region', or `print-region'; option 30 ;; are `lpr-buffer', `print-buffer', lpr-region', or `print-region'; option
31 32
32 ;;; Code: 33 ;;; Code:
33 34
34 ;;;###autoload 35 ;;;###autoload
35 (defvar lpr-switches nil 36 (defvar lpr-switches nil
36 "*List of strings to pass as extra switch args to `lpr' when it is invoked.") 37 "*List of strings to pass as extra options for the printer program.
38 See `lpr-command'.")
37 39
38 (defvar lpr-add-switches (eq system-type 'berkeley-unix) 40 (defvar lpr-add-switches (eq system-type 'berkeley-unix)
39 "*Non-nil means construct -T and -J options for the `lpr'.") 41 "*Non-nil means construct -T and -J options for the printer program.
42 These are made assuming that the program is `lpr';
43 if you are using some other incompatible printer program,
44 this variable should be nil.")
40 45
41 ;;;###autoload 46 ;;;###autoload
42 (defvar lpr-command 47 (defvar lpr-command
43 (if (memq system-type '(usg-unix-v dgux hpux irix)) 48 (if (memq system-type '(usg-unix-v dgux hpux irix))
44 "lp" "lpr") 49 "lp" "lpr")
45 "*Name of program for printing a file.") 50 "*Name of program for printing a file.")
46 51
47 ;; Default is nil, because that enables us to use pr -f 52 ;; Default is nil, because that enables us to use pr -f
48 ;; which is more reliable than pr with no args, which is what lpr -p does. 53 ;; which is more reliable than pr with no args, which is what lpr -p does.
49 (defvar lpr-headers-switches nil 54 (defvar lpr-headers-switches nil
50 "*List of strings to use as options for `lpr' to request page headings. 55 "*List of strings of options to request page headings in the printer program.
51 If nil, we run `lpr-page-header-program' to make page headings 56 If nil, we run `lpr-page-header-program' to make page headings
52 and print the result.") 57 and print the result.")
53 58
54 (defvar print-region-function nil 59 (defvar print-region-function nil
55 "Function to call to print the region on a printer. 60 "Function to call to print the region on a printer.
57 62
58 (defvar lpr-page-header-program "pr" 63 (defvar lpr-page-header-program "pr"
59 "*Name of program for adding page headers to a file.") 64 "*Name of program for adding page headers to a file.")
60 65
61 (defvar lpr-page-header-switches '("-f") 66 (defvar lpr-page-header-switches '("-f")
62 "*List of strings to use as options for `lpr-page-header-program'.") 67 "*List of strings to use as options for the page-header-generating program.
68 The variable `lpr-page-header-program' specifies the program to use.")
63 69
64 ;;;###autoload 70 ;;;###autoload
65 (defun lpr-buffer () 71 (defun lpr-buffer ()
66 "Print buffer contents as with Unix command `lpr'. 72 "Print buffer contents as with Unix command `lpr'.
67 `lpr-switches' is a list of extra switches (strings) to pass to lpr." 73 `lpr-switches' is a list of extra switches (strings) to pass to lpr."
93 ;; On some MIPS system, having a space in the job name 99 ;; On some MIPS system, having a space in the job name
94 ;; crashes the printer demon. But using dashes looks ugly 100 ;; crashes the printer demon. But using dashes looks ugly
95 ;; and it seems to annoying to do for that MIPS system. 101 ;; and it seems to annoying to do for that MIPS system.
96 (let ((name (concat (buffer-name) " Emacs buffer")) 102 (let ((name (concat (buffer-name) " Emacs buffer"))
97 (title (concat (buffer-name) " Emacs buffer")) 103 (title (concat (buffer-name) " Emacs buffer"))
104 ;; On MS-DOS systems, make pipes use binary mode if the
105 ;; original file is binary.
106 (binary-process-input buffer-file-type)
107 (binary-process-output buffer-file-type)
98 (width tab-width) 108 (width tab-width)
99 switch-string) 109 switch-string)
100 (save-excursion 110 (save-excursion
101 (if page-headers 111 (if page-headers
102 (if lpr-headers-switches 112 (if lpr-headers-switches