summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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 @@
-2007-10-10 Patrick Mahan <mahan@mahan.org> (tiny change)
+2007-10-14 Juanma Barranquero <lekktu@gmail.com>
+
+ * w32term.c (w32_font_is_double_byte, my_create_scrollbar): Make static.
+ (syms_of_w32term) <w32-enable-unicode-output>: Fix typo in docstring.
+
+2007-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * buffer.c (Fmake_indirect_buffer): Set the buffer's tag.
+
+2007-10-14 Juanma Barranquero <lekktu@gmail.com>
+
+ * eval.c (do_autoload): Don't save autoloads.
+
+ * data.c (Ffset): Save autoload of the function being set.
+
+2007-10-07 John Paul Wallington <jpw@pobox.com>
+
+ * xfns.c (x_create_tip_frame): Set the `display-type' frame
+ parameter before setting up faces.
+
+2007-10-13 Eli Zaretskii <eliz@gnu.org>
+
+ * ccl.c (Fregister_code_conversion_map):
+ * keyboard.c (append_tool_bar_item): Reformat last change.
+
+ * lisp.h (eabs): Rename from `abs'. All callers changed.
+
+2007-10-05 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * buffer.c (add_overlay_mod_hooklist):
+ * ccl.c (Fregister_ccl_program, Fregister_code_conversion_map):
+ * fontset.c (make_fontset):
+ * keyboard.c (GROW_RAW_KEYBUF, menu_bar_items, menu_bar_item)
+ (append_tool_bar_item):
+ * macmenu.c (grow_menu_items):
+ * w32menu.c (grow_menu_items):
+ * xmenu.c (grow_menu_items): Use larger_vector.
+
+2007-10-13 Eli Zaretskii <eliz@gnu.org>
+
+ * msdos.c (dos_rawgetc): Undo last change (there's no ``leaving
+ selected frame'' on MSDOS).
+
+2007-10-10 Patrick Mahan <mahan@mahan.org> (tiny change)
* macfns.c (x_create_tip_frame): Set terminal for frame.
@@ -785,7 +828,7 @@
* keyboard.c (restore_kboard_configuration): Only define when
MULTI_KBOARD defined.
- * makefile.w32-in: Update dependancies from Makefile.in
+ * makefile.w32-in: Update dependancies from Makefile.in.
(OBJ1): Add terminal.$(O)
* term.c (dissociate_if_controlling_tty) [WINDOWSNT]:
@@ -1335,7 +1378,7 @@
2007-08-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
- * mac.c [MAC_OSX] (select_and_poll_event, sys_select): Fix last changes.
+ * mac.c [MAC_OSX] (select_and_poll_event, sys_select): Fix last changes.
2007-08-24 Martin Rudalics <rudalics@gmx.at>
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. */)
b = (struct buffer *) allocate_buffer ();
b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
+ XSETPVECTYPE (b, PVEC_BUFFER);
if (XBUFFER (base_buffer)->base_buffer)
b->base_buffer = XBUFFER (base_buffer)->base_buffer;
@@ -4233,15 +4234,8 @@ add_overlay_mod_hooklist (functionlist, overlay)
int oldsize = XVECTOR (last_overlay_modification_hooks)->size;
if (last_overlay_modification_hooks_used == oldsize)
- {
- Lisp_Object old;
- old = last_overlay_modification_hooks;
- last_overlay_modification_hooks
- = Fmake_vector (make_number (oldsize * 2), Qnil);
- bcopy (XVECTOR (old)->contents,
- XVECTOR (last_overlay_modification_hooks)->contents,
- sizeof (Lisp_Object) * oldsize);
- }
+ last_overlay_modification_hooks = larger_vector
+ (last_overlay_modification_hooks, oldsize * 2, Qnil);
AREF (last_overlay_modification_hooks, last_overlay_modification_hooks_used++) = functionlist;
AREF (last_overlay_modification_hooks, last_overlay_modification_hooks_used++) = overlay;
}
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. */)
}
if (idx == len)
- {
- /* Extend the table. */
- Lisp_Object new_table;
- int j;
-
- new_table = Fmake_vector (make_number (len * 2), Qnil);
- for (j = 0; j < len; j++)
- ASET (new_table, j, AREF (Vccl_program_table, j));
- Vccl_program_table = new_table;
- }
+ /* Extend the table. */
+ Vccl_program_table = larger_vector (Vccl_program_table, len * 2, Qnil);
{
Lisp_Object elt;
@@ -2313,15 +2305,8 @@ Return index number of the registered map. */)
}
if (i == len)
- {
- Lisp_Object new_vector = Fmake_vector (make_number (len * 2), Qnil);
- int j;
-
- for (j = 0; j < len; j++)
- AREF (new_vector, j)
- = AREF (Vcode_conversion_map_vector, j);
- Vcode_conversion_map_vector = new_vector;
- }
+ Vcode_conversion_map_vector = larger_vector (Vcode_conversion_map_vector,
+ len * 2, Qnil);
index = make_number (i);
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,
(symbol, definition)
register Lisp_Object symbol, definition;
{
+ register Lisp_Object function;
+
CHECK_SYMBOL (symbol);
if (NILP (symbol) || EQ (symbol, Qt))
xsignal1 (Qsetting_constant, symbol);
- if (!NILP (Vautoload_queue) && !EQ (XSYMBOL (symbol)->function, Qunbound))
- Vautoload_queue = Fcons (Fcons (symbol, XSYMBOL (symbol)->function),
- Vautoload_queue);
+
+ function = XSYMBOL (symbol)->function;
+
+ if (!NILP (Vautoload_queue) && !EQ (function, Qunbound))
+ Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue);
+
+ if (CONSP (function) && EQ (XCAR (function), Qautoload))
+ Fput (symbol, Qautoload, XCDR (function));
+
XSYMBOL (symbol)->function = definition;
/* Handle automatic advice activation */
if (CONSP (XSYMBOL (symbol)->plist) && !NILP (Fget (symbol, Qad_advice_info)))
@@ -752,7 +760,7 @@ Value, if non-nil, is a list \(interactive SPEC). */)
Lisp_Object cmd;
{
Lisp_Object fun = indirect_function (cmd); /* Check cycles. */
-
+
if (NILP (fun) || EQ (fun, Qunbound))
return Qnil;
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
short used[LAST_AREA];
/* Window-relative x and y-position of the top-left corner of this
- row. If y < 0, this means that abs (y) pixels of the row are
+ row. If y < 0, this means that eabs (y) pixels of the row are
invisible because it is partially visible at the top of a window.
- If x < 0, this means that abs (x) pixels of the first glyph of
+ If x < 0, this means that eabs (x) pixels of the first glyph of
the text area of the row are invisible because the glyph is
partially visible. */
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)
if (FRAME_WINDOW_P (f))
{
int ch_height = FRAME_SMALLEST_FONT_HEIGHT (f);
- int window_pixel_height = window_box_height (w) + abs (w->vscroll);
+ int window_pixel_height = window_box_height (w) + eabs (w->vscroll);
return (((window_pixel_height + ch_height - 1)
/ ch_height) * w->nrows_scale_factor
/* 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) */)
tzstring = (char *) SDATA (zone);
else if (INTEGERP (zone))
{
- int abszone = abs (XINT (zone));
+ int abszone = eabs (XINT (zone));
sprintf (tzbuf, "XXX%s%d:%02d:%02d", "-" + (XINT (zone) < 0),
abszone / (60*60), (abszone/60) % 60, abszone % 60);
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)
Lisp_Object fundef, funname;
{
int count = SPECPDL_INDEX ();
- Lisp_Object fun, queue, first, second;
+ Lisp_Object fun;
struct gcpro gcpro1, gcpro2, gcpro3;
/* This is to make sure that loadup.el gives a clear picture
@@ -2199,20 +2199,6 @@ do_autoload (fundef, funname)
Vautoload_queue = Qt;
Fload (Fcar (Fcdr (fundef)), Qnil, Qt, Qnil, Qt);
- /* Save the old autoloads, in case we ever do an unload. */
- queue = Vautoload_queue;
- while (CONSP (queue))
- {
- first = XCAR (queue);
- second = Fcdr (first);
- first = Fcar (first);
-
- if (SYMBOLP (first) && CONSP (second) && EQ (XCAR (second), Qautoload))
- Fput (first, Qautoload, (XCDR (second)));
-
- queue = XCDR (queue);
- }
-
/* Once loading finishes, don't undo it. */
Vautoload_queue = Qt;
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)
while (!NILP (AREF (Vfontset_table, id))) id++;
if (id + 1 == size)
- {
- /* We must grow Vfontset_table. */
- Lisp_Object tem;
- int i;
-
- tem = Fmake_vector (make_number (size + 32), Qnil);
- for (i = 0; i < size; i++)
- AREF (tem, i) = AREF (Vfontset_table, i);
- Vfontset_table = tem;
- }
+ Vfontset_table = larger_vector (Vfontset_table, size + 32, Qnil);
fontset = Fmake_char_table (Qfontset, Qnil);
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;
#endif
Lisp_Object Qparent_id;
Lisp_Object Qtitle, Qname;
+Lisp_Object Qexplicit_name;
Lisp_Object Qunsplittable;
Lisp_Object Qmenu_bar_lines, Qtool_bar_lines;
Lisp_Object Qleft_fringe, Qright_fringe;
@@ -3281,6 +3282,7 @@ x_report_frame_params (f, alistptr)
tem = Qnil;
else
XSETFASTINT (tem, FRAME_X_OUTPUT (f)->parent_desc);
+ store_in_alist (alistptr, Qexplicit_name, (f->explicit_name ? Qt : Qnil));
store_in_alist (alistptr, Qparent_id, tem);
}
@@ -4337,6 +4339,8 @@ syms_of_frame ()
staticpro (&Qframep);
Qframe_live_p = intern ("frame-live-p");
staticpro (&Qframe_live_p);
+ Qexplicit_name = intern ("explicit-name");
+ staticpro (&Qexplicit_name);
Qheight = intern ("height");
staticpro (&Qheight);
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)
if (INTEGERP (relief))
{
img->relief = XINT (relief);
- img->hmargin += abs (img->relief);
- img->vmargin += abs (img->relief);
+ img->hmargin += eabs (img->relief);
+ img->vmargin += eabs (img->relief);
}
if (! img->background_valid)
@@ -5165,7 +5165,7 @@ x_detect_edges (f, img, matrix, color_adjust)
int x, y, i, sum;
for (i = sum = 0; i < 9; ++i)
- sum += abs (matrix[i]);
+ sum += eabs (matrix[i]);
#define COLOR(A, X, Y) ((A) + (Y) * img->width + (X))
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)
/* Since the left child is longer, there must be one. */
new_diff = i->total_length - i->left->total_length
+ RIGHT_TOTAL_LENGTH (i->left) - LEFT_TOTAL_LENGTH (i->left);
- if (abs (new_diff) >= old_diff)
+ if (eabs (new_diff) >= old_diff)
break;
i = rotate_right (i);
balance_an_interval (i->right);
@@ -437,7 +437,7 @@ balance_an_interval (i)
/* Since the right child is longer, there must be one. */
new_diff = i->total_length - i->right->total_length
+ LEFT_TOTAL_LENGTH (i->right) - RIGHT_TOTAL_LENGTH (i->right);
- if (abs (new_diff) >= -old_diff)
+ if (eabs (new_diff) >= -old_diff)
break;
i = rotate_left (i);
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;
#define GROW_RAW_KEYBUF \
if (raw_keybuf_count == XVECTOR (raw_keybuf)->size) \
- { \
- int newsize = 2 * XVECTOR (raw_keybuf)->size; \
- Lisp_Object new; \
- new = Fmake_vector (make_number (newsize), Qnil); \
- bcopy (XVECTOR (raw_keybuf)->contents, XVECTOR (new)->contents, \
- raw_keybuf_count * sizeof (Lisp_Object)); \
- raw_keybuf = new; \
- }
+ raw_keybuf = larger_vector (raw_keybuf, raw_keybuf_count * 2, Qnil) \
/* Number of elements of this_command_keys
that precede this key sequence. */
@@ -5714,8 +5707,8 @@ make_lispy_event (event)
fuzz = double_click_fuzz / 8;
is_double = (button == last_mouse_button
- && (abs (XINT (event->x) - last_mouse_x) <= fuzz)
- && (abs (XINT (event->y) - last_mouse_y) <= fuzz)
+ && (eabs (XINT (event->x) - last_mouse_x) <= fuzz)
+ && (eabs (XINT (event->y) - last_mouse_y) <= fuzz)
&& button_down_time != 0
&& (EQ (Vdouble_click_time, Qt)
|| (INTEGERP (Vdouble_click_time)
@@ -5883,8 +5876,8 @@ make_lispy_event (event)
fuzz = double_click_fuzz / 8;
is_double = (last_mouse_button < 0
- && (abs (XINT (event->x) - last_mouse_x) <= fuzz)
- && (abs (XINT (event->y) - last_mouse_y) <= fuzz)
+ && (eabs (XINT (event->x) - last_mouse_x) <= fuzz)
+ && (eabs (XINT (event->y) - last_mouse_y) <= fuzz)
&& button_down_time != 0
&& (EQ (Vdouble_click_time, Qt)
|| (INTEGERP (Vdouble_click_time)
@@ -7598,13 +7591,7 @@ menu_bar_items (old)
/* Add nil, nil, nil, nil at the end. */
i = menu_bar_items_index;
if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
- {
- Lisp_Object tem;
- tem = Fmake_vector (make_number (2 * i), Qnil);
- bcopy (XVECTOR (menu_bar_items_vector)->contents,
- XVECTOR (tem)->contents, i * sizeof (Lisp_Object));
- menu_bar_items_vector = tem;
- }
+ menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, Qnil);
/* Add this item. */
XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
@@ -7676,14 +7663,7 @@ menu_bar_item (key, item, dummy1, dummy2)
{
/* If vector is too small, get a bigger one. */
if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
- {
- Lisp_Object tem;
- tem = Fmake_vector (make_number (2 * i), Qnil);
- bcopy (XVECTOR (menu_bar_items_vector)->contents,
- XVECTOR (tem)->contents, i * sizeof (Lisp_Object));
- menu_bar_items_vector = tem;
- }
-
+ menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, Qnil);
/* Add this item. */
XVECTOR (menu_bar_items_vector)->contents[i++] = key;
XVECTOR (menu_bar_items_vector)->contents[i++]
@@ -8452,16 +8432,9 @@ append_tool_bar_item ()
/* Enlarge tool_bar_items_vector if necessary. */
if (ntool_bar_items + TOOL_BAR_ITEM_NSLOTS
>= XVECTOR (tool_bar_items_vector)->size)
- {
- Lisp_Object new_vector;
- int old_size = XVECTOR (tool_bar_items_vector)->size;
-
- new_vector = Fmake_vector (make_number (2 * old_size), Qnil);
- bcopy (XVECTOR (tool_bar_items_vector)->contents,
- XVECTOR (new_vector)->contents,
- old_size * sizeof (Lisp_Object));
- tool_bar_items_vector = new_vector;
- }
+ tool_bar_items_vector
+ = larger_vector (tool_bar_items_vector,
+ 2 * XVECTOR (tool_bar_items_vector)->size, Qnil);
/* Append entries from tool_bar_item_properties to the end of
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;
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
-/* Make sure we have abs defined */
-#if !defined(abs)
-#define abs(x) ((x) < 0 ? -(x) : (x))
+/* We used to use `abs', but that clashes with system headers on some
+ platforms, and using a name reserved by Standard C is a bad idea
+ anyway. */
+#if !defined(eabs)
+#define eabs(x) ((x) < 0 ? -(x) : (x))
#endif
/* 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)
}
/* Change the title of frame F to NAME.
- If NAME is nil, use the frame name as the title.
-
- If EXPLICIT is non-zero, that indicates that lisp code is setting the
- name; if NAME is a string, set F's name to NAME and set
- F->explicit_name; if NAME is Qnil, then clear F->explicit_name.
-
- If EXPLICIT is zero, that indicates that Emacs redisplay code is
- suggesting a new name, which lisp code should override; if
- F->explicit_name is set, ignore the new name; otherwise, set it. */
+ If NAME is nil, use the frame name as the title. */
void
x_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 ()
static void
grow_menu_items ()
{
- Lisp_Object old;
- int old_size = menu_items_allocated;
- old = menu_items;
-
menu_items_allocated *= 2;
-
- menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil);
- bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents,
- old_size * sizeof (Lisp_Object));
+ menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
}
/* 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)
of S to the right of that box line. */
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
- x = s->x + abs (s->face->box_line_width);
+ x = s->x + eabs (s->face->box_line_width);
else
x = s->x;
@@ -3049,7 +3049,7 @@ x_draw_composite_glyph_string_foreground (s)
of S to the right of that box line. */
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
- x = s->x + abs (s->face->box_line_width);
+ x = s->x + eabs (s->face->box_line_width);
else
x = s->x;
@@ -3544,7 +3544,7 @@ x_draw_glyph_string_box (s)
? s->first_glyph
: s->first_glyph + s->nchars - 1);
- width = abs (s->face->box_line_width);
+ width = eabs (s->face->box_line_width);
raised_p = s->face->box == FACE_RAISED_BOX;
left_x = s->x;
right_x = (s->row->full_width_p && s->extends_to_end_of_line_p
@@ -3590,7 +3590,7 @@ x_draw_image_foreground (s)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
- x += abs (s->face->box_line_width);
+ x += eabs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
@@ -3663,7 +3663,7 @@ x_draw_image_relief (s)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
- x += abs (s->face->box_line_width);
+ x += eabs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
@@ -3680,7 +3680,7 @@ x_draw_image_relief (s)
}
else
{
- thick = abs (s->img->relief);
+ thick = eabs (s->img->relief);
raised_p = s->img->relief > 0;
}
@@ -3741,7 +3741,7 @@ x_draw_image_glyph_string (s)
struct glyph_string *s;
{
int x, y;
- int box_line_hwidth = abs (s->face->box_line_width);
+ int box_line_hwidth = eabs (s->face->box_line_width);
int box_line_vwidth = max (s->face->box_line_width, 0);
int height;
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 ()
it is active. */
if (WINDOWP (mouse_window)
&& !EQ (mouse_window, last_mouse_window)
- && !EQ (window, selected_window)
- /* For click-to-focus window managers
- create event iff we don't leave the
- selected frame. */
- && (focus_follows_mouse
- || (EQ (XWINDOW (window)->frame,
- XWINDOW (selected_window)->frame))))
+ && !EQ (mouse_window, selected_window))
{
event.kind = SELECT_WINDOW_EVENT;
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)
}
/* Change the title of frame F to NAME.
- If NAME is nil, use the frame name as the title.
-
- If EXPLICIT is non-zero, that indicates that lisp code is setting the
- name; if NAME is a string, set F's name to NAME and set
- F->explicit_name; if NAME is Qnil, then clear F->explicit_name.
-
- If EXPLICIT is zero, that indicates that Emacs redisplay code is
- suggesting a new name, which lisp code should override; if
- F->explicit_name is set, ignore the new name; otherwise, set it. */
+ If NAME is nil, use the frame name as the title. */
void
x_set_title (f, name, old_name)
@@ -5488,9 +5480,9 @@ w32_to_x_font (lplogfont, lpxstr, len, specific_charset)
if (lplogfont->lfHeight)
{
- sprintf (height_pixels, "%u", abs (lplogfont->lfHeight));
+ sprintf (height_pixels, "%u", eabs (lplogfont->lfHeight));
sprintf (height_dpi, "%u",
- abs (lplogfont->lfHeight) * 720 / display_resy);
+ eabs (lplogfont->lfHeight) * 720 / display_resy);
}
else
{
@@ -5713,7 +5705,7 @@ x_to_w32_font (lpxstr, lplogfont)
}
/* This makes TrueType fonts work better. */
- lplogfont->lfHeight = - abs (lplogfont->lfHeight);
+ lplogfont->lfHeight = - eabs (lplogfont->lfHeight);
return (TRUE);
}
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 ()
static void
grow_menu_items ()
{
- Lisp_Object old;
- int old_size = menu_items_allocated;
- old = menu_items;
-
menu_items_allocated *= 2;
- menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil);
- bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents,
- old_size * sizeof (Lisp_Object));
+ menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
}
/* 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)
/* Determine if a font is double byte. */
-int w32_font_is_double_byte (XFontStruct *font)
+static int
+w32_font_is_double_byte (XFontStruct *font)
{
return font->double_byte_p;
}
@@ -1869,7 +1870,7 @@ x_draw_glyph_string_foreground (s)
of S to the right of that box line. */
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
- x = s->x + abs (s->face->box_line_width);
+ x = s->x + eabs (s->face->box_line_width);
else
x = s->x;
@@ -1961,7 +1962,7 @@ x_draw_composite_glyph_string_foreground (s)
of S to the right of that box line. */
if (s->face && s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
- x = s->x + abs (s->face->box_line_width);
+ x = s->x + eabs (s->face->box_line_width);
else
x = s->x;
@@ -2349,7 +2350,7 @@ x_draw_glyph_string_box (s)
? s->first_glyph
: s->first_glyph + s->nchars - 1);
- width = abs (s->face->box_line_width);
+ width = eabs (s->face->box_line_width);
raised_p = s->face->box == FACE_RAISED_BOX;
left_x = s->x;
right_x = ((s->row->full_width_p && s->extends_to_end_of_line_p
@@ -2395,7 +2396,7 @@ x_draw_image_foreground (s)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
- x += abs (s->face->box_line_width);
+ x += eabs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
@@ -2488,7 +2489,7 @@ x_draw_image_relief (s)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
- x += abs (s->face->box_line_width);
+ x += eabs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
@@ -2505,7 +2506,7 @@ x_draw_image_relief (s)
}
else
{
- thick = abs (s->img->relief);
+ thick = eabs (s->img->relief);
raised_p = s->img->relief > 0;
}
@@ -2542,7 +2543,7 @@ w32_draw_image_foreground_1 (s, pixmap)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
- x += abs (s->face->box_line_width);
+ x += eabs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
@@ -2654,7 +2655,7 @@ x_draw_image_glyph_string (s)
struct glyph_string *s;
{
int x, y;
- int box_line_hwidth = abs (s->face->box_line_width);
+ int box_line_hwidth = eabs (s->face->box_line_width);
int box_line_vwidth = max (s->face->box_line_width, 0);
int height;
HBITMAP pixmap = 0;
@@ -4023,7 +4024,7 @@ w32_set_scroll_bar_thumb (bar, portion, position, whole)
Scroll bars, general
************************************************************************/
-HWND
+static HWND
my_create_scrollbar (f, bar)
struct frame * f;
struct scroll_bar * bar;
@@ -4637,7 +4638,7 @@ static short temp_buffer[100];
Some of these messages are reposted back to the message queue since the
system calls the windows proc directly in a context where we cannot return
- the data nor can we guarantee the state we are in. So if we dispatch them
+ the data nor can we guarantee the state we are in. So if we dispatch them
we will get into an infinite loop. To prevent this from ever happening we
will set a variable to indicate we are in the read_socket call and indicate
which message we are processing since the windows proc gets called
@@ -6097,7 +6098,22 @@ x_set_window_size (f, change_gravity, cols, rows)
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
}
- /* Now, strictly speaking, we can't be sure that this is accurate,
+#if 0
+ /* The following mirrors what is done in xterm.c. It appears to be
+ for informing lisp of the new size immediately, while the actual
+ resize will happen asynchronously. But on Windows, the menu bar
+ automatically wraps when the frame is too narrow to contain it,
+ and that causes any calculations made here to come out wrong. The
+ end is some nasty buggy behaviour, including the potential loss
+ of the minibuffer.
+
+ Disabling this code is either not sufficient to fix the problems
+ completely, or it causes fresh problems, but at least it removes
+ the most problematic symptom of the minibuffer becoming unusable.
+
+ -----------------------------------------------------------------
+
+ Now, strictly speaking, we can't be sure that this is accurate,
but the window manager will get around to dealing with the size
change request eventually, and we'll hear how it went when the
ConfigureNotify event gets here.
@@ -6128,6 +6144,7 @@ x_set_window_size (f, change_gravity, cols, rows)
Actually checking whether it is outside is a pain in the neck,
so don't try--just let the highlighting be done afresh with new size. */
cancel_mouse_face (f);
+#endif
UNBLOCK_INPUT;
}
@@ -6714,7 +6731,7 @@ w32_initialize_display_info (display_name)
/* Create an xrdb-style database of resources to supercede registry settings.
The database is just a concatenation of C strings, finished by an additional
- \0. The string are submitted to some basic normalization, so
+ \0. The strings are submitted to some basic normalization, so
[ *]option[ *]:[ *]value...
@@ -7186,7 +7203,7 @@ interpreted normally. */);
Unicode output may prevent some third party applications for displaying
Far-East Languages on Windows 95/98 from working properly.
NT uses Unicode internally anyway, so this flag will probably have no
-affect on NT machines. */);
+effect on NT machines. */);
w32_enable_unicode_output = 1;
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)
if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)
|| WINDOW_RIGHTMOST_P (w))
{
- if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width)
+ if (!WINDOW_LEFTMOST_P (w) && eabs (*x - x0) < grabbable_width)
{
/* Convert X and Y to window relative coordinates.
Vertical border is at the left edge of window. */
@@ -810,7 +810,7 @@ coordinates_in_window (w, x, y)
}
else
{
- if (abs (*x - x1) < grabbable_width)
+ if (eabs (*x - x1) < grabbable_width)
{
/* Convert X and Y to window relative coordinates.
Vertical border is at the right edge of window. */
@@ -858,7 +858,7 @@ coordinates_in_window (w, x, y)
if (!w->pseudo_window_p
&& !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
&& !WINDOW_RIGHTMOST_P (w)
- && (abs (*x - right_x) < grabbable_width))
+ && (eabs (*x - right_x) < grabbable_width))
{
/* Convert X and Y to window relative coordinates.
Vertical border is at the right edge of window. */
@@ -5497,7 +5497,7 @@ scroll_command (n, direction)
{
int count = SPECPDL_INDEX ();
- xassert (abs (direction) == 1);
+ xassert (eabs (direction) == 1);
/* If selected window's buffer isn't current, make it current for
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)
it->position.bytepos = CHAR_TO_BYTE (it->position.charpos);
}
setup_for_ellipsis (it, 0);
+ /* Let the ellipsis display before
+ considering any properties of the following char.
+ Fixes jasonr@gnu.org 01 Oct 07 bug. */
+ handled = HANDLED_RETURN;
}
}
}
@@ -12625,7 +12629,7 @@ compute_window_start_on_continuation_line (w)
minimum distance from the old window start. */
pos = it.current.pos;
min_distance = INFINITY;
- while ((distance = abs (CHARPOS (start_pos) - IT_CHARPOS (it))),
+ while ((distance = eabs (CHARPOS (start_pos) - IT_CHARPOS (it))),
distance < min_distance)
{
min_distance = distance;
@@ -20291,9 +20295,9 @@ produce_image_glyph (it)
}
if (it->start_of_box_run_p && slice.x == 0)
- it->pixel_width += abs (face->box_line_width);
+ it->pixel_width += eabs (face->box_line_width);
if (it->end_of_box_run_p && slice.x + slice.width == img->width)
- it->pixel_width += abs (face->box_line_width);
+ it->pixel_width += eabs (face->box_line_width);
}
take_vertical_position_into_account (it);
@@ -22610,8 +22614,8 @@ fast_find_string_pos (w, pos, object, hpos, vpos, x, y, right_p)
goto found;
}
else if (best_glyph == NULL
- || ((abs (g->charpos - pos)
- < abs (best_glyph->charpos - pos))
+ || ((eabs (g->charpos - pos)
+ < eabs (best_glyph->charpos - pos))
&& (right_p
? g->charpos < pos
: 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)
gray_p = (/* Any color sufficiently close to black counts as grey. */
(color.red < 5000 && color.green < 5000 && color.blue < 5000)
||
- ((abs (color.red - color.green)
+ ((eabs (color.red - color.green)
< max (color.red, color.green) / 20)
- && (abs (color.green - color.blue)
+ && (eabs (color.green - color.blue)
< max (color.green, color.blue) / 20)
- && (abs (color.blue - color.red)
+ && (eabs (color.blue - color.red)
< max (color.blue, color.red) / 20)));
else
gray_p = 0;
@@ -2838,7 +2838,7 @@ cmp_font_names (a, b)
int resy = FRAME_X_DISPLAY_INFO (font_frame)->resy;
int x_resy = x->numeric[XLFD_RESY];
int y_resy = y->numeric[XLFD_RESY];
- cmp = abs (resy - x_resy) - abs (resy - y_resy);
+ cmp = eabs (resy - x_resy) - eabs (resy - y_resy);
}
}
@@ -6198,7 +6198,7 @@ smaller_face (f, face_id, steps)
/* Try in increments of 1/2 pt. */
delta = steps < 0 ? 5 : -5;
- steps = abs (steps);
+ steps = eabs (steps);
face = FACE_FROM_ID (f, face_id);
bcopy (face->lface, attrs, sizeof attrs);
@@ -6209,7 +6209,7 @@ smaller_face (f, face_id, steps)
while (steps
&& pt + delta > 0
/* Give up if we cannot find a font within 10pt. */
- && abs (last_pt - pt) < 100)
+ && eabs (last_pt - pt) < 100)
{
/* Look up a face for a slightly smaller/larger font. */
pt += delta;
@@ -6822,17 +6822,17 @@ better_font_p (values, font1, font2, compare_pt_p, avgwidth)
if (xlfd_idx == XLFD_POINT_SIZE)
{
- delta1 = abs (values[i] - (font1->numeric[xlfd_idx]
+ delta1 = eabs (values[i] - (font1->numeric[xlfd_idx]
/ font1->rescale_ratio));
- delta2 = abs (values[i] - (font2->numeric[xlfd_idx]
+ delta2 = eabs (values[i] - (font2->numeric[xlfd_idx]
/ font2->rescale_ratio));
- if (abs (delta1 - delta2) < FONT_POINT_SIZE_QUANTUM)
+ if (eabs (delta1 - delta2) < FONT_POINT_SIZE_QUANTUM)
continue;
}
else
{
- delta1 = abs (values[i] - font1->numeric[xlfd_idx]);
- delta2 = abs (values[i] - font2->numeric[xlfd_idx]);
+ delta1 = eabs (values[i] - font1->numeric[xlfd_idx]);
+ delta2 = eabs (values[i] - font2->numeric[xlfd_idx]);
}
if (delta1 > delta2)
@@ -6854,8 +6854,8 @@ better_font_p (values, font1, font2, compare_pt_p, avgwidth)
if (avgwidth)
{
- int delta1 = abs (avgwidth - font1->numeric[XLFD_AVGWIDTH]);
- int delta2 = abs (avgwidth - font2->numeric[XLFD_AVGWIDTH]);
+ int delta1 = eabs (avgwidth - font1->numeric[XLFD_AVGWIDTH]);
+ int delta2 = eabs (avgwidth - font2->numeric[XLFD_AVGWIDTH]);
if (delta1 > delta2)
return 0;
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)
}
/* Change the title of frame F to NAME.
- If NAME is nil, use the frame name as the title.
-
- If EXPLICIT is non-zero, that indicates that lisp code is setting the
- name; if NAME is a string, set F's name to NAME and set
- F->explicit_name; if NAME is Qnil, then clear F->explicit_name.
-
- If EXPLICIT is zero, that indicates that Emacs redisplay code is
- suggesting a new name, which lisp code should override; if
- F->explicit_name is set, ignore the new name; otherwise, set it. */
+ If NAME is nil, use the frame name as the title. */
void
x_set_title (f, name, old_name)
@@ -5180,6 +5172,26 @@ else
Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt),
Qnil));
+ /* FIXME - can this be done in a similar way to normal frames?
+ http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */
+
+ /* Set the `display-type' frame parameter before setting up faces. */
+ {
+ Lisp_Object disptype;
+
+ if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1)
+ disptype = intern ("mono");
+ else if (FRAME_X_DISPLAY_INFO (f)->visual->class == GrayScale
+ || FRAME_X_DISPLAY_INFO (f)->visual->class == StaticGray)
+ disptype = intern ("grayscale");
+ else
+ disptype = intern ("color");
+
+ if (NILP (Fframe_parameter (frame, Qdisplay_type)))
+ Fmodify_frame_parameters (frame, Fcons (Fcons (Qdisplay_type, disptype),
+ Qnil));
+ }
+
/* Set up faces after all frame parameters are known. This call
also merges in face attributes specified for new frames.
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 ()
static void
grow_menu_items ()
{
- Lisp_Object old;
- int old_size = menu_items_allocated;
- old = menu_items;
-
menu_items_allocated *= 2;
-
- menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil);
- bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents,
- old_size * sizeof (Lisp_Object));
+ menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
}
/* 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)
of S to the right of that box line. */
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
- x = s->x + abs (s->face->box_line_width);
+ x = s->x + eabs (s->face->box_line_width);
else
x = s->x;
@@ -1503,7 +1503,7 @@ x_draw_composite_glyph_string_foreground (s)
of S to the right of that box line. */
if (s->face && s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p)
- x = s->x + abs (s->face->box_line_width);
+ x = s->x + eabs (s->face->box_line_width);
else
x = s->x;
@@ -2357,7 +2357,7 @@ x_draw_glyph_string_box (s)
? s->first_glyph
: s->first_glyph + s->nchars - 1);
- width = abs (s->face->box_line_width);
+ width = eabs (s->face->box_line_width);
raised_p = s->face->box == FACE_RAISED_BOX;
left_x = s->x;
right_x = (s->row->full_width_p && s->extends_to_end_of_line_p
@@ -2403,7 +2403,7 @@ x_draw_image_foreground (s)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
- x += abs (s->face->box_line_width);
+ x += eabs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
@@ -2496,7 +2496,7 @@ x_draw_image_relief (s)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
- x += abs (s->face->box_line_width);
+ x += eabs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
@@ -2513,7 +2513,7 @@ x_draw_image_relief (s)
}
else
{
- thick = abs (s->img->relief);
+ thick = eabs (s->img->relief);
raised_p = s->img->relief > 0;
}
@@ -2548,7 +2548,7 @@ x_draw_image_foreground_1 (s, pixmap)
if (s->face->box != FACE_NO_BOX
&& s->first_glyph->left_box_line_p
&& s->slice.x == 0)
- x += abs (s->face->box_line_width);
+ x += eabs (s->face->box_line_width);
/* If there is a margin around the image, adjust x- and y-position
by that margin. */
@@ -2648,7 +2648,7 @@ static void
x_draw_image_glyph_string (s)
struct glyph_string *s;
{
- int box_line_hwidth = abs (s->face->box_line_width);
+ int box_line_hwidth = eabs (s->face->box_line_width);
int box_line_vwidth = max (s->face->box_line_width, 0);
int height;
Pixmap pixmap = None;
@@ -4630,7 +4630,7 @@ xaw_jump_callback (widget, client_data, call_data)
whole = 10000000;
portion = shown < 1 ? top * whole : 0;
- if (shown < 1 && (abs (top + shown - 1) < 1.0/height))
+ if (shown < 1 && (eabs (top + shown - 1) < 1.0/height))
/* Some derivatives of Xaw refuse to shrink the thumb when you reach
the bottom, so we force the scrolling whenever we see that we're
too close to the bottom (in x_set_toolkit_scroll_bar_thumb
@@ -4671,12 +4671,12 @@ xaw_scroll_callback (widget, client_data, call_data)
XtVaGetValues (widget, XtNheight, &height, NULL);
UNBLOCK_INPUT;
- if (abs (position) >= height)
+ if (eabs (position) >= height)
part = (position < 0) ? scroll_bar_above_handle : scroll_bar_below_handle;
/* If Xaw3d was compiled with ARROW_SCROLLBAR,
it maps line-movement to call_data = max(5, height/20). */
- else if (xaw3d_arrow_scroll && abs (position) <= max (5, height / 20))
+ else if (xaw3d_arrow_scroll && eabs (position) <= max (5, height / 20))
part = (position < 0) ? scroll_bar_up_arrow : scroll_bar_down_arrow;
else
part = scroll_bar_move_ratio;
@@ -9044,7 +9044,8 @@ x_sync_with_move (f, left, top, fuzzy)
/* The left fuzz-factor is 10 pixels. The top fuzz-factor is 40
pixels. */
- if (abs (current_left - left) <= 10 && abs (current_top - top) <= 40)
+ if (eabs (current_left - left) <= 10
+ && eabs (current_top - top) <= 40)
return;
}
else if (current_left == left && current_top == top)