aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2007-10-15 05:03:21 +0000
committerMiles Bader2007-10-15 05:03:21 +0000
commit63655c83146b773b4ef3d9220b4a9d61545fd050 (patch)
tree2161d262bba2c99b0db2ed8b322eddcafeadd247 /src
parentce8f7ca45fabe11ce32a9ced2b8e7c1987c0d997 (diff)
parentb2529d56b5126319a1659dc1530d6fc102cc21d6 (diff)
downloademacs-63655c83146b773b4ef3d9220b4a9d61545fd050.tar.gz
emacs-63655c83146b773b4ef3d9220b4a9d61545fd050.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 887-889) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 116-121) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-268
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog49
-rw-r--r--src/buffer.c12
-rw-r--r--src/ccl.c23
-rw-r--r--src/data.c16
-rw-r--r--src/dispextern.h4
-rw-r--r--src/dispnew.c2
-rw-r--r--src/editfns.c2
-rw-r--r--src/eval.c16
-rw-r--r--src/fontset.c11
-rw-r--r--src/frame.c4
-rw-r--r--src/image.c6
-rw-r--r--src/intervals.c4
-rw-r--r--src/keyboard.c47
-rw-r--r--src/lisp.h8
-rw-r--r--src/macfns.c10
-rw-r--r--src/macmenu.c9
-rw-r--r--src/macterm.c14
-rw-r--r--src/msdos.c8
-rw-r--r--src/w32fns.c16
-rw-r--r--src/w32menu.c8
-rw-r--r--src/w32term.c45
-rw-r--r--src/window.c8
-rw-r--r--src/xdisp.c14
-rw-r--r--src/xfaces.c26
-rw-r--r--src/xfns.c30
-rw-r--r--src/xmenu.c9
-rw-r--r--src/xterm.c25
27 files changed, 202 insertions, 224 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c928977d68b..4ba46df0f23 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,47 @@
12007-10-10 Patrick Mahan <mahan@mahan.org> (tiny change) 12007-10-14 Juanma Barranquero <lekktu@gmail.com>
2
3 * w32term.c (w32_font_is_double_byte, my_create_scrollbar): Make static.
4 (syms_of_w32term) <w32-enable-unicode-output>: Fix typo in docstring.
5
62007-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
7
8 * buffer.c (Fmake_indirect_buffer): Set the buffer's tag.
9
102007-10-14 Juanma Barranquero <lekktu@gmail.com>
11
12 * eval.c (do_autoload): Don't save autoloads.
13
14 * data.c (Ffset): Save autoload of the function being set.
15
162007-10-07 John Paul Wallington <jpw@pobox.com>
17
18 * xfns.c (x_create_tip_frame): Set the `display-type' frame
19 parameter before setting up faces.
20
212007-10-13 Eli Zaretskii <eliz@gnu.org>
22
23 * ccl.c (Fregister_code_conversion_map):
24 * keyboard.c (append_tool_bar_item): Reformat last change.
25
26 * lisp.h (eabs): Rename from `abs'. All callers changed.
27
282007-10-05 Dmitry Antipov <dmantipov@yandex.ru>
29
30 * buffer.c (add_overlay_mod_hooklist):
31 * ccl.c (Fregister_ccl_program, Fregister_code_conversion_map):
32 * fontset.c (make_fontset):
33 * keyboard.c (GROW_RAW_KEYBUF, menu_bar_items, menu_bar_item)
34 (append_tool_bar_item):
35 * macmenu.c (grow_menu_items):
36 * w32menu.c (grow_menu_items):
37 * xmenu.c (grow_menu_items): Use larger_vector.
38
392007-10-13 Eli Zaretskii <eliz@gnu.org>
40
41 * msdos.c (dos_rawgetc): Undo last change (there's no ``leaving
42 selected frame'' on MSDOS).
43
442007-10-10 Patrick Mahan <mahan@mahan.org> (tiny change)
2 45
3 * macfns.c (x_create_tip_frame): Set terminal for frame. 46 * macfns.c (x_create_tip_frame): Set terminal for frame.
4 47
@@ -785,7 +828,7 @@
785 * keyboard.c (restore_kboard_configuration): Only define when 828 * keyboard.c (restore_kboard_configuration): Only define when
786 MULTI_KBOARD defined. 829 MULTI_KBOARD defined.
787 830
788 * makefile.w32-in: Update dependancies from Makefile.in 831 * makefile.w32-in: Update dependancies from Makefile.in.
789 (OBJ1): Add terminal.$(O) 832 (OBJ1): Add terminal.$(O)
790 833
791 * term.c (dissociate_if_controlling_tty) [WINDOWSNT]: 834 * term.c (dissociate_if_controlling_tty) [WINDOWSNT]:
@@ -1335,7 +1378,7 @@
1335 1378
13362007-08-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 13792007-08-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1337 1380
1338 * mac.c [MAC_OSX] (select_and_poll_event, sys_select): Fix last changes. 1381 * mac.c [MAC_OSX] (select_and_poll_event, sys_select): Fix last changes.
1339 1382
13402007-08-24 Martin Rudalics <rudalics@gmx.at> 13832007-08-24 Martin Rudalics <rudalics@gmx.at>
1341 1384
diff --git a/src/buffer.c b/src/buffer.c
index 237c549df8b..d5f9541301d 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -569,6 +569,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
569 569
570 b = (struct buffer *) allocate_buffer (); 570 b = (struct buffer *) allocate_buffer ();
571 b->size = sizeof (struct buffer) / sizeof (EMACS_INT); 571 b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
572 XSETPVECTYPE (b, PVEC_BUFFER);
572 573
573 if (XBUFFER (base_buffer)->base_buffer) 574 if (XBUFFER (base_buffer)->base_buffer)
574 b->base_buffer = XBUFFER (base_buffer)->base_buffer; 575 b->base_buffer = XBUFFER (base_buffer)->base_buffer;
@@ -4233,15 +4234,8 @@ add_overlay_mod_hooklist (functionlist, overlay)
4233 int oldsize = XVECTOR (last_overlay_modification_hooks)->size; 4234 int oldsize = XVECTOR (last_overlay_modification_hooks)->size;
4234 4235
4235 if (last_overlay_modification_hooks_used == oldsize) 4236 if (last_overlay_modification_hooks_used == oldsize)
4236 { 4237 last_overlay_modification_hooks = larger_vector
4237 Lisp_Object old; 4238 (last_overlay_modification_hooks, oldsize * 2, Qnil);
4238 old = last_overlay_modification_hooks;
4239 last_overlay_modification_hooks
4240 = Fmake_vector (make_number (oldsize * 2), Qnil);
4241 bcopy (XVECTOR (old)->contents,
4242 XVECTOR (last_overlay_modification_hooks)->contents,
4243 sizeof (Lisp_Object) * oldsize);
4244 }
4245 AREF (last_overlay_modification_hooks, last_overlay_modification_hooks_used++) = functionlist; 4239 AREF (last_overlay_modification_hooks, last_overlay_modification_hooks_used++) = functionlist;
4246 AREF (last_overlay_modification_hooks, last_overlay_modification_hooks_used++) = overlay; 4240 AREF (last_overlay_modification_hooks, last_overlay_modification_hooks_used++) = overlay;
4247} 4241}
diff --git a/src/ccl.c b/src/ccl.c
index d51743c243a..5e4a6632d1d 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -2245,16 +2245,8 @@ Return index number of the registered CCL program. */)
2245 } 2245 }
2246 2246
2247 if (idx == len) 2247 if (idx == len)
2248 { 2248 /* Extend the table. */
2249 /* Extend the table. */ 2249 Vccl_program_table = larger_vector (Vccl_program_table, len * 2, Qnil);
2250 Lisp_Object new_table;
2251 int j;
2252
2253 new_table = Fmake_vector (make_number (len * 2), Qnil);
2254 for (j = 0; j < len; j++)
2255 ASET (new_table, j, AREF (Vccl_program_table, j));
2256 Vccl_program_table = new_table;
2257 }
2258 2250
2259 { 2251 {
2260 Lisp_Object elt; 2252 Lisp_Object elt;
@@ -2313,15 +2305,8 @@ Return index number of the registered map. */)
2313 } 2305 }
2314 2306
2315 if (i == len) 2307 if (i == len)
2316 { 2308 Vcode_conversion_map_vector = larger_vector (Vcode_conversion_map_vector,
2317 Lisp_Object new_vector = Fmake_vector (make_number (len * 2), Qnil); 2309 len * 2, Qnil);
2318 int j;
2319
2320 for (j = 0; j < len; j++)
2321 AREF (new_vector, j)
2322 = AREF (Vcode_conversion_map_vector, j);
2323 Vcode_conversion_map_vector = new_vector;
2324 }
2325 2310
2326 index = make_number (i); 2311 index = make_number (i);
2327 Fput (symbol, Qcode_conversion_map, map); 2312 Fput (symbol, Qcode_conversion_map, map);
diff --git a/src/data.c b/src/data.c
index 6439686dcd9..81cffcb38de 100644
--- a/src/data.c
+++ b/src/data.c
@@ -663,12 +663,20 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
663 (symbol, definition) 663 (symbol, definition)
664 register Lisp_Object symbol, definition; 664 register Lisp_Object symbol, definition;
665{ 665{
666 register Lisp_Object function;
667
666 CHECK_SYMBOL (symbol); 668 CHECK_SYMBOL (symbol);
667 if (NILP (symbol) || EQ (symbol, Qt)) 669 if (NILP (symbol) || EQ (symbol, Qt))
668 xsignal1 (Qsetting_constant, symbol); 670 xsignal1 (Qsetting_constant, symbol);
669 if (!NILP (Vautoload_queue) && !EQ (XSYMBOL (symbol)->function, Qunbound)) 671
670 Vautoload_queue = Fcons (Fcons (symbol, XSYMBOL (symbol)->function), 672 function = XSYMBOL (symbol)->function;
671 Vautoload_queue); 673
674 if (!NILP (Vautoload_queue) && !EQ (function, Qunbound))
675 Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue);
676
677 if (CONSP (function) && EQ (XCAR (function), Qautoload))
678 Fput (symbol, Qautoload, XCDR (function));
679
672 XSYMBOL (symbol)->function = definition; 680 XSYMBOL (symbol)->function = definition;
673 /* Handle automatic advice activation */ 681 /* Handle automatic advice activation */
674 if (CONSP (XSYMBOL (symbol)->plist) && !NILP (Fget (symbol, Qad_advice_info))) 682 if (CONSP (XSYMBOL (symbol)->plist) && !NILP (Fget (symbol, Qad_advice_info)))
@@ -752,7 +760,7 @@ Value, if non-nil, is a list \(interactive SPEC). */)
752 Lisp_Object cmd; 760 Lisp_Object cmd;
753{ 761{
754 Lisp_Object fun = indirect_function (cmd); /* Check cycles. */ 762 Lisp_Object fun = indirect_function (cmd); /* Check cycles. */
755 763
756 if (NILP (fun) || EQ (fun, Qunbound)) 764 if (NILP (fun) || EQ (fun, Qunbound))
757 return Qnil; 765 return Qnil;
758 766
diff --git a/src/dispextern.h b/src/dispextern.h
index 32ecee96f60..e89d0d7e390 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -680,9 +680,9 @@ struct glyph_row
680 short used[LAST_AREA]; 680 short used[LAST_AREA];
681 681
682 /* Window-relative x and y-position of the top-left corner of this 682 /* Window-relative x and y-position of the top-left corner of this
683 row. If y < 0, this means that abs (y) pixels of the row are 683 row. If y < 0, this means that eabs (y) pixels of the row are
684 invisible because it is partially visible at the top of a window. 684 invisible because it is partially visible at the top of a window.
685 If x < 0, this means that abs (x) pixels of the first glyph of 685 If x < 0, this means that eabs (x) pixels of the first glyph of
686 the text area of the row are invisible because the glyph is 686 the text area of the row are invisible because the glyph is
687 partially visible. */ 687 partially visible. */
688 int x, y; 688 int x, y;
diff --git a/src/dispnew.c b/src/dispnew.c
index ab2c1518dce..79bb81abfeb 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1993,7 +1993,7 @@ required_matrix_height (w)
1993 if (FRAME_WINDOW_P (f)) 1993 if (FRAME_WINDOW_P (f))
1994 { 1994 {
1995 int ch_height = FRAME_SMALLEST_FONT_HEIGHT (f); 1995 int ch_height = FRAME_SMALLEST_FONT_HEIGHT (f);
1996 int window_pixel_height = window_box_height (w) + abs (w->vscroll); 1996 int window_pixel_height = window_box_height (w) + eabs (w->vscroll);
1997 return (((window_pixel_height + ch_height - 1) 1997 return (((window_pixel_height + ch_height - 1)
1998 / ch_height) * w->nrows_scale_factor 1998 / ch_height) * w->nrows_scale_factor
1999 /* One partially visible line at the top and 1999 /* One partially visible line at the top and
diff --git a/src/editfns.c b/src/editfns.c
index 152c5b669d9..66e3883494f 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1846,7 +1846,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
1846 tzstring = (char *) SDATA (zone); 1846 tzstring = (char *) SDATA (zone);
1847 else if (INTEGERP (zone)) 1847 else if (INTEGERP (zone))
1848 { 1848 {
1849 int abszone = abs (XINT (zone)); 1849 int abszone = eabs (XINT (zone));
1850 sprintf (tzbuf, "XXX%s%d:%02d:%02d", "-" + (XINT (zone) < 0), 1850 sprintf (tzbuf, "XXX%s%d:%02d:%02d", "-" + (XINT (zone) < 0),
1851 abszone / (60*60), (abszone/60) % 60, abszone % 60); 1851 abszone / (60*60), (abszone/60) % 60, abszone % 60);
1852 tzstring = tzbuf; 1852 tzstring = tzbuf;
diff --git a/src/eval.c b/src/eval.c
index 77abe5046db..b69eea44c75 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2178,7 +2178,7 @@ do_autoload (fundef, funname)
2178 Lisp_Object fundef, funname; 2178 Lisp_Object fundef, funname;
2179{ 2179{
2180 int count = SPECPDL_INDEX (); 2180 int count = SPECPDL_INDEX ();
2181 Lisp_Object fun, queue, first, second; 2181 Lisp_Object fun;
2182 struct gcpro gcpro1, gcpro2, gcpro3; 2182 struct gcpro gcpro1, gcpro2, gcpro3;
2183 2183
2184 /* This is to make sure that loadup.el gives a clear picture 2184 /* This is to make sure that loadup.el gives a clear picture
@@ -2199,20 +2199,6 @@ do_autoload (fundef, funname)
2199 Vautoload_queue = Qt; 2199 Vautoload_queue = Qt;
2200 Fload (Fcar (Fcdr (fundef)), Qnil, Qt, Qnil, Qt); 2200 Fload (Fcar (Fcdr (fundef)), Qnil, Qt, Qnil, Qt);
2201 2201
2202 /* Save the old autoloads, in case we ever do an unload. */
2203 queue = Vautoload_queue;
2204 while (CONSP (queue))
2205 {
2206 first = XCAR (queue);
2207 second = Fcdr (first);
2208 first = Fcar (first);
2209
2210 if (SYMBOLP (first) && CONSP (second) && EQ (XCAR (second), Qautoload))
2211 Fput (first, Qautoload, (XCDR (second)));
2212
2213 queue = XCDR (queue);
2214 }
2215
2216 /* Once loading finishes, don't undo it. */ 2202 /* Once loading finishes, don't undo it. */
2217 Vautoload_queue = Qt; 2203 Vautoload_queue = Qt;
2218 unbind_to (count, Qnil); 2204 unbind_to (count, Qnil);
diff --git a/src/fontset.c b/src/fontset.c
index a9cf53c4913..045e632778e 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -859,16 +859,7 @@ make_fontset (frame, name, base)
859 while (!NILP (AREF (Vfontset_table, id))) id++; 859 while (!NILP (AREF (Vfontset_table, id))) id++;
860 860
861 if (id + 1 == size) 861 if (id + 1 == size)
862 { 862 Vfontset_table = larger_vector (Vfontset_table, size + 32, Qnil);
863 /* We must grow Vfontset_table. */
864 Lisp_Object tem;
865 int i;
866
867 tem = Fmake_vector (make_number (size + 32), Qnil);
868 for (i = 0; i < size; i++)
869 AREF (tem, i) = AREF (Vfontset_table, i);
870 Vfontset_table = tem;
871 }
872 863
873 fontset = Fmake_char_table (Qfontset, Qnil); 864 fontset = Fmake_char_table (Qfontset, Qnil);
874 865
diff --git a/src/frame.c b/src/frame.c
index 5f4e12cd705..389a94ae3e8 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -107,6 +107,7 @@ Lisp_Object Qouter_window_id;
107#endif 107#endif
108Lisp_Object Qparent_id; 108Lisp_Object Qparent_id;
109Lisp_Object Qtitle, Qname; 109Lisp_Object Qtitle, Qname;
110Lisp_Object Qexplicit_name;
110Lisp_Object Qunsplittable; 111Lisp_Object Qunsplittable;
111Lisp_Object Qmenu_bar_lines, Qtool_bar_lines; 112Lisp_Object Qmenu_bar_lines, Qtool_bar_lines;
112Lisp_Object Qleft_fringe, Qright_fringe; 113Lisp_Object Qleft_fringe, Qright_fringe;
@@ -3281,6 +3282,7 @@ x_report_frame_params (f, alistptr)
3281 tem = Qnil; 3282 tem = Qnil;
3282 else 3283 else
3283 XSETFASTINT (tem, FRAME_X_OUTPUT (f)->parent_desc); 3284 XSETFASTINT (tem, FRAME_X_OUTPUT (f)->parent_desc);
3285 store_in_alist (alistptr, Qexplicit_name, (f->explicit_name ? Qt : Qnil));
3284 store_in_alist (alistptr, Qparent_id, tem); 3286 store_in_alist (alistptr, Qparent_id, tem);
3285} 3287}
3286 3288
@@ -4337,6 +4339,8 @@ syms_of_frame ()
4337 staticpro (&Qframep); 4339 staticpro (&Qframep);
4338 Qframe_live_p = intern ("frame-live-p"); 4340 Qframe_live_p = intern ("frame-live-p");
4339 staticpro (&Qframe_live_p); 4341 staticpro (&Qframe_live_p);
4342 Qexplicit_name = intern ("explicit-name");
4343 staticpro (&Qexplicit_name);
4340 Qheight = intern ("height"); 4344 Qheight = intern ("height");
4341 staticpro (&Qheight); 4345 staticpro (&Qheight);
4342 Qicon = intern ("icon"); 4346 Qicon = intern ("icon");
diff --git a/src/image.c b/src/image.c
index 16826c425fa..33d5e1a9b2d 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1984,8 +1984,8 @@ lookup_image (f, spec)
1984 if (INTEGERP (relief)) 1984 if (INTEGERP (relief))
1985 { 1985 {
1986 img->relief = XINT (relief); 1986 img->relief = XINT (relief);
1987 img->hmargin += abs (img->relief); 1987 img->hmargin += eabs (img->relief);
1988 img->vmargin += abs (img->relief); 1988 img->vmargin += eabs (img->relief);
1989 } 1989 }
1990 1990
1991 if (! img->background_valid) 1991 if (! img->background_valid)
@@ -5165,7 +5165,7 @@ x_detect_edges (f, img, matrix, color_adjust)
5165 int x, y, i, sum; 5165 int x, y, i, sum;
5166 5166
5167 for (i = sum = 0; i < 9; ++i) 5167 for (i = sum = 0; i < 9; ++i)
5168 sum += abs (matrix[i]); 5168 sum += eabs (matrix[i]);
5169 5169
5170#define COLOR(A, X, Y) ((A) + (Y) * img->width + (X)) 5170#define COLOR(A, X, Y) ((A) + (Y) * img->width + (X))
5171 5171
diff --git a/src/intervals.c b/src/intervals.c
index 74269c7d406..1190ad11cea 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -427,7 +427,7 @@ balance_an_interval (i)
427 /* Since the left child is longer, there must be one. */ 427 /* Since the left child is longer, there must be one. */
428 new_diff = i->total_length - i->left->total_length 428 new_diff = i->total_length - i->left->total_length
429 + RIGHT_TOTAL_LENGTH (i->left) - LEFT_TOTAL_LENGTH (i->left); 429 + RIGHT_TOTAL_LENGTH (i->left) - LEFT_TOTAL_LENGTH (i->left);
430 if (abs (new_diff) >= old_diff) 430 if (eabs (new_diff) >= old_diff)
431 break; 431 break;
432 i = rotate_right (i); 432 i = rotate_right (i);
433 balance_an_interval (i->right); 433 balance_an_interval (i->right);
@@ -437,7 +437,7 @@ balance_an_interval (i)
437 /* Since the right child is longer, there must be one. */ 437 /* Since the right child is longer, there must be one. */
438 new_diff = i->total_length - i->right->total_length 438 new_diff = i->total_length - i->right->total_length
439 + LEFT_TOTAL_LENGTH (i->right) - RIGHT_TOTAL_LENGTH (i->right); 439 + LEFT_TOTAL_LENGTH (i->right) - RIGHT_TOTAL_LENGTH (i->right);
440 if (abs (new_diff) >= -old_diff) 440 if (eabs (new_diff) >= -old_diff)
441 break; 441 break;
442 i = rotate_left (i); 442 i = rotate_left (i);
443 balance_an_interval (i->left); 443 balance_an_interval (i->left);
diff --git a/src/keyboard.c b/src/keyboard.c
index d64091db506..6d6ba6e0cc0 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -160,14 +160,7 @@ int raw_keybuf_count;
160 160
161#define GROW_RAW_KEYBUF \ 161#define GROW_RAW_KEYBUF \
162 if (raw_keybuf_count == XVECTOR (raw_keybuf)->size) \ 162 if (raw_keybuf_count == XVECTOR (raw_keybuf)->size) \
163 { \ 163 raw_keybuf = larger_vector (raw_keybuf, raw_keybuf_count * 2, Qnil) \
164 int newsize = 2 * XVECTOR (raw_keybuf)->size; \
165 Lisp_Object new; \
166 new = Fmake_vector (make_number (newsize), Qnil); \
167 bcopy (XVECTOR (raw_keybuf)->contents, XVECTOR (new)->contents, \
168 raw_keybuf_count * sizeof (Lisp_Object)); \
169 raw_keybuf = new; \
170 }
171 164
172/* Number of elements of this_command_keys 165/* Number of elements of this_command_keys
173 that precede this key sequence. */ 166 that precede this key sequence. */
@@ -5714,8 +5707,8 @@ make_lispy_event (event)
5714 fuzz = double_click_fuzz / 8; 5707 fuzz = double_click_fuzz / 8;
5715 5708
5716 is_double = (button == last_mouse_button 5709 is_double = (button == last_mouse_button
5717 && (abs (XINT (event->x) - last_mouse_x) <= fuzz) 5710 && (eabs (XINT (event->x) - last_mouse_x) <= fuzz)
5718 && (abs (XINT (event->y) - last_mouse_y) <= fuzz) 5711 && (eabs (XINT (event->y) - last_mouse_y) <= fuzz)
5719 && button_down_time != 0 5712 && button_down_time != 0
5720 && (EQ (Vdouble_click_time, Qt) 5713 && (EQ (Vdouble_click_time, Qt)
5721 || (INTEGERP (Vdouble_click_time) 5714 || (INTEGERP (Vdouble_click_time)
@@ -5883,8 +5876,8 @@ make_lispy_event (event)
5883 fuzz = double_click_fuzz / 8; 5876 fuzz = double_click_fuzz / 8;
5884 5877
5885 is_double = (last_mouse_button < 0 5878 is_double = (last_mouse_button < 0
5886 && (abs (XINT (event->x) - last_mouse_x) <= fuzz) 5879 && (eabs (XINT (event->x) - last_mouse_x) <= fuzz)
5887 && (abs (XINT (event->y) - last_mouse_y) <= fuzz) 5880 && (eabs (XINT (event->y) - last_mouse_y) <= fuzz)
5888 && button_down_time != 0 5881 && button_down_time != 0
5889 && (EQ (Vdouble_click_time, Qt) 5882 && (EQ (Vdouble_click_time, Qt)
5890 || (INTEGERP (Vdouble_click_time) 5883 || (INTEGERP (Vdouble_click_time)
@@ -7598,13 +7591,7 @@ menu_bar_items (old)
7598 /* Add nil, nil, nil, nil at the end. */ 7591 /* Add nil, nil, nil, nil at the end. */
7599 i = menu_bar_items_index; 7592 i = menu_bar_items_index;
7600 if (i + 4 > XVECTOR (menu_bar_items_vector)->size) 7593 if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
7601 { 7594 menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, Qnil);
7602 Lisp_Object tem;
7603 tem = Fmake_vector (make_number (2 * i), Qnil);
7604 bcopy (XVECTOR (menu_bar_items_vector)->contents,
7605 XVECTOR (tem)->contents, i * sizeof (Lisp_Object));
7606 menu_bar_items_vector = tem;
7607 }
7608 /* Add this item. */ 7595 /* Add this item. */
7609 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; 7596 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
7610 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; 7597 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
@@ -7676,14 +7663,7 @@ menu_bar_item (key, item, dummy1, dummy2)
7676 { 7663 {
7677 /* If vector is too small, get a bigger one. */ 7664 /* If vector is too small, get a bigger one. */
7678 if (i + 4 > XVECTOR (menu_bar_items_vector)->size) 7665 if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
7679 { 7666 menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, Qnil);
7680 Lisp_Object tem;
7681 tem = Fmake_vector (make_number (2 * i), Qnil);
7682 bcopy (XVECTOR (menu_bar_items_vector)->contents,
7683 XVECTOR (tem)->contents, i * sizeof (Lisp_Object));
7684 menu_bar_items_vector = tem;
7685 }
7686
7687 /* Add this item. */ 7667 /* Add this item. */
7688 XVECTOR (menu_bar_items_vector)->contents[i++] = key; 7668 XVECTOR (menu_bar_items_vector)->contents[i++] = key;
7689 XVECTOR (menu_bar_items_vector)->contents[i++] 7669 XVECTOR (menu_bar_items_vector)->contents[i++]
@@ -8452,16 +8432,9 @@ append_tool_bar_item ()
8452 /* Enlarge tool_bar_items_vector if necessary. */ 8432 /* Enlarge tool_bar_items_vector if necessary. */
8453 if (ntool_bar_items + TOOL_BAR_ITEM_NSLOTS 8433 if (ntool_bar_items + TOOL_BAR_ITEM_NSLOTS
8454 >= XVECTOR (tool_bar_items_vector)->size) 8434 >= XVECTOR (tool_bar_items_vector)->size)
8455 { 8435 tool_bar_items_vector
8456 Lisp_Object new_vector; 8436 = larger_vector (tool_bar_items_vector,
8457 int old_size = XVECTOR (tool_bar_items_vector)->size; 8437 2 * XVECTOR (tool_bar_items_vector)->size, Qnil);
8458
8459 new_vector = Fmake_vector (make_number (2 * old_size), Qnil);
8460 bcopy (XVECTOR (tool_bar_items_vector)->contents,
8461 XVECTOR (new_vector)->contents,
8462 old_size * sizeof (Lisp_Object));
8463 tool_bar_items_vector = new_vector;
8464 }
8465 8438
8466 /* Append entries from tool_bar_item_properties to the end of 8439 /* Append entries from tool_bar_item_properties to the end of
8467 tool_bar_items_vector. */ 8440 tool_bar_items_vector. */
diff --git a/src/lisp.h b/src/lisp.h
index 50750af3c4f..231cfcc7379 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3368,9 +3368,11 @@ extern Lisp_Object Vdirectory_sep_char;
3368#define min(a, b) ((a) < (b) ? (a) : (b)) 3368#define min(a, b) ((a) < (b) ? (a) : (b))
3369#define max(a, b) ((a) > (b) ? (a) : (b)) 3369#define max(a, b) ((a) > (b) ? (a) : (b))
3370 3370
3371/* Make sure we have abs defined */ 3371/* We used to use `abs', but that clashes with system headers on some
3372#if !defined(abs) 3372 platforms, and using a name reserved by Standard C is a bad idea
3373#define abs(x) ((x) < 0 ? -(x) : (x)) 3373 anyway. */
3374#if !defined(eabs)
3375#define eabs(x) ((x) < 0 ? -(x) : (x))
3374#endif 3376#endif
3375 3377
3376/* Return a fixnum or float, depending on whether VAL fits in a Lisp 3378/* Return a fixnum or float, depending on whether VAL fits in a Lisp
diff --git a/src/macfns.c b/src/macfns.c
index 0330ccd0d44..9a9eb69fa63 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -1868,15 +1868,7 @@ x_implicitly_set_name (f, arg, oldval)
1868} 1868}
1869 1869
1870/* Change the title of frame F to NAME. 1870/* Change the title of frame F to NAME.
1871 If NAME is nil, use the frame name as the title. 1871 If NAME is nil, use the frame name as the title. */
1872
1873 If EXPLICIT is non-zero, that indicates that lisp code is setting the
1874 name; if NAME is a string, set F's name to NAME and set
1875 F->explicit_name; if NAME is Qnil, then clear F->explicit_name.
1876
1877 If EXPLICIT is zero, that indicates that Emacs redisplay code is
1878 suggesting a new name, which lisp code should override; if
1879 F->explicit_name is set, ignore the new name; otherwise, set it. */
1880 1872
1881void 1873void
1882x_set_title (f, name, old_name) 1874x_set_title (f, name, old_name)
diff --git a/src/macmenu.c b/src/macmenu.c
index 8305c89ee68..aa0be0bdc2e 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -347,15 +347,8 @@ save_menu_items ()
347static void 347static void
348grow_menu_items () 348grow_menu_items ()
349{ 349{
350 Lisp_Object old;
351 int old_size = menu_items_allocated;
352 old = menu_items;
353
354 menu_items_allocated *= 2; 350 menu_items_allocated *= 2;
355 351 menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
356 menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil);
357 bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents,
358 old_size * sizeof (Lisp_Object));
359} 352}
360 353
361/* Begin a submenu. */ 354/* Begin a submenu. */
diff --git a/src/macterm.c b/src/macterm.c
index ed7411615f5..a15f0b0fcfc 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -2970,7 +2970,7 @@ x_draw_glyph_string_foreground (s)
2970 of S to the right of that box line. */ 2970 of S to the right of that box line. */
2971 if (s->face->box != FACE_NO_BOX 2971 if (s->face->box != FACE_NO_BOX
2972 && s->first_glyph->left_box_line_p) 2972 && s->first_glyph->left_box_line_p)
2973 x = s->x + abs (s->face->box_line_width); 2973 x = s->x + eabs (s->face->box_line_width);
2974 else 2974 else
2975 x = s->x; 2975 x = s->x;
2976 2976
@@ -3049,7 +3049,7 @@ x_draw_composite_glyph_string_foreground (s)
3049 of S to the right of that box line. */ 3049 of S to the right of that box line. */
3050 if (s->face->box != FACE_NO_BOX 3050 if (s->face->box != FACE_NO_BOX
3051 && s->first_glyph->left_box_line_p) 3051 && s->first_glyph->left_box_line_p)
3052 x = s->x + abs (s->face->box_line_width); 3052 x = s->x + eabs (s->face->box_line_width);
3053 else 3053 else
3054 x = s->x; 3054 x = s->x;
3055 3055
@@ -3544,7 +3544,7 @@ x_draw_glyph_string_box (s)
3544 ? s->first_glyph 3544 ? s->first_glyph
3545 : s->first_glyph + s->nchars - 1); 3545 : s->first_glyph + s->nchars - 1);
3546 3546
3547 width = abs (s->face->box_line_width); 3547 width = eabs (s->face->box_line_width);
3548 raised_p = s->face->box == FACE_RAISED_BOX; 3548 raised_p = s->face->box == FACE_RAISED_BOX;
3549 left_x = s->x; 3549 left_x = s->x;
3550 right_x = (s->row->full_width_p && s->extends_to_end_of_line_p 3550 right_x = (s->row->full_width_p && s->extends_to_end_of_line_p
@@ -3590,7 +3590,7 @@ x_draw_image_foreground (s)
3590 if (s->face->box != FACE_NO_BOX 3590 if (s->face->box != FACE_NO_BOX
3591 && s->first_glyph->left_box_line_p 3591 && s->first_glyph->left_box_line_p
3592 && s->slice.x == 0) 3592 && s->slice.x == 0)
3593 x += abs (s->face->box_line_width); 3593 x += eabs (s->face->box_line_width);
3594 3594
3595 /* If there is a margin around the image, adjust x- and y-position 3595 /* If there is a margin around the image, adjust x- and y-position
3596 by that margin. */ 3596 by that margin. */
@@ -3663,7 +3663,7 @@ x_draw_image_relief (s)
3663 if (s->face->box != FACE_NO_BOX 3663 if (s->face->box != FACE_NO_BOX
3664 && s->first_glyph->left_box_line_p 3664 && s->first_glyph->left_box_line_p
3665 && s->slice.x == 0) 3665 && s->slice.x == 0)
3666 x += abs (s->face->box_line_width); 3666 x += eabs (s->face->box_line_width);
3667 3667
3668 /* If there is a margin around the image, adjust x- and y-position 3668 /* If there is a margin around the image, adjust x- and y-position
3669 by that margin. */ 3669 by that margin. */
@@ -3680,7 +3680,7 @@ x_draw_image_relief (s)
3680 } 3680 }
3681 else 3681 else
3682 { 3682 {
3683 thick = abs (s->img->relief); 3683 thick = eabs (s->img->relief);
3684 raised_p = s->img->relief > 0; 3684 raised_p = s->img->relief > 0;
3685 } 3685 }
3686 3686
@@ -3741,7 +3741,7 @@ x_draw_image_glyph_string (s)
3741 struct glyph_string *s; 3741 struct glyph_string *s;
3742{ 3742{
3743 int x, y; 3743 int x, y;
3744 int box_line_hwidth = abs (s->face->box_line_width); 3744 int box_line_hwidth = eabs (s->face->box_line_width);
3745 int box_line_vwidth = max (s->face->box_line_width, 0); 3745 int box_line_vwidth = max (s->face->box_line_width, 0);
3746 int height; 3746 int height;
3747 3747
diff --git a/src/msdos.c b/src/msdos.c
index 02bd2748b8f..2e3ce3cf146 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -3393,13 +3393,7 @@ dos_rawgetc ()
3393 it is active. */ 3393 it is active. */
3394 if (WINDOWP (mouse_window) 3394 if (WINDOWP (mouse_window)
3395 && !EQ (mouse_window, last_mouse_window) 3395 && !EQ (mouse_window, last_mouse_window)
3396 && !EQ (window, selected_window) 3396 && !EQ (mouse_window, selected_window))
3397 /* For click-to-focus window managers
3398 create event iff we don't leave the
3399 selected frame. */
3400 && (focus_follows_mouse
3401 || (EQ (XWINDOW (window)->frame,
3402 XWINDOW (selected_window)->frame))))
3403 { 3397 {
3404 event.kind = SELECT_WINDOW_EVENT; 3398 event.kind = SELECT_WINDOW_EVENT;
3405 event.frame_or_window = mouse_window; 3399 event.frame_or_window = mouse_window;
diff --git a/src/w32fns.c b/src/w32fns.c
index 1fbde99f306..74b2a0ed655 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1940,15 +1940,7 @@ x_implicitly_set_name (f, arg, oldval)
1940} 1940}
1941 1941
1942/* Change the title of frame F to NAME. 1942/* Change the title of frame F to NAME.
1943 If NAME is nil, use the frame name as the title. 1943 If NAME is nil, use the frame name as the title. */
1944
1945 If EXPLICIT is non-zero, that indicates that lisp code is setting the
1946 name; if NAME is a string, set F's name to NAME and set
1947 F->explicit_name; if NAME is Qnil, then clear F->explicit_name.
1948
1949 If EXPLICIT is zero, that indicates that Emacs redisplay code is
1950 suggesting a new name, which lisp code should override; if
1951 F->explicit_name is set, ignore the new name; otherwise, set it. */
1952 1944
1953void 1945void
1954x_set_title (f, name, old_name) 1946x_set_title (f, name, old_name)
@@ -5488,9 +5480,9 @@ w32_to_x_font (lplogfont, lpxstr, len, specific_charset)
5488 5480
5489 if (lplogfont->lfHeight) 5481 if (lplogfont->lfHeight)
5490 { 5482 {
5491 sprintf (height_pixels, "%u", abs (lplogfont->lfHeight)); 5483 sprintf (height_pixels, "%u", eabs (lplogfont->lfHeight));
5492 sprintf (height_dpi, "%u", 5484 sprintf (height_dpi, "%u",
5493 abs (lplogfont->lfHeight) * 720 / display_resy); 5485 eabs (lplogfont->lfHeight) * 720 / display_resy);
5494 } 5486 }
5495 else 5487 else
5496 { 5488 {
@@ -5713,7 +5705,7 @@ x_to_w32_font (lpxstr, lplogfont)
5713 } 5705 }
5714 5706
5715 /* This makes TrueType fonts work better. */ 5707 /* This makes TrueType fonts work better. */
5716 lplogfont->lfHeight = - abs (lplogfont->lfHeight); 5708 lplogfont->lfHeight = - eabs (lplogfont->lfHeight);
5717 5709
5718 return (TRUE); 5710 return (TRUE);
5719} 5711}
diff --git a/src/w32menu.c b/src/w32menu.c
index d4c92d4dcd5..986832b3e7c 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -319,14 +319,8 @@ discard_menu_items ()
319static void 319static void
320grow_menu_items () 320grow_menu_items ()
321{ 321{
322 Lisp_Object old;
323 int old_size = menu_items_allocated;
324 old = menu_items;
325
326 menu_items_allocated *= 2; 322 menu_items_allocated *= 2;
327 menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil); 323 menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
328 bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents,
329 old_size * sizeof (Lisp_Object));
330} 324}
331 325
332/* Begin a submenu. */ 326/* Begin a submenu. */
diff --git a/src/w32term.c b/src/w32term.c
index a7fca780d3c..f174d25720a 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1143,7 +1143,8 @@ w32_cache_char_metrics (font)
1143 1143
1144 1144
1145/* Determine if a font is double byte. */ 1145/* Determine if a font is double byte. */
1146int w32_font_is_double_byte (XFontStruct *font) 1146static int
1147w32_font_is_double_byte (XFontStruct *font)
1147{ 1148{
1148 return font->double_byte_p; 1149 return font->double_byte_p;
1149} 1150}
@@ -1869,7 +1870,7 @@ x_draw_glyph_string_foreground (s)
1869 of S to the right of that box line. */ 1870 of S to the right of that box line. */
1870 if (s->face->box != FACE_NO_BOX 1871 if (s->face->box != FACE_NO_BOX
1871 && s->first_glyph->left_box_line_p) 1872 && s->first_glyph->left_box_line_p)
1872 x = s->x + abs (s->face->box_line_width); 1873 x = s->x + eabs (s->face->box_line_width);
1873 else 1874 else
1874 x = s->x; 1875 x = s->x;
1875 1876
@@ -1961,7 +1962,7 @@ x_draw_composite_glyph_string_foreground (s)
1961 of S to the right of that box line. */ 1962 of S to the right of that box line. */
1962 if (s->face && s->face->box != FACE_NO_BOX 1963 if (s->face && s->face->box != FACE_NO_BOX
1963 && s->first_glyph->left_box_line_p) 1964 && s->first_glyph->left_box_line_p)
1964 x = s->x + abs (s->face->box_line_width); 1965 x = s->x + eabs (s->face->box_line_width);
1965 else 1966 else
1966 x = s->x; 1967 x = s->x;
1967 1968
@@ -2349,7 +2350,7 @@ x_draw_glyph_string_box (s)
2349 ? s->first_glyph 2350 ? s->first_glyph
2350 : s->first_glyph + s->nchars - 1); 2351 : s->first_glyph + s->nchars - 1);
2351 2352
2352 width = abs (s->face->box_line_width); 2353 width = eabs (s->face->box_line_width);
2353 raised_p = s->face->box == FACE_RAISED_BOX; 2354 raised_p = s->face->box == FACE_RAISED_BOX;
2354 left_x = s->x; 2355 left_x = s->x;
2355 right_x = ((s->row->full_width_p && s->extends_to_end_of_line_p 2356 right_x = ((s->row->full_width_p && s->extends_to_end_of_line_p
@@ -2395,7 +2396,7 @@ x_draw_image_foreground (s)
2395 if (s->face->box != FACE_NO_BOX 2396 if (s->face->box != FACE_NO_BOX
2396 && s->first_glyph->left_box_line_p 2397 && s->first_glyph->left_box_line_p
2397 && s->slice.x == 0) 2398 && s->slice.x == 0)
2398 x += abs (s->face->box_line_width); 2399 x += eabs (s->face->box_line_width);
2399 2400
2400 /* If there is a margin around the image, adjust x- and y-position 2401 /* If there is a margin around the image, adjust x- and y-position
2401 by that margin. */ 2402 by that margin. */
@@ -2488,7 +2489,7 @@ x_draw_image_relief (s)
2488 if (s->face->box != FACE_NO_BOX 2489 if (s->face->box != FACE_NO_BOX
2489 && s->first_glyph->left_box_line_p 2490 && s->first_glyph->left_box_line_p
2490 && s->slice.x == 0) 2491 && s->slice.x == 0)
2491 x += abs (s->face->box_line_width); 2492 x += eabs (s->face->box_line_width);
2492 2493
2493 /* If there is a margin around the image, adjust x- and y-position 2494 /* If there is a margin around the image, adjust x- and y-position
2494 by that margin. */ 2495 by that margin. */
@@ -2505,7 +2506,7 @@ x_draw_image_relief (s)
2505 } 2506 }
2506 else 2507 else
2507 { 2508 {
2508 thick = abs (s->img->relief); 2509 thick = eabs (s->img->relief);
2509 raised_p = s->img->relief > 0; 2510 raised_p = s->img->relief > 0;
2510 } 2511 }
2511 2512
@@ -2542,7 +2543,7 @@ w32_draw_image_foreground_1 (s, pixmap)
2542 if (s->face->box != FACE_NO_BOX 2543 if (s->face->box != FACE_NO_BOX
2543 && s->first_glyph->left_box_line_p 2544 && s->first_glyph->left_box_line_p
2544 && s->slice.x == 0) 2545 && s->slice.x == 0)
2545 x += abs (s->face->box_line_width); 2546 x += eabs (s->face->box_line_width);
2546 2547
2547 /* If there is a margin around the image, adjust x- and y-position 2548 /* If there is a margin around the image, adjust x- and y-position
2548 by that margin. */ 2549 by that margin. */
@@ -2654,7 +2655,7 @@ x_draw_image_glyph_string (s)
2654 struct glyph_string *s; 2655 struct glyph_string *s;
2655{ 2656{
2656 int x, y; 2657 int x, y;
2657 int box_line_hwidth = abs (s->face->box_line_width); 2658 int box_line_hwidth = eabs (s->face->box_line_width);
2658 int box_line_vwidth = max (s->face->box_line_width, 0); 2659 int box_line_vwidth = max (s->face->box_line_width, 0);
2659 int height; 2660 int height;
2660 HBITMAP pixmap = 0; 2661 HBITMAP pixmap = 0;
@@ -4023,7 +4024,7 @@ w32_set_scroll_bar_thumb (bar, portion, position, whole)
4023 Scroll bars, general 4024 Scroll bars, general
4024 ************************************************************************/ 4025 ************************************************************************/
4025 4026
4026HWND 4027static HWND
4027my_create_scrollbar (f, bar) 4028my_create_scrollbar (f, bar)
4028 struct frame * f; 4029 struct frame * f;
4029 struct scroll_bar * bar; 4030 struct scroll_bar * bar;
@@ -4637,7 +4638,7 @@ static short temp_buffer[100];
4637 4638
4638 Some of these messages are reposted back to the message queue since the 4639 Some of these messages are reposted back to the message queue since the
4639 system calls the windows proc directly in a context where we cannot return 4640 system calls the windows proc directly in a context where we cannot return
4640 the data nor can we guarantee the state we are in. So if we dispatch them 4641 the data nor can we guarantee the state we are in. So if we dispatch them
4641 we will get into an infinite loop. To prevent this from ever happening we 4642 we will get into an infinite loop. To prevent this from ever happening we
4642 will set a variable to indicate we are in the read_socket call and indicate 4643 will set a variable to indicate we are in the read_socket call and indicate
4643 which message we are processing since the windows proc gets called 4644 which message we are processing since the windows proc gets called
@@ -6097,7 +6098,22 @@ x_set_window_size (f, change_gravity, cols, rows)
6097 SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); 6098 SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
6098 } 6099 }
6099 6100
6100 /* Now, strictly speaking, we can't be sure that this is accurate, 6101#if 0
6102 /* The following mirrors what is done in xterm.c. It appears to be
6103 for informing lisp of the new size immediately, while the actual
6104 resize will happen asynchronously. But on Windows, the menu bar
6105 automatically wraps when the frame is too narrow to contain it,
6106 and that causes any calculations made here to come out wrong. The
6107 end is some nasty buggy behaviour, including the potential loss
6108 of the minibuffer.
6109
6110 Disabling this code is either not sufficient to fix the problems
6111 completely, or it causes fresh problems, but at least it removes
6112 the most problematic symptom of the minibuffer becoming unusable.
6113
6114 -----------------------------------------------------------------
6115
6116 Now, strictly speaking, we can't be sure that this is accurate,
6101 but the window manager will get around to dealing with the size 6117 but the window manager will get around to dealing with the size
6102 change request eventually, and we'll hear how it went when the 6118 change request eventually, and we'll hear how it went when the
6103 ConfigureNotify event gets here. 6119 ConfigureNotify event gets here.
@@ -6128,6 +6144,7 @@ x_set_window_size (f, change_gravity, cols, rows)
6128 Actually checking whether it is outside is a pain in the neck, 6144 Actually checking whether it is outside is a pain in the neck,
6129 so don't try--just let the highlighting be done afresh with new size. */ 6145 so don't try--just let the highlighting be done afresh with new size. */
6130 cancel_mouse_face (f); 6146 cancel_mouse_face (f);
6147#endif
6131 6148
6132 UNBLOCK_INPUT; 6149 UNBLOCK_INPUT;
6133} 6150}
@@ -6714,7 +6731,7 @@ w32_initialize_display_info (display_name)
6714 6731
6715/* Create an xrdb-style database of resources to supercede registry settings. 6732/* Create an xrdb-style database of resources to supercede registry settings.
6716 The database is just a concatenation of C strings, finished by an additional 6733 The database is just a concatenation of C strings, finished by an additional
6717 \0. The string are submitted to some basic normalization, so 6734 \0. The strings are submitted to some basic normalization, so
6718 6735
6719 [ *]option[ *]:[ *]value... 6736 [ *]option[ *]:[ *]value...
6720 6737
@@ -7186,7 +7203,7 @@ interpreted normally. */);
7186Unicode output may prevent some third party applications for displaying 7203Unicode output may prevent some third party applications for displaying
7187Far-East Languages on Windows 95/98 from working properly. 7204Far-East Languages on Windows 95/98 from working properly.
7188NT uses Unicode internally anyway, so this flag will probably have no 7205NT uses Unicode internally anyway, so this flag will probably have no
7189affect on NT machines. */); 7206effect on NT machines. */);
7190 w32_enable_unicode_output = 1; 7207 w32_enable_unicode_output = 1;
7191 7208
7192 DEFVAR_BOOL ("w32-use-visible-system-caret", 7209 DEFVAR_BOOL ("w32-use-visible-system-caret",
diff --git a/src/window.c b/src/window.c
index c51649679da..2fd4d286eba 100644
--- a/src/window.c
+++ b/src/window.c
@@ -799,7 +799,7 @@ coordinates_in_window (w, x, y)
799 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) 799 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)
800 || WINDOW_RIGHTMOST_P (w)) 800 || WINDOW_RIGHTMOST_P (w))
801 { 801 {
802 if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width) 802 if (!WINDOW_LEFTMOST_P (w) && eabs (*x - x0) < grabbable_width)
803 { 803 {
804 /* Convert X and Y to window relative coordinates. 804 /* Convert X and Y to window relative coordinates.
805 Vertical border is at the left edge of window. */ 805 Vertical border is at the left edge of window. */
@@ -810,7 +810,7 @@ coordinates_in_window (w, x, y)
810 } 810 }
811 else 811 else
812 { 812 {
813 if (abs (*x - x1) < grabbable_width) 813 if (eabs (*x - x1) < grabbable_width)
814 { 814 {
815 /* Convert X and Y to window relative coordinates. 815 /* Convert X and Y to window relative coordinates.
816 Vertical border is at the right edge of window. */ 816 Vertical border is at the right edge of window. */
@@ -858,7 +858,7 @@ coordinates_in_window (w, x, y)
858 if (!w->pseudo_window_p 858 if (!w->pseudo_window_p
859 && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w) 859 && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
860 && !WINDOW_RIGHTMOST_P (w) 860 && !WINDOW_RIGHTMOST_P (w)
861 && (abs (*x - right_x) < grabbable_width)) 861 && (eabs (*x - right_x) < grabbable_width))
862 { 862 {
863 /* Convert X and Y to window relative coordinates. 863 /* Convert X and Y to window relative coordinates.
864 Vertical border is at the right edge of window. */ 864 Vertical border is at the right edge of window. */
@@ -5497,7 +5497,7 @@ scroll_command (n, direction)
5497{ 5497{
5498 int count = SPECPDL_INDEX (); 5498 int count = SPECPDL_INDEX ();
5499 5499
5500 xassert (abs (direction) == 1); 5500 xassert (eabs (direction) == 1);
5501 5501
5502 /* If selected window's buffer isn't current, make it current for 5502 /* If selected window's buffer isn't current, make it current for
5503 the moment. But don't screw up if window_scroll gets an error. */ 5503 the moment. But don't screw up if window_scroll gets an error. */
diff --git a/src/xdisp.c b/src/xdisp.c
index 746fa2540f9..fef50689ab5 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3724,6 +3724,10 @@ handle_invisible_prop (it)
3724 it->position.bytepos = CHAR_TO_BYTE (it->position.charpos); 3724 it->position.bytepos = CHAR_TO_BYTE (it->position.charpos);
3725 } 3725 }
3726 setup_for_ellipsis (it, 0); 3726 setup_for_ellipsis (it, 0);
3727 /* Let the ellipsis display before
3728 considering any properties of the following char.
3729 Fixes jasonr@gnu.org 01 Oct 07 bug. */
3730 handled = HANDLED_RETURN;
3727 } 3731 }
3728 } 3732 }
3729 } 3733 }
@@ -12625,7 +12629,7 @@ compute_window_start_on_continuation_line (w)
12625 minimum distance from the old window start. */ 12629 minimum distance from the old window start. */
12626 pos = it.current.pos; 12630 pos = it.current.pos;
12627 min_distance = INFINITY; 12631 min_distance = INFINITY;
12628 while ((distance = abs (CHARPOS (start_pos) - IT_CHARPOS (it))), 12632 while ((distance = eabs (CHARPOS (start_pos) - IT_CHARPOS (it))),
12629 distance < min_distance) 12633 distance < min_distance)
12630 { 12634 {
12631 min_distance = distance; 12635 min_distance = distance;
@@ -20291,9 +20295,9 @@ produce_image_glyph (it)
20291 } 20295 }
20292 20296
20293 if (it->start_of_box_run_p && slice.x == 0) 20297 if (it->start_of_box_run_p && slice.x == 0)
20294 it->pixel_width += abs (face->box_line_width); 20298 it->pixel_width += eabs (face->box_line_width);
20295 if (it->end_of_box_run_p && slice.x + slice.width == img->width) 20299 if (it->end_of_box_run_p && slice.x + slice.width == img->width)
20296 it->pixel_width += abs (face->box_line_width); 20300 it->pixel_width += eabs (face->box_line_width);
20297 } 20301 }
20298 20302
20299 take_vertical_position_into_account (it); 20303 take_vertical_position_into_account (it);
@@ -22610,8 +22614,8 @@ fast_find_string_pos (w, pos, object, hpos, vpos, x, y, right_p)
22610 goto found; 22614 goto found;
22611 } 22615 }
22612 else if (best_glyph == NULL 22616 else if (best_glyph == NULL
22613 || ((abs (g->charpos - pos) 22617 || ((eabs (g->charpos - pos)
22614 < abs (best_glyph->charpos - pos)) 22618 < eabs (best_glyph->charpos - pos))
22615 && (right_p 22619 && (right_p
22616 ? g->charpos < pos 22620 ? g->charpos < pos
22617 : g->charpos > pos))) 22621 : g->charpos > pos)))
diff --git a/src/xfaces.c b/src/xfaces.c
index d3e7a105b60..50d733c7d0b 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1501,11 +1501,11 @@ face_color_gray_p (f, color_name)
1501 gray_p = (/* Any color sufficiently close to black counts as grey. */ 1501 gray_p = (/* Any color sufficiently close to black counts as grey. */
1502 (color.red < 5000 && color.green < 5000 && color.blue < 5000) 1502 (color.red < 5000 && color.green < 5000 && color.blue < 5000)
1503 || 1503 ||
1504 ((abs (color.red - color.green) 1504 ((eabs (color.red - color.green)
1505 < max (color.red, color.green) / 20) 1505 < max (color.red, color.green) / 20)
1506 && (abs (color.green - color.blue) 1506 && (eabs (color.green - color.blue)
1507 < max (color.green, color.blue) / 20) 1507 < max (color.green, color.blue) / 20)
1508 && (abs (color.blue - color.red) 1508 && (eabs (color.blue - color.red)
1509 < max (color.blue, color.red) / 20))); 1509 < max (color.blue, color.red) / 20)));
1510 else 1510 else
1511 gray_p = 0; 1511 gray_p = 0;
@@ -2838,7 +2838,7 @@ cmp_font_names (a, b)
2838 int resy = FRAME_X_DISPLAY_INFO (font_frame)->resy; 2838 int resy = FRAME_X_DISPLAY_INFO (font_frame)->resy;
2839 int x_resy = x->numeric[XLFD_RESY]; 2839 int x_resy = x->numeric[XLFD_RESY];
2840 int y_resy = y->numeric[XLFD_RESY]; 2840 int y_resy = y->numeric[XLFD_RESY];
2841 cmp = abs (resy - x_resy) - abs (resy - y_resy); 2841 cmp = eabs (resy - x_resy) - eabs (resy - y_resy);
2842 } 2842 }
2843 } 2843 }
2844 2844
@@ -6198,7 +6198,7 @@ smaller_face (f, face_id, steps)
6198 6198
6199 /* Try in increments of 1/2 pt. */ 6199 /* Try in increments of 1/2 pt. */
6200 delta = steps < 0 ? 5 : -5; 6200 delta = steps < 0 ? 5 : -5;
6201 steps = abs (steps); 6201 steps = eabs (steps);
6202 6202
6203 face = FACE_FROM_ID (f, face_id); 6203 face = FACE_FROM_ID (f, face_id);
6204 bcopy (face->lface, attrs, sizeof attrs); 6204 bcopy (face->lface, attrs, sizeof attrs);
@@ -6209,7 +6209,7 @@ smaller_face (f, face_id, steps)
6209 while (steps 6209 while (steps
6210 && pt + delta > 0 6210 && pt + delta > 0
6211 /* Give up if we cannot find a font within 10pt. */ 6211 /* Give up if we cannot find a font within 10pt. */
6212 && abs (last_pt - pt) < 100) 6212 && eabs (last_pt - pt) < 100)
6213 { 6213 {
6214 /* Look up a face for a slightly smaller/larger font. */ 6214 /* Look up a face for a slightly smaller/larger font. */
6215 pt += delta; 6215 pt += delta;
@@ -6822,17 +6822,17 @@ better_font_p (values, font1, font2, compare_pt_p, avgwidth)
6822 6822
6823 if (xlfd_idx == XLFD_POINT_SIZE) 6823 if (xlfd_idx == XLFD_POINT_SIZE)
6824 { 6824 {
6825 delta1 = abs (values[i] - (font1->numeric[xlfd_idx] 6825 delta1 = eabs (values[i] - (font1->numeric[xlfd_idx]
6826 / font1->rescale_ratio)); 6826 / font1->rescale_ratio));
6827 delta2 = abs (values[i] - (font2->numeric[xlfd_idx] 6827 delta2 = eabs (values[i] - (font2->numeric[xlfd_idx]
6828 / font2->rescale_ratio)); 6828 / font2->rescale_ratio));
6829 if (abs (delta1 - delta2) < FONT_POINT_SIZE_QUANTUM) 6829 if (eabs (delta1 - delta2) < FONT_POINT_SIZE_QUANTUM)
6830 continue; 6830 continue;
6831 } 6831 }
6832 else 6832 else
6833 { 6833 {
6834 delta1 = abs (values[i] - font1->numeric[xlfd_idx]); 6834 delta1 = eabs (values[i] - font1->numeric[xlfd_idx]);
6835 delta2 = abs (values[i] - font2->numeric[xlfd_idx]); 6835 delta2 = eabs (values[i] - font2->numeric[xlfd_idx]);
6836 } 6836 }
6837 6837
6838 if (delta1 > delta2) 6838 if (delta1 > delta2)
@@ -6854,8 +6854,8 @@ better_font_p (values, font1, font2, compare_pt_p, avgwidth)
6854 6854
6855 if (avgwidth) 6855 if (avgwidth)
6856 { 6856 {
6857 int delta1 = abs (avgwidth - font1->numeric[XLFD_AVGWIDTH]); 6857 int delta1 = eabs (avgwidth - font1->numeric[XLFD_AVGWIDTH]);
6858 int delta2 = abs (avgwidth - font2->numeric[XLFD_AVGWIDTH]); 6858 int delta2 = eabs (avgwidth - font2->numeric[XLFD_AVGWIDTH]);
6859 if (delta1 > delta2) 6859 if (delta1 > delta2)
6860 return 0; 6860 return 0;
6861 else if (delta1 < delta2) 6861 else if (delta1 < delta2)
diff --git a/src/xfns.c b/src/xfns.c
index 54d637d859b..8d21a69461a 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1760,15 +1760,7 @@ x_implicitly_set_name (f, arg, oldval)
1760} 1760}
1761 1761
1762/* Change the title of frame F to NAME. 1762/* Change the title of frame F to NAME.
1763 If NAME is nil, use the frame name as the title. 1763 If NAME is nil, use the frame name as the title. */
1764
1765 If EXPLICIT is non-zero, that indicates that lisp code is setting the
1766 name; if NAME is a string, set F's name to NAME and set
1767 F->explicit_name; if NAME is Qnil, then clear F->explicit_name.
1768
1769 If EXPLICIT is zero, that indicates that Emacs redisplay code is
1770 suggesting a new name, which lisp code should override; if
1771 F->explicit_name is set, ignore the new name; otherwise, set it. */
1772 1764
1773void 1765void
1774x_set_title (f, name, old_name) 1766x_set_title (f, name, old_name)
@@ -5180,6 +5172,26 @@ else
5180 Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt), 5172 Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt),
5181 Qnil)); 5173 Qnil));
5182 5174
5175 /* FIXME - can this be done in a similar way to normal frames?
5176 http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */
5177
5178 /* Set the `display-type' frame parameter before setting up faces. */
5179 {
5180 Lisp_Object disptype;
5181
5182 if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1)
5183 disptype = intern ("mono");
5184 else if (FRAME_X_DISPLAY_INFO (f)->visual->class == GrayScale
5185 || FRAME_X_DISPLAY_INFO (f)->visual->class == StaticGray)
5186 disptype = intern ("grayscale");
5187 else
5188 disptype = intern ("color");
5189
5190 if (NILP (Fframe_parameter (frame, Qdisplay_type)))
5191 Fmodify_frame_parameters (frame, Fcons (Fcons (Qdisplay_type, disptype),
5192 Qnil));
5193 }
5194
5183 /* Set up faces after all frame parameters are known. This call 5195 /* Set up faces after all frame parameters are known. This call
5184 also merges in face attributes specified for new frames. 5196 also merges in face attributes specified for new frames.
5185 5197
diff --git a/src/xmenu.c b/src/xmenu.c
index 4e7f07c375a..15aab98f9c5 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -354,15 +354,8 @@ save_menu_items ()
354static void 354static void
355grow_menu_items () 355grow_menu_items ()
356{ 356{
357 Lisp_Object old;
358 int old_size = menu_items_allocated;
359 old = menu_items;
360
361 menu_items_allocated *= 2; 357 menu_items_allocated *= 2;
362 358 menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
363 menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil);
364 bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents,
365 old_size * sizeof (Lisp_Object));
366} 359}
367 360
368/* Begin a submenu. */ 361/* Begin a submenu. */
diff --git a/src/xterm.c b/src/xterm.c
index a1beab492ee..68670795fa3 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1401,7 +1401,7 @@ x_draw_glyph_string_foreground (s)
1401 of S to the right of that box line. */ 1401 of S to the right of that box line. */
1402 if (s->face->box != FACE_NO_BOX 1402 if (s->face->box != FACE_NO_BOX
1403 && s->first_glyph->left_box_line_p) 1403 && s->first_glyph->left_box_line_p)
1404 x = s->x + abs (s->face->box_line_width); 1404 x = s->x + eabs (s->face->box_line_width);
1405 else 1405 else
1406 x = s->x; 1406 x = s->x;
1407 1407
@@ -1503,7 +1503,7 @@ x_draw_composite_glyph_string_foreground (s)
1503 of S to the right of that box line. */ 1503 of S to the right of that box line. */
1504 if (s->face && s->face->box != FACE_NO_BOX 1504 if (s->face && s->face->box != FACE_NO_BOX
1505 && s->first_glyph->left_box_line_p) 1505 && s->first_glyph->left_box_line_p)
1506 x = s->x + abs (s->face->box_line_width); 1506 x = s->x + eabs (s->face->box_line_width);
1507 else 1507 else
1508 x = s->x; 1508 x = s->x;
1509 1509
@@ -2357,7 +2357,7 @@ x_draw_glyph_string_box (s)
2357 ? s->first_glyph 2357 ? s->first_glyph
2358 : s->first_glyph + s->nchars - 1); 2358 : s->first_glyph + s->nchars - 1);
2359 2359
2360 width = abs (s->face->box_line_width); 2360 width = eabs (s->face->box_line_width);
2361 raised_p = s->face->box == FACE_RAISED_BOX; 2361 raised_p = s->face->box == FACE_RAISED_BOX;
2362 left_x = s->x; 2362 left_x = s->x;
2363 right_x = (s->row->full_width_p && s->extends_to_end_of_line_p 2363 right_x = (s->row->full_width_p && s->extends_to_end_of_line_p
@@ -2403,7 +2403,7 @@ x_draw_image_foreground (s)
2403 if (s->face->box != FACE_NO_BOX 2403 if (s->face->box != FACE_NO_BOX
2404 && s->first_glyph->left_box_line_p 2404 && s->first_glyph->left_box_line_p
2405 && s->slice.x == 0) 2405 && s->slice.x == 0)
2406 x += abs (s->face->box_line_width); 2406 x += eabs (s->face->box_line_width);
2407 2407
2408 /* If there is a margin around the image, adjust x- and y-position 2408 /* If there is a margin around the image, adjust x- and y-position
2409 by that margin. */ 2409 by that margin. */
@@ -2496,7 +2496,7 @@ x_draw_image_relief (s)
2496 if (s->face->box != FACE_NO_BOX 2496 if (s->face->box != FACE_NO_BOX
2497 && s->first_glyph->left_box_line_p 2497 && s->first_glyph->left_box_line_p
2498 && s->slice.x == 0) 2498 && s->slice.x == 0)
2499 x += abs (s->face->box_line_width); 2499 x += eabs (s->face->box_line_width);
2500 2500
2501 /* If there is a margin around the image, adjust x- and y-position 2501 /* If there is a margin around the image, adjust x- and y-position
2502 by that margin. */ 2502 by that margin. */
@@ -2513,7 +2513,7 @@ x_draw_image_relief (s)
2513 } 2513 }
2514 else 2514 else
2515 { 2515 {
2516 thick = abs (s->img->relief); 2516 thick = eabs (s->img->relief);
2517 raised_p = s->img->relief > 0; 2517 raised_p = s->img->relief > 0;
2518 } 2518 }
2519 2519
@@ -2548,7 +2548,7 @@ x_draw_image_foreground_1 (s, pixmap)
2548 if (s->face->box != FACE_NO_BOX 2548 if (s->face->box != FACE_NO_BOX
2549 && s->first_glyph->left_box_line_p 2549 && s->first_glyph->left_box_line_p
2550 && s->slice.x == 0) 2550 && s->slice.x == 0)
2551 x += abs (s->face->box_line_width); 2551 x += eabs (s->face->box_line_width);
2552 2552
2553 /* If there is a margin around the image, adjust x- and y-position 2553 /* If there is a margin around the image, adjust x- and y-position
2554 by that margin. */ 2554 by that margin. */
@@ -2648,7 +2648,7 @@ static void
2648x_draw_image_glyph_string (s) 2648x_draw_image_glyph_string (s)
2649 struct glyph_string *s; 2649 struct glyph_string *s;
2650{ 2650{
2651 int box_line_hwidth = abs (s->face->box_line_width); 2651 int box_line_hwidth = eabs (s->face->box_line_width);
2652 int box_line_vwidth = max (s->face->box_line_width, 0); 2652 int box_line_vwidth = max (s->face->box_line_width, 0);
2653 int height; 2653 int height;
2654 Pixmap pixmap = None; 2654 Pixmap pixmap = None;
@@ -4630,7 +4630,7 @@ xaw_jump_callback (widget, client_data, call_data)
4630 whole = 10000000; 4630 whole = 10000000;
4631 portion = shown < 1 ? top * whole : 0; 4631 portion = shown < 1 ? top * whole : 0;
4632 4632
4633 if (shown < 1 && (abs (top + shown - 1) < 1.0/height)) 4633 if (shown < 1 && (eabs (top + shown - 1) < 1.0/height))
4634 /* Some derivatives of Xaw refuse to shrink the thumb when you reach 4634 /* Some derivatives of Xaw refuse to shrink the thumb when you reach
4635 the bottom, so we force the scrolling whenever we see that we're 4635 the bottom, so we force the scrolling whenever we see that we're
4636 too close to the bottom (in x_set_toolkit_scroll_bar_thumb 4636 too close to the bottom (in x_set_toolkit_scroll_bar_thumb
@@ -4671,12 +4671,12 @@ xaw_scroll_callback (widget, client_data, call_data)
4671 XtVaGetValues (widget, XtNheight, &height, NULL); 4671 XtVaGetValues (widget, XtNheight, &height, NULL);
4672 UNBLOCK_INPUT; 4672 UNBLOCK_INPUT;
4673 4673
4674 if (abs (position) >= height) 4674 if (eabs (position) >= height)
4675 part = (position < 0) ? scroll_bar_above_handle : scroll_bar_below_handle; 4675 part = (position < 0) ? scroll_bar_above_handle : scroll_bar_below_handle;
4676 4676
4677 /* If Xaw3d was compiled with ARROW_SCROLLBAR, 4677 /* If Xaw3d was compiled with ARROW_SCROLLBAR,
4678 it maps line-movement to call_data = max(5, height/20). */ 4678 it maps line-movement to call_data = max(5, height/20). */
4679 else if (xaw3d_arrow_scroll && abs (position) <= max (5, height / 20)) 4679 else if (xaw3d_arrow_scroll && eabs (position) <= max (5, height / 20))
4680 part = (position < 0) ? scroll_bar_up_arrow : scroll_bar_down_arrow; 4680 part = (position < 0) ? scroll_bar_up_arrow : scroll_bar_down_arrow;
4681 else 4681 else
4682 part = scroll_bar_move_ratio; 4682 part = scroll_bar_move_ratio;
@@ -9044,7 +9044,8 @@ x_sync_with_move (f, left, top, fuzzy)
9044 /* The left fuzz-factor is 10 pixels. The top fuzz-factor is 40 9044 /* The left fuzz-factor is 10 pixels. The top fuzz-factor is 40
9045 pixels. */ 9045 pixels. */
9046 9046
9047 if (abs (current_left - left) <= 10 && abs (current_top - top) <= 40) 9047 if (eabs (current_left - left) <= 10
9048 && eabs (current_top - top) <= 40)
9048 return; 9049 return;
9049 } 9050 }
9050 else if (current_left == left && current_top == top) 9051 else if (current_left == left && current_top == top)