comparison src/msdos.c @ 89943:4c90ffeb71c5

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-15 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-218 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-220 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-221 Restore deleted tagline in etc/TUTORIAL.ru * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-222 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-228 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-229 Remove TeX output files from the archive * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-230 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-247 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-248 src/lisp.h (CYCLE_CHECK): Macro moved from xfaces.c * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-249 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-256 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-258 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-263 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-264 Update from CVS: lispref/display.texi: emacs -> Emacs. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-265 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-274 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-275 Update from CVS: man/makefile.w32-in: Revert last change * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-276 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-295 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-296 Allow restarting an existing debugger session that's exited * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-297 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-299 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-300 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-327 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-328 Update from CVS: src/.gdbinit (xsymbol): Fix last change. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-329 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-344 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-345 Tweak source regexps so that building in place won't cause problems * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-346 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-351 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-352 Update from CVS: lisp/flymake.el: New file. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-353 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-361 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-362 Support " [...]" style defaults in minibuffer-electric-default-mode * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-363 (read-number): Use canonical format for default in prompt. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-364 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-367 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-368 Improve display-supports-face-attributes-p on non-ttys * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-369 Rewrite face-differs-from-default-p * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-370 Move `display-supports-face-attributes-p' entirely into C code * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-371 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-372 Simplify face-differs-from-default-p; don't consider :stipple. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-373 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-374 (tty_supports_face_attributes_p): Ensure attributes differ from default * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-375 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-376 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-377 (Fdisplay_supports_face_attributes_p): Work around bootstrapping problem * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-378 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-380 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-381 Face merging cleanups * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-382 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-384 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-385 src/xfaces.c (push_named_merge_point): Return 0 if a cycle is detected * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-386 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-395 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-396 Tweak arch tagging to make build/install-in-place less annoying * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-397 Work around vc-arch problems when building eshell * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-398 Tweak permissions * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-399 Tweak directory permissions * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-400 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-401 More build-in-place tweaking of arch tagging * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-402 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-403 Yet more build-in-place tweaking of arch tagging * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-404 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-409 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-410 Make sure image types are initialized for lookup too * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-411 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-416 Update from CVS
author Miles Bader <miles@gnu.org>
date Mon, 28 Jun 2004 07:56:49 +0000
parents 68c22ea6027c 4cea1f00f7bb
children 6f6e9fe4658b
comparison
equal deleted inserted replaced
89942:9cb747ae49af 89943:4c90ffeb71c5
38 #include <string.h> /* for bzero and string functions */ 38 #include <string.h> /* for bzero and string functions */
39 #include <sys/stat.h> /* for _fixpath */ 39 #include <sys/stat.h> /* for _fixpath */
40 #include <unistd.h> /* for chdir, dup, dup2, etc. */ 40 #include <unistd.h> /* for chdir, dup, dup2, etc. */
41 #include <dir.h> /* for getdisk */ 41 #include <dir.h> /* for getdisk */
42 #if __DJGPP__ >= 2 42 #if __DJGPP__ >= 2
43 #pragma pack(0) /* dir.h does a pack(4), which isn't GCC's default */
43 #include <fcntl.h> 44 #include <fcntl.h>
44 #include <io.h> /* for setmode */ 45 #include <io.h> /* for setmode */
45 #include <dpmi.h> /* for __dpmi_xxx stuff */ 46 #include <dpmi.h> /* for __dpmi_xxx stuff */
46 #include <sys/farptr.h> /* for _farsetsel, _farnspokeb */ 47 #include <sys/farptr.h> /* for _farsetsel, _farnspokeb */
47 #include <libc/dosio.h> /* for _USE_LFN */ 48 #include <libc/dosio.h> /* for _USE_LFN */
948 949
949 static void 950 static void
950 IT_write_glyphs (struct glyph *str, int str_len) 951 IT_write_glyphs (struct glyph *str, int str_len)
951 { 952 {
952 unsigned char *screen_buf, *screen_bp, *screen_buf_end, *bp; 953 unsigned char *screen_buf, *screen_bp, *screen_buf_end, *bp;
953 int unsupported_face = FAST_GLYPH_FACE (Vdos_unsupported_char_glyph); 954 int unsupported_face = 0;
954 unsigned unsupported_char= FAST_GLYPH_CHAR (Vdos_unsupported_char_glyph); 955 unsigned unsupported_char = '\177';
955 int offset = 2 * (new_pos_X + screen_size_X * new_pos_Y); 956 int offset = 2 * (new_pos_X + screen_size_X * new_pos_Y);
956 register int sl = str_len; 957 register int sl = str_len;
957 register int tlen = GLYPH_TABLE_LENGTH; 958 register int tlen = GLYPH_TABLE_LENGTH;
958 register Lisp_Object *tbase = GLYPH_TABLE_BASE; 959 register Lisp_Object *tbase = GLYPH_TABLE_BASE;
959 960
974 975
975 unsigned char conversion_buffer[256]; 976 unsigned char conversion_buffer[256];
976 int conversion_buffer_size = sizeof conversion_buffer; 977 int conversion_buffer_size = sizeof conversion_buffer;
977 978
978 if (str_len <= 0) return; 979 if (str_len <= 0) return;
980
981 /* Set up the unsupported character glyph */
982 if (!NILP (Vdos_unsupported_char_glyph))
983 {
984 unsupported_char = FAST_GLYPH_CHAR (XINT (Vdos_unsupported_char_glyph));
985 unsupported_face = FAST_GLYPH_FACE (XINT (Vdos_unsupported_char_glyph));
986 }
979 987
980 screen_buf = screen_bp = alloca (str_len * 2); 988 screen_buf = screen_bp = alloca (str_len * 2);
981 screen_buf_end = screen_buf + str_len * 2; 989 screen_buf_end = screen_buf + str_len * 2;
982 sf = SELECTED_FRAME(); 990 sf = SELECTED_FRAME();
983 991
1039 1047
1040 /* Invalid characters are displayed with a special glyph. */ 1048 /* Invalid characters are displayed with a special glyph. */
1041 if (! CHAR_VALID_P (ch, 0)) 1049 if (! CHAR_VALID_P (ch, 0))
1042 { 1050 {
1043 g = !NILP (Vdos_unsupported_char_glyph) 1051 g = !NILP (Vdos_unsupported_char_glyph)
1044 ? Vdos_unsupported_char_glyph 1052 ? XINT (Vdos_unsupported_char_glyph)
1045 : MAKE_GLYPH (sf, '\177', GLYPH_FACE (sf, g)); 1053 : MAKE_GLYPH (sf, '\177', GLYPH_FACE (sf, g));
1046 ch = FAST_GLYPH_CHAR (g); 1054 ch = FAST_GLYPH_CHAR (g);
1047 } 1055 }
1048 1056
1049 /* If the face of this glyph is different from the current 1057 /* If the face of this glyph is different from the current
1569 1577
1570 /* Check for mouse-face and help-echo. */ 1578 /* Check for mouse-face and help-echo. */
1571 { 1579 {
1572 extern Lisp_Object Qmouse_face; 1580 extern Lisp_Object Qmouse_face;
1573 Lisp_Object mouse_face, overlay, position, *overlay_vec; 1581 Lisp_Object mouse_face, overlay, position, *overlay_vec;
1574 int len, noverlays, obegv, ozv;; 1582 int noverlays, obegv, ozv;;
1575 struct buffer *obuf; 1583 struct buffer *obuf;
1576 1584
1577 /* If we get an out-of-range value, return now; avoid an error. */ 1585 /* If we get an out-of-range value, return now; avoid an error. */
1578 if (pos > BUF_Z (XBUFFER (w->buffer))) 1586 if (pos > BUF_Z (XBUFFER (w->buffer)))
1579 return; 1587 return;
1588 ZV = Z; 1596 ZV = Z;
1589 1597
1590 /* Is this char mouse-active or does it have help-echo? */ 1598 /* Is this char mouse-active or does it have help-echo? */
1591 XSETINT (position, pos); 1599 XSETINT (position, pos);
1592 1600
1593 /* Put all the overlays we want in a vector in overlay_vec. 1601 /* Put all the overlays we want in a vector in overlay_vec. */
1594 Store the length in len. If there are more than 10, make 1602 GET_OVERLAYS_AT (pos, overlay_vec, noverlays, NULL, 0);
1595 enough space for all, and try again. */
1596 len = 10;
1597 overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object));
1598 noverlays = overlays_at (pos, 0, &overlay_vec, &len, NULL, NULL, 0);
1599 if (noverlays > len)
1600 {
1601 len = noverlays;
1602 overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object));
1603 noverlays = overlays_at (pos,
1604 0, &overlay_vec, &len, NULL, NULL, 0);
1605 }
1606
1607 /* Sort overlays into increasing priority order. */ 1603 /* Sort overlays into increasing priority order. */
1608 noverlays = sort_overlays (overlay_vec, noverlays, w); 1604 noverlays = sort_overlays (overlay_vec, noverlays, w);
1609 1605
1610 /* Check mouse-face highlighting. */ 1606 /* Check mouse-face highlighting. */
1611 if (! (EQ (window, dpyinfo->mouse_face_window) 1607 if (! (EQ (window, dpyinfo->mouse_face_window)
4406 will break on DOS/Windows. Refuse to work if we cannot find 4402 will break on DOS/Windows. Refuse to work if we cannot find
4407 a directory, not even "c:/", usable for that purpose. */ 4403 a directory, not even "c:/", usable for that purpose. */
4408 for (i = 0; i < imax ; i++) 4404 for (i = 0; i < imax ; i++)
4409 { 4405 {
4410 const char *tmp = tempdirs[i]; 4406 const char *tmp = tempdirs[i];
4407 char buf[FILENAME_MAX];
4411 4408
4412 if (*tmp == '$') 4409 if (*tmp == '$')
4413 tmp = getenv (tmp + 1); 4410 {
4411 int tmp_len;
4412
4413 tmp = getenv (tmp + 1);
4414 if (!tmp)
4415 continue;
4416
4417 /* Some lusers set TMPDIR=e:, probably because some losing
4418 programs cannot handle multiple slashes if they use e:/.
4419 e: fails in `access' below, so we interpret e: as e:/. */
4420 tmp_len = strlen(tmp);
4421 if (tmp[tmp_len - 1] != '/' && tmp[tmp_len - 1] != '\\')
4422 {
4423 strcpy(buf, tmp);
4424 buf[tmp_len++] = '/', buf[tmp_len] = 0;
4425 tmp = buf;
4426 }
4427 }
4428
4414 /* Note that `access' can lie to us if the directory resides on a 4429 /* Note that `access' can lie to us if the directory resides on a
4415 read-only filesystem, like CD-ROM or a write-protected floppy. 4430 read-only filesystem, like CD-ROM or a write-protected floppy.
4416 The only way to be really sure is to actually create a file and 4431 The only way to be really sure is to actually create a file and
4417 see if it succeeds. But I think that's too much to ask. */ 4432 see if it succeeds. But I think that's too much to ask. */
4418 if (tmp && access (tmp, D_OK) == 0) 4433 if (tmp && access (tmp, D_OK) == 0)
5270 staticpro (&Qreverse); 5285 staticpro (&Qreverse);
5271 5286
5272 DEFVAR_LISP ("dos-unsupported-char-glyph", &Vdos_unsupported_char_glyph, 5287 DEFVAR_LISP ("dos-unsupported-char-glyph", &Vdos_unsupported_char_glyph,
5273 doc: /* *Glyph to display instead of chars not supported by current codepage. 5288 doc: /* *Glyph to display instead of chars not supported by current codepage.
5274 This variable is used only by MSDOS terminals. */); 5289 This variable is used only by MSDOS terminals. */);
5275 Vdos_unsupported_char_glyph = '\177'; 5290 Vdos_unsupported_char_glyph = make_number ('\177');
5276 5291
5277 #endif 5292 #endif
5278 #ifndef subprocesses 5293 #ifndef subprocesses
5279 DEFVAR_BOOL ("delete-exited-processes", &delete_exited_processes, 5294 DEFVAR_BOOL ("delete-exited-processes", &delete_exited_processes,
5280 doc: /* *Non-nil means delete processes immediately when they exit. 5295 doc: /* *Non-nil means delete processes immediately when they exit.