aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2004-05-22 22:52:43 +0000
committerKaroly Lorentey2004-05-22 22:52:43 +0000
commit04a0dc45e1e3833a3a97e45f2b20197c8bec744a (patch)
treeaf6a98682fc8bd24be22340137e489a0796c9eed /src
parentf3c9434fad0ae6dfcadf44292df1472a402b5738 (diff)
parent47ff5b284043393f79f231f0c6bd005a542721cb (diff)
downloademacs-04a0dc45e1e3833a3a97e45f2b20197c8bec744a.tar.gz
emacs-04a0dc45e1e3833a3a97e45f2b20197c8bec744a.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-325 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-326 Update from CVS * 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 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-166
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit14
-rw-r--r--src/ChangeLog49
-rw-r--r--src/print.c3
-rw-r--r--src/regex.c132
-rw-r--r--src/search.c2
-rw-r--r--src/w32console.c124
-rw-r--r--src/w32fns.c4
-rw-r--r--src/w32menu.c14
-rw-r--r--src/w32proc.c4
-rw-r--r--src/w32term.h6
10 files changed, 270 insertions, 82 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index c976d3633de..3af7e369923 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -186,9 +186,10 @@ Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value
186end 186end
187 187
188define xsymbol 188define xsymbol
189 xgetptr $ 189 set $sym = $
190 xgetptr $sym
190 print (struct Lisp_Symbol *) $ptr 191 print (struct Lisp_Symbol *) $ptr
191 xprintsym $ 192 xprintsym $sym
192 echo \n 193 echo \n
193end 194end
194document xsymbol 195document xsymbol
@@ -199,7 +200,7 @@ end
199define xstring 200define xstring
200 xgetptr $ 201 xgetptr $
201 print (struct Lisp_String *) $ptr 202 print (struct Lisp_String *) $ptr
202 output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size & ~gdb_array_mark_flag : $->size_byte) 203 xprintstr $
203 echo \n 204 echo \n
204end 205end
205document xstring 206document xstring
@@ -372,12 +373,17 @@ document xscrollbar
372Print $ as a scrollbar pointer. 373Print $ as a scrollbar pointer.
373end 374end
374 375
376define xprintstr
377 set $data = $arg0->data
378 output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte)
379end
380
375define xprintsym 381define xprintsym
376 xgetptr $arg0 382 xgetptr $arg0
377 set $sym = (struct Lisp_Symbol *) $ptr 383 set $sym = (struct Lisp_Symbol *) $ptr
378 xgetptr $sym->xname 384 xgetptr $sym->xname
379 set $sym_name = (struct Lisp_String *) $ptr 385 set $sym_name = (struct Lisp_String *) $ptr
380 output ($sym_name->data[0])@($sym_name->size_byte < 0 ? $sym_name->size & ~gdb_array_mark_flag : $sym_name->size_byte) 386 xprintstr $sym_name
381end 387end
382document xprintsym 388document xprintsym
383 Print argument as a symbol. 389 Print argument as a symbol.
diff --git a/src/ChangeLog b/src/ChangeLog
index 7425754e042..c1f0706b928 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,47 @@
12004-05-19 Jim Blandy <jimb@redhat.com>
2
3 Add support for new '\_<' and '\_>' regexp operators, matching the
4 beginning and ends of symbols.
5 * regex.c (enum syntaxcode): Add Ssymbol.
6 (init_syntax_once): Set the syntax for '_' to Ssymbol, not Sword.
7 (re_opcode_t): New opcodes `symbeg' and `symend'.
8 (print_partial_compiled_pattern): Print the new opcodes properly.
9 (regex_compile): Parse the new operators.
10 (analyse_first): Skip symbeg and symend (they match only the empty string).
11 (mutually_exclusive_p): `symend' is mutually exclusive with \s_ and
12 \sw; `symbeg' is mutually exclusive with \S_ and \Sw.
13 (re_match_2_internal): Match symbeg and symend.
14
15 * search.c (trivial_regexp_p): \_ is no longer a trivial regexp.
16
172004-05-19 Kim F. Storm <storm@cua.dk>
18
19 * .gdbinit (xsymbol): Fix last change.
20
212004-05-18 Stefan Monnier <monnier@iro.umontreal.ca>
22
23 * .gdbinit (xprintstr): New fun.
24 (xstring, xprintsym): Use it.
25
26 * w32proc.c (create_child): Use INTMASK.
27
28 * alloc.c (Fgarbage_collect): Do all the marking before flushing
29 unmarked elements of the undo list.
30
312004-05-18 David Ponce <david@dponce.com>
32
33 * print.c (print): Reset print_depth before to call print_object.
34
352004-05-18 Jason Rumney <jasonr@gnu.org>
36
37 * w32console.c: Prefix RIF functions with w32con_ to avoid
38 namespace clash with functions in term.c and w32term.c.
39
40 * w32menu.c (add_menu_item, w32_menu_display_help)
41 [USE_LISP_UNION_TYPE]: Cast from Lisp_Object using i member.
42
43 * w32term.h (display_x_get_resource, vga_stdcolor_name): Add prototype.
44
12004-05-18 Eli Zaretskii <eliz@gnu.org> 452004-05-18 Eli Zaretskii <eliz@gnu.org>
2 46
3 * lisp.h (DECL_ALIGN): Remove restriction on MS-DOS systems. 47 * lisp.h (DECL_ALIGN): Remove restriction on MS-DOS systems.
@@ -97,12 +141,16 @@
97 section to frame.c section. 141 section to frame.c section.
98 (Fxw_display_color_p, Fx_file_dialog): Declare if 142 (Fxw_display_color_p, Fx_file_dialog): Declare if
99 HAVE_WINDOW_SYSTEM defined. 143 HAVE_WINDOW_SYSTEM defined.
144
100 * macfns.c (Fx_create_frame): Fix int/Lisp_Object mixup. 145 * macfns.c (Fx_create_frame): Fix int/Lisp_Object mixup.
146
101 * macmenu.c (set_frame_menubar): Use NILP to test a lisp value. 147 * macmenu.c (set_frame_menubar): Use NILP to test a lisp value.
148
102 * macterm.c (mac_get_emulated_btn, mac_event_to_emacs_modifiers) 149 * macterm.c (mac_get_emulated_btn, mac_event_to_emacs_modifiers)
103 (mac_get_mouse_btn): Use NILP and EQ to test/compare lisp values. 150 (mac_get_mouse_btn): Use NILP and EQ to test/compare lisp values.
104 (XTread_socket): Fix int/Lisp_Object mixup. 151 (XTread_socket): Fix int/Lisp_Object mixup.
105 (mac_check_for_quit_char): Fix pointer/Lisp_Object mixup. 152 (mac_check_for_quit_char): Fix pointer/Lisp_Object mixup.
153
106 * macterm.h (struct frame, struct face, struct image) 154 * macterm.h (struct frame, struct face, struct image)
107 (display_x_get_resource, Fx_display_color_p) 155 (display_x_get_resource, Fx_display_color_p)
108 (Fx_display_grayscale_p, Fx_display_planes, x_free_gcs): 156 (Fx_display_grayscale_p, Fx_display_planes, x_free_gcs):
@@ -246,6 +294,7 @@
246 around call to ReceiveEvent to avoid certain crashes. 294 around call to ReceiveEvent to avoid certain crashes.
247 295
2482004-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 2962004-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
297
249 * macterm.c (mac_draw_line_to_pixmap, XCreatePixmapFromBitmapData) 298 * macterm.c (mac_draw_line_to_pixmap, XCreatePixmapFromBitmapData)
250 (mac_fill_rectangle_to_pixmap, mac_draw_rectangle_to_pixmap) 299 (mac_fill_rectangle_to_pixmap, mac_draw_rectangle_to_pixmap)
251 (mac_copy_area_to_pixmap, mac_copy_area_with_mask_to_pixmap): 300 (mac_copy_area_to_pixmap, mac_copy_area_with_mask_to_pixmap):
diff --git a/src/print.c b/src/print.c
index 74f8fad8d15..0e07cd6fdd3 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1220,7 +1220,6 @@ print (obj, printcharfun, escapeflag)
1220 register Lisp_Object printcharfun; 1220 register Lisp_Object printcharfun;
1221 int escapeflag; 1221 int escapeflag;
1222{ 1222{
1223 print_depth = 0;
1224 old_backquote_output = 0; 1223 old_backquote_output = 0;
1225 1224
1226 /* Reset print_number_index and Vprint_number_table only when 1225 /* Reset print_number_index and Vprint_number_table only when
@@ -1240,6 +1239,7 @@ print (obj, printcharfun, escapeflag)
1240 start = index = print_number_index; 1239 start = index = print_number_index;
1241 /* Construct Vprint_number_table. 1240 /* Construct Vprint_number_table.
1242 This increments print_number_index for the objects added. */ 1241 This increments print_number_index for the objects added. */
1242 print_depth = 0;
1243 print_preprocess (obj); 1243 print_preprocess (obj);
1244 1244
1245 /* Remove unnecessary objects, which appear only once in OBJ; 1245 /* Remove unnecessary objects, which appear only once in OBJ;
@@ -1264,6 +1264,7 @@ print (obj, printcharfun, escapeflag)
1264 print_number_index = index; 1264 print_number_index = index;
1265 } 1265 }
1266 1266
1267 print_depth = 0;
1267 print_object (obj, printcharfun, escapeflag); 1268 print_object (obj, printcharfun, escapeflag);
1268} 1269}
1269 1270
diff --git a/src/regex.c b/src/regex.c
index a518ef81a0c..0c1343bf584 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -2,7 +2,7 @@
2 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the 2 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the
3 internationalization features.) 3 internationalization features.)
4 4
5 Copyright (C) 1993,94,95,96,97,98,99,2000 Free Software Foundation, Inc. 5 Copyright (C) 1993,94,95,96,97,98,99,2000,04 Free Software Foundation, Inc.
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
@@ -217,7 +217,7 @@ char *realloc ();
217/* Define the syntax stuff for \<, \>, etc. */ 217/* Define the syntax stuff for \<, \>, etc. */
218 218
219/* Sword must be nonzero for the wordchar pattern commands in re_match_2. */ 219/* Sword must be nonzero for the wordchar pattern commands in re_match_2. */
220enum syntaxcode { Swhitespace = 0, Sword = 1 }; 220enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
221 221
222# ifdef SWITCH_ENUM_BUG 222# ifdef SWITCH_ENUM_BUG
223# define SWITCH_ENUM_CAST(x) ((int)(x)) 223# define SWITCH_ENUM_CAST(x) ((int)(x))
@@ -398,7 +398,7 @@ init_syntax_once ()
398 if (ISALNUM (c)) 398 if (ISALNUM (c))
399 re_syntax_table[c] = Sword; 399 re_syntax_table[c] = Sword;
400 400
401 re_syntax_table['_'] = Sword; 401 re_syntax_table['_'] = Ssymbol;
402 402
403 done = 1; 403 done = 1;
404} 404}
@@ -655,6 +655,9 @@ typedef enum
655 wordbound, /* Succeeds if at a word boundary. */ 655 wordbound, /* Succeeds if at a word boundary. */
656 notwordbound, /* Succeeds if not at a word boundary. */ 656 notwordbound, /* Succeeds if not at a word boundary. */
657 657
658 symbeg, /* Succeeds if at symbol beginning. */
659 symend, /* Succeeds if at symbol end. */
660
658 /* Matches any character whose syntax is specified. Followed by 661 /* Matches any character whose syntax is specified. Followed by
659 a byte which contains a syntax code, e.g., Sword. */ 662 a byte which contains a syntax code, e.g., Sword. */
660 syntaxspec, 663 syntaxspec,
@@ -1094,6 +1097,14 @@ print_partial_compiled_pattern (start, end)
1094 case wordend: 1097 case wordend:
1095 fprintf (stderr, "/wordend"); 1098 fprintf (stderr, "/wordend");
1096 1099
1100 case symbeg:
1101 printf ("/symbeg");
1102 break;
1103
1104 case symend:
1105 printf ("/symend");
1106 break;
1107
1097 case syntaxspec: 1108 case syntaxspec:
1098 fprintf (stderr, "/syntaxspec"); 1109 fprintf (stderr, "/syntaxspec");
1099 mcnt = *p++; 1110 mcnt = *p++;
@@ -3398,6 +3409,19 @@ regex_compile (pattern, size, syntax, bufp)
3398 BUF_PUSH (wordend); 3409 BUF_PUSH (wordend);
3399 break; 3410 break;
3400 3411
3412 case '_':
3413 if (syntax & RE_NO_GNU_OPS)
3414 goto normal_char;
3415 laststart = b;
3416 PATFETCH (c);
3417 if (c == '<')
3418 BUF_PUSH (symbeg);
3419 else if (c == '>')
3420 BUF_PUSH (symend);
3421 else
3422 FREE_STACK_RETURN (REG_BADPAT);
3423 break;
3424
3401 case 'b': 3425 case 'b':
3402 if (syntax & RE_NO_GNU_OPS) 3426 if (syntax & RE_NO_GNU_OPS)
3403 goto normal_char; 3427 goto normal_char;
@@ -3890,6 +3914,8 @@ analyse_first (p, pend, fastmap, multibyte)
3890 case notwordbound: 3914 case notwordbound:
3891 case wordbeg: 3915 case wordbeg:
3892 case wordend: 3916 case wordend:
3917 case symbeg:
3918 case symend:
3893 continue; 3919 continue;
3894 3920
3895 3921
@@ -4654,14 +4680,20 @@ mutually_exclusive_p (bufp, p1, p2)
4654 break; 4680 break;
4655 4681
4656 case wordend: 4682 case wordend:
4657 case notsyntaxspec: 4683 return ((re_opcode_t) *p1 == syntaxspec && p1[1] == Sword);
4684 case symend:
4658 return ((re_opcode_t) *p1 == syntaxspec 4685 return ((re_opcode_t) *p1 == syntaxspec
4659 && p1[1] == (op2 == wordend ? Sword : p2[1])); 4686 && (p1[1] == Ssymbol || p1[1] == Sword));
4687 case notsyntaxspec:
4688 return ((re_opcode_t) *p1 == syntaxspec && p1[1] == p2[1]);
4660 4689
4661 case wordbeg: 4690 case wordbeg:
4662 case syntaxspec: 4691 return ((re_opcode_t) *p1 == notsyntaxspec && p1[1] == Sword);
4692 case symbeg:
4663 return ((re_opcode_t) *p1 == notsyntaxspec 4693 return ((re_opcode_t) *p1 == notsyntaxspec
4664 && p1[1] == (op2 == wordbeg ? Sword : p2[1])); 4694 && (p1[1] == Ssymbol || p1[1] == Sword));
4695 case syntaxspec:
4696 return ((re_opcode_t) *p1 == notsyntaxspec && p1[1] == p2[1]);
4665 4697
4666 case wordbound: 4698 case wordbound:
4667 return (((re_opcode_t) *p1 == notsyntaxspec 4699 return (((re_opcode_t) *p1 == notsyntaxspec
@@ -5803,6 +5835,92 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
5803 } 5835 }
5804 break; 5836 break;
5805 5837
5838 case symbeg:
5839 DEBUG_PRINT1 ("EXECUTING symbeg.\n");
5840
5841 /* We FAIL in one of the following cases: */
5842
5843 /* Case 1: D is at the end of string. */
5844 if (AT_STRINGS_END (d))
5845 goto fail;
5846 else
5847 {
5848 /* C1 is the character before D, S1 is the syntax of C1, C2
5849 is the character at D, and S2 is the syntax of C2. */
5850 re_wchar_t c1, c2;
5851 int s1, s2;
5852#ifdef emacs
5853 int offset = PTR_TO_OFFSET (d);
5854 int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset);
5855 UPDATE_SYNTAX_TABLE (charpos);
5856#endif
5857 PREFETCH ();
5858 c2 = RE_STRING_CHAR (d, dend - d);
5859 s2 = SYNTAX (c2);
5860
5861 /* Case 2: S2 is neither Sword nor Ssymbol. */
5862 if (s2 != Sword && s2 != Ssymbol)
5863 goto fail;
5864
5865 /* Case 3: D is not at the beginning of string ... */
5866 if (!AT_STRINGS_BEG (d))
5867 {
5868 GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2);
5869#ifdef emacs
5870 UPDATE_SYNTAX_TABLE_BACKWARD (charpos - 1);
5871#endif
5872 s1 = SYNTAX (c1);
5873
5874 /* ... and S1 is Sword or Ssymbol. */
5875 if (s1 == Sword || s1 == Ssymbol)
5876 goto fail;
5877 }
5878 }
5879 break;
5880
5881 case symend:
5882 DEBUG_PRINT1 ("EXECUTING symend.\n");
5883
5884 /* We FAIL in one of the following cases: */
5885
5886 /* Case 1: D is at the beginning of string. */
5887 if (AT_STRINGS_BEG (d))
5888 goto fail;
5889 else
5890 {
5891 /* C1 is the character before D, S1 is the syntax of C1, C2
5892 is the character at D, and S2 is the syntax of C2. */
5893 re_wchar_t c1, c2;
5894 int s1, s2;
5895#ifdef emacs
5896 int offset = PTR_TO_OFFSET (d) - 1;
5897 int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset);
5898 UPDATE_SYNTAX_TABLE (charpos);
5899#endif
5900 GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2);
5901 s1 = SYNTAX (c1);
5902
5903 /* Case 2: S1 is neither Ssymbol nor Sword. */
5904 if (s1 != Sword && s1 != Ssymbol)
5905 goto fail;
5906
5907 /* Case 3: D is not at the end of string ... */
5908 if (!AT_STRINGS_END (d))
5909 {
5910 PREFETCH_NOLIMIT ();
5911 c2 = RE_STRING_CHAR (d, dend - d);
5912#ifdef emacs
5913 UPDATE_SYNTAX_TABLE_FORWARD (charpos);
5914#endif
5915 s2 = SYNTAX (c2);
5916
5917 /* ... and S2 is Sword or Ssymbol. */
5918 if (s2 == Sword || s2 == Ssymbol)
5919 goto fail;
5920 }
5921 }
5922 break;
5923
5806 case syntaxspec: 5924 case syntaxspec:
5807 case notsyntaxspec: 5925 case notsyntaxspec:
5808 not = (re_opcode_t) *(p - 1) == notsyntaxspec; 5926 not = (re_opcode_t) *(p - 1) == notsyntaxspec;
diff --git a/src/search.c b/src/search.c
index c60d68b9374..e5e4c3f867a 100644
--- a/src/search.c
+++ b/src/search.c
@@ -957,7 +957,7 @@ trivial_regexp_p (regexp)
957 { 957 {
958 case '|': case '(': case ')': case '`': case '\'': case 'b': 958 case '|': case '(': case ')': case '`': case '\'': case 'b':
959 case 'B': case '<': case '>': case 'w': case 'W': case 's': 959 case 'B': case '<': case '>': case 'w': case 'W': case 's':
960 case 'S': case '=': case '{': case '}': 960 case 'S': case '=': case '{': case '}': case '_':
961 case 'c': case 'C': /* for categoryspec and notcategoryspec */ 961 case 'c': case 'C': /* for categoryspec and notcategoryspec */
962 case '1': case '2': case '3': case '4': case '5': 962 case '1': case '2': case '3': case '4': case '5':
963 case '6': case '7': case '8': case '9': 963 case '6': case '7': case '8': case '9':
diff --git a/src/w32console.c b/src/w32console.c
index b2d340d579c..74a8fd6338e 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -53,20 +53,20 @@ extern int read_input_pending ();
53extern struct frame * updating_frame; 53extern struct frame * updating_frame;
54extern int meta_key; 54extern int meta_key;
55 55
56static void move_cursor (int row, int col); 56static void w32con_move_cursor (int row, int col);
57static void clear_to_end (void); 57static void w32con_clear_to_end (void);
58void clear_frame (void); 58static void w32con_clear_frame (void);
59void clear_end_of_line (int); 59static void w32con_clear_end_of_line (int);
60static void ins_del_lines (int vpos, int n); 60static void w32con_ins_del_lines (int vpos, int n);
61void insert_glyphs (struct glyph *start, int len); 61static void w32con_insert_glyphs (struct glyph *start, int len);
62void write_glyphs (struct glyph *string, int len); 62static void w32con_write_glyphs (struct glyph *string, int len);
63void delete_glyphs (int n); 63static void w32con_delete_glyphs (int n);
64void w32_sys_ring_bell (void); 64void w32_sys_ring_bell (void);
65void reset_terminal_modes (void); 65static void w32con_reset_terminal_modes (void);
66void set_terminal_modes (void); 66static void w32con_set_terminal_modes (void);
67void set_terminal_window (int size); 67static void w32con_set_terminal_window (int size);
68void update_begin (struct frame * f); 68static void w32con_update_begin (struct frame * f);
69void update_end (struct frame * f); 69static void w32con_update_end (struct frame * f);
70static WORD w32_face_attributes (struct frame *f, int face_id); 70static WORD w32_face_attributes (struct frame *f, int face_id);
71 71
72static COORD cursor_coords; 72static COORD cursor_coords;
@@ -104,7 +104,7 @@ ctrl_c_handler (unsigned long type)
104 104
105/* Move the cursor to (row, col). */ 105/* Move the cursor to (row, col). */
106static void 106static void
107move_cursor (int row, int col) 107w32con_move_cursor (int row, int col)
108{ 108{
109 cursor_coords.X = col; 109 cursor_coords.X = col;
110 cursor_coords.Y = row; 110 cursor_coords.Y = row;
@@ -117,17 +117,17 @@ move_cursor (int row, int col)
117 117
118/* Clear from cursor to end of screen. */ 118/* Clear from cursor to end of screen. */
119static void 119static void
120clear_to_end (void) 120w32con_clear_to_end (void)
121{ 121{
122 struct frame * f = PICK_FRAME (); 122 struct frame * f = PICK_FRAME ();
123 123
124 clear_end_of_line (FRAME_COLS (f) - 1); 124 w32con_clear_end_of_line (FRAME_COLS (f) - 1);
125 ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); 125 w32con_ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1);
126} 126}
127 127
128/* Clear the frame. */ 128/* Clear the frame. */
129void 129static void
130clear_frame (void) 130w32con_clear_frame (void)
131{ 131{
132 struct frame * f = PICK_FRAME (); 132 struct frame * f = PICK_FRAME ();
133 COORD dest; 133 COORD dest;
@@ -144,7 +144,7 @@ clear_frame (void)
144 FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r); 144 FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r);
145 FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r); 145 FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r);
146 146
147 move_cursor (0, 0); 147 w32con_move_cursor (0, 0);
148} 148}
149 149
150 150
@@ -152,8 +152,8 @@ static struct glyph glyph_base[256];
152static BOOL ceol_initialized = FALSE; 152static BOOL ceol_initialized = FALSE;
153 153
154/* Clear from Cursor to end (what's "standout marker"?). */ 154/* Clear from Cursor to end (what's "standout marker"?). */
155void 155static void
156clear_end_of_line (int end) 156w32con_clear_end_of_line (int end)
157{ 157{
158 if (!ceol_initialized) 158 if (!ceol_initialized)
159 { 159 {
@@ -164,12 +164,12 @@ clear_end_of_line (int end)
164 } 164 }
165 ceol_initialized = TRUE; 165 ceol_initialized = TRUE;
166 } 166 }
167 write_glyphs (glyph_base, end - cursor_coords.X); /* fencepost ? */ 167 w32con_write_glyphs (glyph_base, end - cursor_coords.X); /* fencepost ? */
168} 168}
169 169
170/* Insert n lines at vpos. if n is negative delete -n lines. */ 170/* Insert n lines at vpos. if n is negative delete -n lines. */
171void 171static void
172ins_del_lines (int vpos, int n) 172w32con_ins_del_lines (int vpos, int n)
173{ 173{
174 int i, nb; 174 int i, nb;
175 SMALL_RECT scroll; 175 SMALL_RECT scroll;
@@ -212,8 +212,8 @@ ins_del_lines (int vpos, int n)
212 { 212 {
213 for (i = scroll.Bottom; i < dest.Y; i++) 213 for (i = scroll.Bottom; i < dest.Y; i++)
214 { 214 {
215 move_cursor (i, 0); 215 w32con_move_cursor (i, 0);
216 clear_end_of_line (FRAME_COLS (f)); 216 w32con_clear_end_of_line (FRAME_COLS (f));
217 } 217 }
218 } 218 }
219 } 219 }
@@ -225,8 +225,8 @@ ins_del_lines (int vpos, int n)
225 { 225 {
226 for (i = nb; i < scroll.Top; i++) 226 for (i = nb; i < scroll.Top; i++)
227 { 227 {
228 move_cursor (i, 0); 228 w32con_move_cursor (i, 0);
229 clear_end_of_line (FRAME_COLS (f)); 229 w32con_clear_end_of_line (FRAME_COLS (f));
230 } 230 }
231 } 231 }
232 } 232 }
@@ -275,8 +275,8 @@ scroll_line (int dist, int direction)
275 275
276 276
277/* If start is zero insert blanks instead of a string at start ?. */ 277/* If start is zero insert blanks instead of a string at start ?. */
278void 278static void
279insert_glyphs (register struct glyph *start, register int len) 279w32con_insert_glyphs (register struct glyph *start, register int len)
280{ 280{
281 scroll_line (len, RIGHT); 281 scroll_line (len, RIGHT);
282 282
@@ -286,16 +286,16 @@ insert_glyphs (register struct glyph *start, register int len)
286 /* Print the first len characters of start, cursor_coords.X adjusted 286 /* Print the first len characters of start, cursor_coords.X adjusted
287 by write_glyphs. */ 287 by write_glyphs. */
288 288
289 write_glyphs (start, len); 289 w32con_write_glyphs (start, len);
290 } 290 }
291 else 291 else
292 { 292 {
293 clear_end_of_line (cursor_coords.X + len); 293 w32con_clear_end_of_line (cursor_coords.X + len);
294 } 294 }
295} 295}
296 296
297void 297static void
298write_glyphs (register struct glyph *string, register int len) 298w32con_write_glyphs (register struct glyph *string, register int len)
299{ 299{
300 int produced, consumed; 300 int produced, consumed;
301 DWORD r; 301 DWORD r;
@@ -353,7 +353,7 @@ write_glyphs (register struct glyph *string, register int len)
353 } 353 }
354 354
355 cursor_coords.X += produced; 355 cursor_coords.X += produced;
356 move_cursor (cursor_coords.Y, cursor_coords.X); 356 w32con_move_cursor (cursor_coords.Y, cursor_coords.X);
357 } 357 }
358 len -= consumed; 358 len -= consumed;
359 n -= consumed; 359 n -= consumed;
@@ -391,8 +391,8 @@ write_glyphs (register struct glyph *string, register int len)
391} 391}
392 392
393 393
394void 394static void
395delete_glyphs (int n) 395w32con_delete_glyphs (int n)
396{ 396{
397 /* delete chars means scroll chars from cursor_coords.X + n to 397 /* delete chars means scroll chars from cursor_coords.X + n to
398 cursor_coords.X, anything beyond the edge of the screen should 398 cursor_coords.X, anything beyond the edge of the screen should
@@ -450,8 +450,8 @@ SOUND is nil to use the normal beep. */)
450 return sound; 450 return sound;
451} 451}
452 452
453void 453static void
454reset_terminal_modes (void) 454w32con_reset_terminal_modes (void)
455{ 455{
456#ifdef USE_SEPARATE_SCREEN 456#ifdef USE_SEPARATE_SCREEN
457 SetConsoleActiveScreenBuffer (prev_screen); 457 SetConsoleActiveScreenBuffer (prev_screen);
@@ -461,8 +461,8 @@ reset_terminal_modes (void)
461 SetConsoleMode (keyboard_handle, prev_console_mode); 461 SetConsoleMode (keyboard_handle, prev_console_mode);
462} 462}
463 463
464void 464static void
465set_terminal_modes (void) 465w32con_set_terminal_modes (void)
466{ 466{
467 CONSOLE_CURSOR_INFO cci; 467 CONSOLE_CURSOR_INFO cci;
468 468
@@ -484,19 +484,19 @@ set_terminal_modes (void)
484 clumps rather than one-character-at-a-time... 484 clumps rather than one-character-at-a-time...
485 485
486 we'll start with not moving the cursor while an update is in progress. */ 486 we'll start with not moving the cursor while an update is in progress. */
487void 487static void
488update_begin (struct frame * f) 488w32con_update_begin (struct frame * f)
489{ 489{
490} 490}
491 491
492void 492static void
493update_end (struct frame * f) 493w32con_update_end (struct frame * f)
494{ 494{
495 SetConsoleCursorPosition (cur_screen, cursor_coords); 495 SetConsoleCursorPosition (cur_screen, cursor_coords);
496} 496}
497 497
498void 498static void
499set_terminal_window (int size) 499w32con_set_terminal_window (int size)
500{ 500{
501} 501}
502 502
@@ -574,21 +574,21 @@ initialize_w32_display (void)
574{ 574{
575 CONSOLE_SCREEN_BUFFER_INFO info; 575 CONSOLE_SCREEN_BUFFER_INFO info;
576 576
577 cursor_to_hook = move_cursor; 577 cursor_to_hook = w32con_move_cursor;
578 raw_cursor_to_hook = move_cursor; 578 raw_cursor_to_hook = w32con_move_cursor;
579 clear_to_end_hook = clear_to_end; 579 clear_to_end_hook = w32con_clear_to_end;
580 clear_frame_hook = clear_frame; 580 clear_frame_hook = w32con_clear_frame;
581 clear_end_of_line_hook = clear_end_of_line; 581 clear_end_of_line_hook = w32con_clear_end_of_line;
582 ins_del_lines_hook = ins_del_lines; 582 ins_del_lines_hook = w32con_ins_del_lines;
583 insert_glyphs_hook = insert_glyphs; 583 insert_glyphs_hook = w32con_insert_glyphs;
584 write_glyphs_hook = write_glyphs; 584 write_glyphs_hook = w32con_write_glyphs;
585 delete_glyphs_hook = delete_glyphs; 585 delete_glyphs_hook = w32con_delete_glyphs;
586 ring_bell_hook = w32_sys_ring_bell; 586 ring_bell_hook = w32_sys_ring_bell;
587 reset_terminal_modes_hook = reset_terminal_modes; 587 reset_terminal_modes_hook = w32con_reset_terminal_modes;
588 set_terminal_modes_hook = set_terminal_modes; 588 set_terminal_modes_hook = w32con_set_terminal_modes;
589 set_terminal_window_hook = set_terminal_window; 589 set_terminal_window_hook = w32con_set_terminal_window;
590 update_begin_hook = update_begin; 590 update_begin_hook = w32con_update_begin;
591 update_end_hook = update_end; 591 update_end_hook = w32con_update_end;
592 592
593 read_socket_hook = w32_console_read_socket; 593 read_socket_hook = w32_console_read_socket;
594 mouse_position_hook = w32_console_mouse_position; 594 mouse_position_hook = w32_console_mouse_position;
diff --git a/src/w32fns.c b/src/w32fns.c
index f56ecc35cc6..c0c66a9591e 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -8090,7 +8090,7 @@ DEFUN ("w32-unregister-hot-key", Fw32_unregister_hot_key,
8090 (WPARAM) XINT (XCAR (item)), (LPARAM) item.i)) 8090 (WPARAM) XINT (XCAR (item)), (LPARAM) item.i))
8091#else 8091#else
8092 if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY, 8092 if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY,
8093 (WPARAM) XINT (XCAR (item)), (LPARAM) item.i)) 8093 (WPARAM) XINT (XCAR (item)), (LPARAM) item))
8094 8094
8095#endif 8095#endif
8096 { 8096 {
@@ -8170,7 +8170,7 @@ is set to off if the low bit of NEW-STATE is zero, otherwise on. */)
8170 (WPARAM) vk_code, (LPARAM) new_state.i)) 8170 (WPARAM) vk_code, (LPARAM) new_state.i))
8171#else 8171#else
8172 if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY, 8172 if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY,
8173 (WPARAM) vk_code, (LPARAM) new_state.i)) 8173 (WPARAM) vk_code, (LPARAM) new_state))
8174#endif 8174#endif
8175 { 8175 {
8176 MSG msg; 8176 MSG msg;
diff --git a/src/w32menu.c b/src/w32menu.c
index 5f8f8a4e5e0..cc0932d7bf5 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -2225,9 +2225,12 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
2225 /* Set help string for menu item. Leave it as a Lisp_Object 2225 /* Set help string for menu item. Leave it as a Lisp_Object
2226 until it is ready to be displayed, since GC can happen while 2226 until it is ready to be displayed, since GC can happen while
2227 menus are active. */ 2227 menus are active. */
2228 if (wv->help) 2228 if (!NILP (wv->help))
2229 info.dwItemData = (DWORD) wv->help; 2229#ifdef USE_LISP_UNION_TYPE
2230 2230 info.dwItemData = (DWORD) (wv->help).i;
2231#else
2232 info.dwItemData = (DWORD) (wv->help);
2233#endif
2231 if (wv->button_type == BUTTON_TYPE_RADIO) 2234 if (wv->button_type == BUTTON_TYPE_RADIO)
2232 { 2235 {
2233 /* CheckMenuRadioItem allows us to differentiate TOGGLE and 2236 /* CheckMenuRadioItem allows us to differentiate TOGGLE and
@@ -2307,7 +2310,12 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags)
2307 info.fMask = MIIM_DATA; 2310 info.fMask = MIIM_DATA;
2308 get_menu_item_info (menu, item, FALSE, &info); 2311 get_menu_item_info (menu, item, FALSE, &info);
2309 2312
2313#ifdef USE_LISP_UNION_TYPE
2314 help = info.dwItemData ? (Lisp_Object) ((EMACS_INT) info.dwItemData)
2315 : Qnil;
2316#else
2310 help = info.dwItemData ? (Lisp_Object) info.dwItemData : Qnil; 2317 help = info.dwItemData ? (Lisp_Object) info.dwItemData : Qnil;
2318#endif
2311 } 2319 }
2312 2320
2313 /* Store the help echo in the keyboard buffer as the X toolkit 2321 /* Store the help echo in the keyboard buffer as the X toolkit
diff --git a/src/w32proc.c b/src/w32proc.c
index 842869726df..8452337f7e2 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1,5 +1,5 @@
1/* Process support for GNU Emacs on the Microsoft W32 API. 1/* Process support for GNU Emacs on the Microsoft W32 API.
2 Copyright (C) 1992, 1995, 1999, 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1992, 95, 99, 2000, 01, 04 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -367,7 +367,7 @@ create_child (char *exe, char *cmdline, char *env, int is_gui_app,
367 cp->pid = -cp->pid; 367 cp->pid = -cp->pid;
368 368
369 /* pid must fit in a Lisp_Int */ 369 /* pid must fit in a Lisp_Int */
370 cp->pid = XUINT (make_number (cp->pid)); 370 cp->pid = cp->pid & INTMASK;
371 371
372 *pPid = cp->pid; 372 *pPid = cp->pid;
373 373
diff --git a/src/w32term.h b/src/w32term.h
index f7c4c30064e..284458d4270 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -252,6 +252,10 @@ extern int unibyte_display_via_language_environment;
252 252
253struct w32_display_info *x_display_info_for_name (); 253struct w32_display_info *x_display_info_for_name ();
254 254
255Lisp_Object display_x_get_resource P_ ((struct w32_display_info *,
256 Lisp_Object, Lisp_Object,
257 Lisp_Object, Lisp_Object));
258
255extern struct w32_display_info *w32_term_init (); 259extern struct w32_display_info *w32_term_init ();
256 260
257extern Lisp_Object w32_list_fonts P_ ((struct frame *, Lisp_Object, int, int)); 261extern Lisp_Object w32_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
@@ -717,6 +721,8 @@ struct face;
717 721
718XGCValues *XCreateGC (void *, Window, unsigned long, XGCValues *); 722XGCValues *XCreateGC (void *, Window, unsigned long, XGCValues *);
719struct frame * check_x_frame (Lisp_Object); 723struct frame * check_x_frame (Lisp_Object);
724Lisp_Object vga_stdcolor_name (int);
725
720EXFUN (Fx_display_color_p, 1); 726EXFUN (Fx_display_color_p, 1);
721EXFUN (Fx_display_grayscale_p, 1); 727EXFUN (Fx_display_grayscale_p, 1);
722 728