annotate lisp/dos-fns.el @ 18246:3b4321d0ee7e

(vc-annotate-mode-variables): Init vc-annotate-mode-menu and put it into vc-annotate-mode-map. (vc-annotate-add-menu): Don't init vc-annotate-mode-menu, just add the bindings to it. Display progress messages. (vc-annotate-mode-menu): New defvar. (vc-annotate-ratio): Move defvar, add initial value. (vc-annotate-display-default): Display progress messages. (vc-annotate-display): Use vc-annotate-color-map.
author Richard M. Stallman <rms@gnu.org>
date Sat, 14 Jun 1997 17:29:10 +0000
parents 727cf56647a4
children 860783b225b9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5443
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;;; dos-fns.el --- MS-Dos specific functions.
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
14734
20f4c4a078b2 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 14380
diff changeset
3 ;; Copyright (C) 1991, 1993, 1995, 1996 Free Software Foundation, Inc.
5443
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
17977
727cf56647a4 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 16690
diff changeset
5 ;; Maintainer: Morten Welinder <terra@diku.dk>
5443
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 ;; Keywords: internal
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; any later version.
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14162
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14162
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14162
diff changeset
23 ;; Boston, MA 02111-1307, USA.
5443
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 ;; Part of this code is taken from (or derived from) demacs.
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;;; Code:
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30
13913
4e4201bcea5d (convert-standard-filename): New alternate definition.
Richard M. Stallman <rms@gnu.org>
parents: 13487
diff changeset
31 ;; This overrides a trivial definition in files.el.
4e4201bcea5d (convert-standard-filename): New alternate definition.
Richard M. Stallman <rms@gnu.org>
parents: 13487
diff changeset
32 (defun convert-standard-filename (filename)
4e4201bcea5d (convert-standard-filename): New alternate definition.
Richard M. Stallman <rms@gnu.org>
parents: 13487
diff changeset
33 "Convert a standard file's name to something suitable for the current OS.
4e4201bcea5d (convert-standard-filename): New alternate definition.
Richard M. Stallman <rms@gnu.org>
parents: 13487
diff changeset
34 This function's standard definition is trivial; it just returns the argument.
4e4201bcea5d (convert-standard-filename): New alternate definition.
Richard M. Stallman <rms@gnu.org>
parents: 13487
diff changeset
35 However, on some systems, the function is redefined
4e4201bcea5d (convert-standard-filename): New alternate definition.
Richard M. Stallman <rms@gnu.org>
parents: 13487
diff changeset
36 with a definition that really does change some file names."
15187
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
37 (if (or (msdos-long-file-names)
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
38 (not (stringp filename))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
39 (member (file-name-nondirectory filename) '("" "." "..")))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
40 filename
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
41 (let* ((dir (file-name-directory filename))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
42 (string (copy-sequence (file-name-nondirectory filename)))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
43 (lastchar (aref string (1- (length string))))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
44 i firstdot)
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
45 ;; Change a leading period to a leading underscore.
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
46 (if (= (aref string 0) ?.)
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
47 (aset string 0 ?_))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
48 ;; Get rid of invalid characters.
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
49 (while (setq i (string-match
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
50 "[^-a-zA-Z0-9_.%~^$!#&{}@`'()\200-\376]"
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
51 string))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
52 (aset string i ?_))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
53 ;; If we don't have a period,
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
54 ;; and we have a dash or underscore that isn't the first char,
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
55 ;; change that to a period.
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
56 (if (and (not (string-match "\\." string))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
57 (setq i (string-match "[-_]" string 1)))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
58 (aset string i ?\.))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
59 ;; If we don't have a period in the first 8 chars, insert one.
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
60 (if (> (or (string-match "\\." string)
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
61 (length string))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
62 8)
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
63 (setq string
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
64 (concat (substring string 0 8)
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
65 "."
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
66 (substring string 8))))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
67 (setq firstdot (or (string-match "\\." string) (1- (length string))))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
68 ;; Truncate to 3 chars after the first period.
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
69 (if (> (length string) (+ firstdot 4))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
70 (setq string (substring string 0 (+ firstdot 4))))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
71 ;; Change all periods except the first one into underscores.
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
72 (while (string-match "\\." string (1+ firstdot))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
73 (setq i (string-match "\\." string (1+ firstdot)))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
74 (aset string i ?_))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
75 ;; If the last character of the original filename was `~',
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
76 ;; make sure the munged name ends with it also.
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
77 (if (equal lastchar ?~)
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
78 (aset string (1- (length string)) lastchar))
d46c1e8bdb0d (convert-standard-filename): Test msdos-long-file-names.
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
79 (concat dir string))))
13913
4e4201bcea5d (convert-standard-filename): New alternate definition.
Richard M. Stallman <rms@gnu.org>
parents: 13487
diff changeset
80
5443
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 (defvar msdos-shells '("command.com" "4dos.com" "ndos.com")
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 "*List of shells that use `/c' instead of `-c' and a backslashed command.")
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83
16690
97029c2699a7 (register-name-alist): Use defvar.
Richard M. Stallman <rms@gnu.org>
parents: 16027
diff changeset
84 (defvar register-name-alist
5443
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 '((ax . 0) (bx . 1) (cx . 2) (dx . 3) (si . 4) (di . 5)
7256
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
86 (cflag . 6) (flags . 7)
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
87 (al . (0 . 0)) (bl . (1 . 0)) (cl . (2 . 0)) (dl . (3 . 0))
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
88 (ah . (0 . 1)) (bh . (1 . 1)) (ch . (2 . 1)) (dh . (3 . 1))))
5443
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 (defun make-register ()
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 (make-vector 8 0))
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 (defun register-value (regs name)
7256
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
94 (let ((where (cdr (assoc name register-name-alist))))
5443
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 (cond ((consp where)
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 (let ((tem (aref regs (car where))))
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 (if (zerop (cdr where))
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 (% tem 256)
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 (/ tem 256))))
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 ((numberp where)
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 (aref regs where))
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 (t nil))))
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 (defun set-register-value (regs name value)
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 (and (numberp value)
7256
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
106 (>= value 0)
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
107 (let ((where (cdr (assoc name register-name-alist))))
5443
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 (cond ((consp where)
7256
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
109 (let ((tem (aref regs (car where)))
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
110 (value (logand value 255)))
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
111 (aset regs
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
112 (car where)
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
113 (if (zerop (cdr where))
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
114 (logior (logand tem 65280) value)
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
115 (logior (logand tem 255) (lsh value 8))))))
5443
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 ((numberp where)
7256
0f06f87f3c3b (set-register-value): Setting the high byte of a
Richard M. Stallman <rms@gnu.org>
parents: 7087
diff changeset
117 (aset regs where (logand value 65535))))))
5443
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 regs)
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 (defsubst intdos (regs)
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 (int86 33 regs))
391bfbbb9c1d Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122
14189
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
123 ;; Support for printing under MS-DOS, see lpr.el and ps-print.el.
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
124 (defvar dos-printer "PRN"
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
125 "*The name of a local MS-DOS device to which data is sent for printing.
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
126 \(Note that PostScript files are sent to `dos-ps-printer', which see.\)
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
127
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
128 Typical non-default settings would be \"LPT1\" to \"LPT3\" for
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
129 parallel printers, or \"COM1\" to \"COM4\" or \"AUX\" for serial
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
130 printers. You can also set it to a name of a file, in which
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
131 case the output gets appended to that file.
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
132 If you want to discard the printed output, set this to \"NUL\".")
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
133
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
134 (defun dos-print-region-function (start end
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
135 &optional lpr-prog
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
136 delete-text buf display rest)
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
137 "MS-DOS-specific function to print the region on a printer.
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
138 Writes the region to the device or file which is a value of
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
139 `dos-printer' \(which see\). Ignores any arguments beyond
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
140 START and END."
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
141
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
142 (write-region start end dos-printer t 0)
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
143 ;; Make each print-out start on a new page, but don't waste
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
144 ;; paper if there was a form-feed at the end of this file.
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
145 (if (not (char-equal (char-after (1- end)) ?\C-l))
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
146 (write-region "\f" nil dos-printer t 0)))
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
147
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
148 ;; Set this to nil if you have a port of the `lpr' program and
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
149 ;; you want to use it for printing. If the default setting is
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
150 ;; in effect, `lpr-command' and its switches are ignored when
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
151 ;; printing with `lpr-xxx' and `print-xxx'.
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
152 (setq print-region-function 'dos-print-region-function)
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
153
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
154 ;; Set this to nil if you have a port of the `pr' program
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
155 ;; (e.g., from GNU Textutils), or if you have an `lpr'
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
156 ;; program (see above) that can print page headers.
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
157 ;; If `lpr-headers-switches' is non-nil (the default) and
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
158 ;; `print-region-function' is set to `dos-print-region-function',
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
159 ;; then requests to print page headers will be silently
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
160 ;; ignored, and `print-buffer' and `print-region' produce
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
161 ;; the same output as `lpr-buffer' and `lpr-region', accordingly.
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
162 (setq lpr-headers-switches "(page headers are not supported)")
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
163
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
164 (defvar dos-ps-printer "PRN"
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
165 "*Method for printing PostScript files under MS-DOS.
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
166
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
167 If the value is a string, then it is taken as the name of the
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
168 device to which PostScript files are written. By default it
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
169 is the default printer device; typical non-default settings
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
170 would be \"LPT1\" to \"LPT3\" for parallel printers, or \"COM1\"
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
171 to \"COM4\" or \"AUX\" for serial printers. You can also set it
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
172 to a name of a file, in which case the output gets appended
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
173 to that file. \(Note that `ps-print' package already has
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
174 facilities for printing to a file, so you might as well use
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
175 them instead of changing the setting of this variable.\) If
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
176 you want to silently discard the printed output, set this to \"NUL\".
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
177
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
178 If the value is anything but a string, PostScript files will be
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
179 piped to the program given by `ps-lpr-command', with switches
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
180 given by `ps-lpr-switches', which see.")
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
181
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
182 (setq ps-lpr-command "gs")
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
183
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
184 (setq ps-lpr-switches '("-q" "-dNOPAUSE" "-sDEVICE=epson" "-r240x60"
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
185 "-sOutputFile=LPT1" "-"))
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
186
14380
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
187 ;; Backward compatibility for obsolescent functions which
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
188 ;; set screen size.
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
189
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
190 (defun mode25 ()
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
191 "Changes the number of screen rows to 25."
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
192 (interactive)
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
193 (set-frame-size (selected-frame) 80 25))
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
194
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
195 (defun mode4350 ()
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
196 "Changes the number of rows to 43 or 50.
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
197 Emacs always tries to set the screen height to 50 rows first.
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
198 If this fails, it will try to set it to 43 rows, on the assumption
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
199 that your video hardware might not support 50-line mode."
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
200 (interactive)
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
201 (set-frame-size (selected-frame) 80 50)
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
202 (if (eq (frame-height (selected-frame)) 50)
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
203 nil ; the original built-in function returned nil
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
204 (set-frame-size (selected-frame) 80 43)))
874cd82cd2b4 (mode25): Moved from `src/dosfns.c' for backward compatibility.
Richard M. Stallman <rms@gnu.org>
parents: 14189
diff changeset
205
14189
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
206 (provide 'dos-fns)
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
207
557b3d11a381 (ps-lpr-switches, ps-lpr-command): Just setq them;
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
208 ; dos-fns.el ends here