annotate src/dosfns.c @ 13120:497576f74e1a

(gnus-summary-save-in-mail): Use mail-file-babyl-p.
author Richard M. Stallman <rms@gnu.org>
date Wed, 04 Oct 1995 20:07:33 +0000
parents 93cc41315528
children 59663cba4b02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 /* MS-DOS specific Lisp utilities. Coded by Manabu Higashida, 1991.
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2 Major changes May-July 1993 Morten Welinder (only 10% original code left)
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3 Copyright (C) 1991, 1993 Free Software Foundation, Inc.
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 This file is part of GNU Emacs.
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 GNU Emacs is free software; you can redistribute it and/or modify
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 it under the terms of the GNU General Public License as published by
10504
8a1bd0598b49 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 9572
diff changeset
9 the Free Software Foundation; either version 2, or (at your option)
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 any later version.
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 GNU Emacs is distributed in the hope that it will be useful,
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 GNU General Public License for more details.
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 along with GNU Emacs; see the file COPYING. If not, write to
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21
5980
a203b7c30300 Use <...> for config.h.
Richard M. Stallman <rms@gnu.org>
parents: 5503
diff changeset
22 #include <config.h>
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24 #ifdef MSDOS
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 /* The entire file is within this conditional */
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 #include <stdio.h>
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 #include <dos.h>
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 #include "lisp.h"
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 #include "buffer.h"
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 #include "termchar.h"
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 #include "termhooks.h"
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 #include "frame.h"
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 #include "dosfns.h"
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 #include "msdos.h"
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36
7272
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
37 DEFUN ("mode25", Fmode25, Smode25, 0, 0, "", "\
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
38 Changes the number of rows to 25.")
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39 ()
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 {
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 union REGS regs;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42
7272
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
43 #ifdef HAVE_X_WINDOWS
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
44 if (!inhibit_window_system)
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
45 return Qnil;
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
46 #endif
12990
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
47 mouse_off ();
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 regs.x.ax = 3;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 int86 (0x10, &regs, &regs);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 regs.x.ax = 0x1101;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51 regs.h.bl = 0;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 int86 (0x10, &regs, &regs);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 regs.x.ax = 0x1200;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 regs.h.bl = 32;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 int86 (0x10, &regs, &regs);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 regs.x.ax = 3;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 int86 (0x10, &regs, &regs);
7272
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
58 Fset_frame_size (Fselected_frame (), ScreenCols (), ScreenRows ());
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 Frecenter (Qnil);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 Fredraw_display ();
7272
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
61 if (have_mouse) mouse_init ();
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
62 return Qnil;
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 }
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64
7272
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
65 DEFUN ("mode4350", Fmode4350, Smode4350, 0, 0, "", "\
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
66 Changes the number of rows to 43 (EGA) or 50 (VGA).")
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 ()
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 {
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 union REGS regs;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70
7272
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
71 #ifdef HAVE_X_WINDOWS
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
72 if (!inhibit_window_system)
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
73 return Qnil;
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
74 #endif
12990
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
75 mouse_off ();
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 regs.x.ax = 3;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 int86 (0x10, &regs, &regs);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 regs.x.ax = 0x1112;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 regs.h.bl = 0;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 int86 (0x10, &regs, &regs);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 regs.x.ax = 0x1200;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 regs.h.bl = 32;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 int86 (0x10, &regs, &regs);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 regs.x.ax = 0x0100;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 regs.x.cx = 7;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 int86 (0x10, &regs, &regs);
7272
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
87 Fset_frame_size (Fselected_frame (), ScreenCols (), ScreenRows ());
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 Frecenter (Qnil);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 Fredraw_display ();
7272
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
90 if (have_mouse) mouse_init ();
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
91 return Qnil;
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92 }
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 DEFUN ("int86", Fint86, Sint86, 2, 2, 0,
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 "Call specific MSDOS interrupt number INTERRUPT with REGISTERS.\n\
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 Return the updated REGISTER vector.\n\
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 \n\
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 INTERRUPT should be an integer in the range 0 to 255.\n\
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 REGISTERS should be a vector produced by `make-register' and\n\
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 `set-register-value'.")
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 (intno, regs)
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 Lisp_Object intno, regs;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 {
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 register int i;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 int no;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 union REGS inregs, outregs;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 Lisp_Object val;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 CHECK_NUMBER (intno, 0);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 no = (unsigned long) XINT (intno);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 CHECK_VECTOR (regs, 1);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 if (no < 0 || no > 0xff || XVECTOR (regs)-> size != 8)
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 return Qnil;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 for (i = 0; i < 8; i++)
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 CHECK_NUMBER (XVECTOR (regs)->contents[i], 1);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117 inregs.x.ax = (unsigned long) XFASTINT (XVECTOR (regs)->contents[0]);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 inregs.x.bx = (unsigned long) XFASTINT (XVECTOR (regs)->contents[1]);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 inregs.x.cx = (unsigned long) XFASTINT (XVECTOR (regs)->contents[2]);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 inregs.x.dx = (unsigned long) XFASTINT (XVECTOR (regs)->contents[3]);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 inregs.x.si = (unsigned long) XFASTINT (XVECTOR (regs)->contents[4]);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 inregs.x.di = (unsigned long) XFASTINT (XVECTOR (regs)->contents[5]);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 inregs.x.cflag = (unsigned long) XFASTINT (XVECTOR (regs)->contents[6]);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 inregs.x.flags = (unsigned long) XFASTINT (XVECTOR (regs)->contents[7]);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 int86 (no, &inregs, &outregs);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 XVECTOR (regs)->contents[0] = make_number (outregs.x.ax);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129 XVECTOR (regs)->contents[1] = make_number (outregs.x.bx);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 XVECTOR (regs)->contents[2] = make_number (outregs.x.cx);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 XVECTOR (regs)->contents[3] = make_number (outregs.x.dx);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 XVECTOR (regs)->contents[4] = make_number (outregs.x.si);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 XVECTOR (regs)->contents[5] = make_number (outregs.x.di);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 XVECTOR (regs)->contents[6] = make_number (outregs.x.cflag);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 XVECTOR (regs)->contents[7] = make_number (outregs.x.flags);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 return regs;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 }
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139
9572
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
140 #ifndef HAVE_X_WINDOWS
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
141 /* Later we might want to control the mouse interface with this function,
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
142 e.g., with respect to non-80 column screen modes. */
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
143
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
144 DEFUN ("msdos-mouse-p", Fmsdos_mouse_p, Smsdos_mouse_p, 0, 0, 0, "\
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
145 Report whether a mouse is present.")
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
146 ()
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
147 {
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
148 if (have_mouse)
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
149 return Qt;
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
150 else
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
151 return Qnil;
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
152 }
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
153
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
154 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0,
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
155 "Move the mouse pointer to the center of character cell (X,Y) in FRAME.\n\
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
156 WARNING: If you use this under X windows,\n\
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
157 you should call `unfocus-frame' afterwards.")
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
158 (frame, x, y)
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
159 Lisp_Object frame, x, y;
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
160 {
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
161 mouse_moveto (XINT (x), XINT (y));
12990
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
162 return Qnil;
9572
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
163 }
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
164
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
165 /* Function to translate colour names to integers. See lisp/term/pc-win.el
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
166 for its definition. */
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
167
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
168 Lisp_Object Qmsdos_color_translate;
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
169 #endif
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
170
12990
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
171
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
172 DEFUN ("msdos-mouse-init", Fmsdos_mouse_init, Smsdos_mouse_init, 0, 0, "",
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
173 "Initialize and enable mouse if available.")
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
174 ()
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
175 {
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
176 if (have_mouse) {
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
177 have_mouse = 1;
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
178 mouse_init ();
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
179 return Qt;
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
180 }
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
181 return Qnil;
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
182 }
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
183
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
184 DEFUN ("msdos-mouse-enable", Fmsdos_mouse_enable, Smsdos_mouse_enable, 0, 0, "",
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
185 "Enable mouse if available.")
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
186 ()
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
187 {
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
188 if (have_mouse)
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
189 {
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
190 have_mouse = 1;
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
191 mouse_on ();
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
192 }
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
193 return have_mouse ? Qt : Qnil;
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
194 }
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
195
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
196 DEFUN ("msdos-mouse-disable", Fmsdos_mouse_disable, Smsdos_mouse_disable, 0, 0, "",
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
197 "Disable mouse if available.")
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
198 ()
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
199 {
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
200 mouse_off ();
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
201 if (have_mouse) have_mouse = -1;
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
202 return Qnil;
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
203 }
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
204
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
205
9572
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
206
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 int dos_country_code;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 int dos_codepage;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 Lisp_Object Vdos_version;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 void
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 init_dosfns ()
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 {
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 union REGS regs;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 _go32_dpmi_seginfo info;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 _go32_dpmi_registers dpmiregs;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217
9572
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
218 #ifndef SYSTEM_MALLOC
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 get_lim_data (); /* why the hell isn't this called elsewhere? */
9572
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
220 #endif
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 regs.x.ax = 0x3000;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 intdos (&regs, &regs);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 Vdos_version = Fcons (make_number (regs.h.al), make_number (regs.h.ah));
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 /* Obtain the country code by calling Dos via Dpmi. Don't rely on GO32. */
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 info.size = (34 + 15) / 16;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 if (_go32_dpmi_allocate_dos_memory (&info))
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 dos_country_code = 1;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 else
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231 {
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232 dpmiregs.x.ax = 0x3800;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233 dpmiregs.x.ds = info.rm_segment;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234 dpmiregs.x.dx = 0;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 dpmiregs.x.ss = dpmiregs.x.sp = 0;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236 _go32_dpmi_simulate_int (0x21, &dpmiregs);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 dos_country_code = dpmiregs.x.bx;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 _go32_dpmi_free_dos_memory (&info);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239 }
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 regs.x.ax = 0x6601;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242 intdos (&regs, &regs);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 if (regs.x.cflag)
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 /* Estimate code page from country code */
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 switch (dos_country_code)
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 {
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247 case 45: /* Denmark */
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 case 47: /* Norway */
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 dos_codepage = 865;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 break;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251 default:
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 /* US */
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 dos_codepage = 437;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254 }
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 else
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256 dos_codepage = regs.x.bx & 0xffff;
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 }
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259 /*
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 * Define everything
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 */
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262 syms_of_dosfns ()
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 {
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 defsubr (&Smode25);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 defsubr (&Smode4350);
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 defsubr (&Sint86);
12990
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
267 defsubr (&Smsdos_mouse_init);
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
268 defsubr (&Smsdos_mouse_enable);
93cc41315528 (Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents: 10504
diff changeset
269 defsubr (&Smsdos_mouse_disable);
9572
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
270 #ifndef HAVE_X_WINDOWS
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
271 defsubr (&Smsdos_mouse_p);
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
272 defsubr (&Sset_mouse_position);
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
273
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
274 Qmsdos_color_translate = intern ("msdos-color-translate");
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
275 staticpro (&Qmsdos_color_translate);
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 7272
diff changeset
276 #endif
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 DEFVAR_INT ("dos-country-code", &dos_country_code,
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 "The country code returned by Dos when Emacs was started.\n\
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 Usually this is the international telephone prefix.");
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 DEFVAR_INT ("dos-codepage", &dos_codepage,
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 "The codepage active when Emacs was started.\n\
7272
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
284 The following are known:\n\
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
285 437 United States\n\
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
286 850 Multilingual (Latin I)\n\
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
287 852 Slavic (Latin II)\n\
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
288 857 Turkish\n\
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
289 860 Portugal\n\
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
290 861 Iceland\n\
b5f74966c9da Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents: 5980
diff changeset
291 863 Canada (French)\n\
5503
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 865 Norway/Denmark");
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294 DEFVAR_LISP ("dos-version", &Vdos_version,
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295 "The (MAJOR . MINOR) Dos version (subject to modification with setver).");
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296 }
003e84b91d21 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
297 #endif /* MSDOS */