+2008-02-07 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xselect.c (x_handle_dnd_message):
+ * xmenu.c (digest_single_submenu, xmenu_show):
+ * xdisp.c (with_echo_area_buffer_unwind_data)
+ (format_mode_line_unwind_data, unwind_format_mode_line)
+ (display_menu_bar):
+ * eval.c (Ffetch_bytecode):
+ * doc.c (store_function_docstring):
+ * ccl.c (resolve_symbol_ccl_program, ccl_get_compiled_code)
+ (Fccl_execute, Fccl_execute_on_string, Fregister_code_conversion_map):
+ * buffer.c (add_overlay_mod_hooklist): Use ASET.
+
2008-02-07 Kenichi Handa <handa@m17n.org>
* ftxfont.c (ftxfont_open): Don't set
* w32font.c (w32font_text_extents): Fill in lbearing metric.
Use cached metrics for ASCII characters.
- (w32font_open_internal): Don't set font's owning_frame. Cache
- metrics for ASCII characters.
+ (w32font_open_internal): Don't set font's owning_frame.
+ Cache metrics for ASCII characters.
* w32font.h (struct w32font_info): Add ascii_metrics.
Remove owning_frame.
* ftxfont.c (ftxfont_draw): Use s->font_info, not face->font_info.
- * ftfont.c (ftfont_open): Fix calculation of
- font->font.averange_width.
+ * ftfont.c (ftfont_open): Fix calculation of font->font.average_width.
* charset.c (syms_of_charset): Set QCtest and Qeq.
if (last_overlay_modification_hooks_used == 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;
+ ASET (last_overlay_modification_hooks, last_overlay_modification_hooks_used,
+ functionlist); last_overlay_modification_hooks_used++;
+ ASET (last_overlay_modification_hooks, last_overlay_modification_hooks_used,
+ overlay); last_overlay_modification_hooks_used++;
}
\f
/* Run the modification-hooks of overlays that include
val = Fget (XCAR (contents), XCDR (contents));
if (NATNUMP (val))
- AREF (result, i) = val;
+ ASET (result, i, val);
else
unresolved = 1;
continue;
val = Fget (contents, Qtranslation_table_id);
if (NATNUMP (val))
- AREF (result, i) = val;
+ ASET (result, i, val);
else
{
val = Fget (contents, Qcode_conversion_map_id);
if (NATNUMP (val))
- AREF (result, i) = val;
+ ASET (result, i, val);
else
{
val = Fget (contents, Qccl_program_idx);
if (NATNUMP (val))
- AREF (result, i) = val;
+ ASET (result, i, val);
else
unresolved = 1;
}
val = resolve_symbol_ccl_program (AREF (slot, 1));
if (! VECTORP (val))
return Qnil;
- AREF (slot, 1) = val;
- AREF (slot, 2) = Qt;
+ ASET (slot, 1, val);
+ ASET (slot, 2, Qt);
}
return AREF (slot, 1);
}
error ("Error in CCL program at %dth code", ccl.ic);
for (i = 0; i < 8; i++)
- XSETINT (AREF (reg, i), ccl.reg[i]);
+ ASET (reg, i, make_number (ccl.reg[i]));
return Qnil;
}
for (i = 0; i < 8; i++)
{
if (NILP (AREF (status, i)))
- XSETINT (AREF (status, i), 0);
+ ASET (status, i, make_number (0));
if (INTEGERP (AREF (status, i)))
ccl.reg[i] = XINT (AREF (status, i));
}
index = make_number (i);
Fput (symbol, Qcode_conversion_map, map);
Fput (symbol, Qcode_conversion_map_id, index);
- AREF (Vcode_conversion_map_vector, i) = Fcons (symbol, map);
+ ASET (Vcode_conversion_map_vector, i, Fcons (symbol, map));
return index;
}
/* This bytecode object must have a slot for the
docstring, since we've found a docstring for it. */
if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_DOC_STRING)
- XSETFASTINT (AREF (fun, COMPILED_DOC_STRING), offset);
+ ASET (fun, COMPILED_DOC_STRING, make_number (offset));
}
}
else
error ("Invalid byte code");
}
- AREF (object, COMPILED_BYTECODE) = XCAR (tem);
- AREF (object, COMPILED_CONSTANTS) = XCDR (tem);
+ ASET (object, COMPILED_BYTECODE, XCAR (tem));
+ ASET (object, COMPILED_CONSTANTS, XCDR (tem));
}
return object;
}
struct window *w;
{
int i = 0;
- Lisp_Object vector;
+ Lisp_Object vector, tmp;
/* Reduce consing by keeping one vector in
Vwith_echo_area_save_vector. */
if (NILP (vector))
vector = Fmake_vector (make_number (7), Qnil);
- XSETBUFFER (AREF (vector, i), current_buffer); ++i;
- AREF (vector, i) = Vdeactivate_mark, ++i;
- AREF (vector, i) = make_number (windows_or_buffers_changed), ++i;
+ XSETBUFFER (tmp, current_buffer); ASET (vector, i, tmp); ++i;
+ ASET (vector, i, Vdeactivate_mark); ++i;
+ ASET (vector, i, make_number (windows_or_buffers_changed)); ++i;
if (w)
{
- XSETWINDOW (AREF (vector, i), w); ++i;
- AREF (vector, i) = w->buffer; ++i;
- AREF (vector, i) = make_number (XMARKER (w->pointm)->charpos); ++i;
- AREF (vector, i) = make_number (XMARKER (w->pointm)->bytepos); ++i;
+ XSETWINDOW (tmp, w); ASET (vector, i, tmp); ++i;
+ ASET (vector, i, w->buffer); ++i;
+ ASET (vector, i, make_number (XMARKER (w->pointm)->charpos)); ++i;
+ ASET (vector, i, make_number (XMARKER (w->pointm)->bytepos)); ++i;
}
else
{
int end = i + 4;
for (; i < end; ++i)
- AREF (vector, i) = Qnil;
+ ASET (vector, i, Qnil);
}
xassert (i == ASIZE (vector));
format_mode_line_unwind_data (obuf, save_proptrans)
struct buffer *obuf;
{
- Lisp_Object vector;
+ Lisp_Object vector, tmp;
/* Reduce consing by keeping one vector in
Vwith_echo_area_save_vector. */
if (NILP (vector))
vector = Fmake_vector (make_number (7), Qnil);
- AREF (vector, 0) = make_number (mode_line_target);
- AREF (vector, 1) = make_number (MODE_LINE_NOPROP_LEN (0));
- AREF (vector, 2) = mode_line_string_list;
- AREF (vector, 3) = (save_proptrans ? mode_line_proptrans_alist : Qt);
- AREF (vector, 4) = mode_line_string_face;
- AREF (vector, 5) = mode_line_string_face_prop;
+ ASET (vector, 0, make_number (mode_line_target));
+ ASET (vector, 1, make_number (MODE_LINE_NOPROP_LEN (0)));
+ ASET (vector, 2, mode_line_string_list);
+ ASET (vector, 3, save_proptrans ? mode_line_proptrans_alist : Qt);
+ ASET (vector, 4, mode_line_string_face);
+ ASET (vector, 5, mode_line_string_face_prop);
if (obuf)
- XSETBUFFER (AREF (vector, 6), obuf);
+ XSETBUFFER (tmp, obuf);
else
- AREF (vector, 6) = Qnil;
+ tmp = Qnil;
+ ASET (vector, 6, tmp);
return vector;
}
if (!NILP (AREF (vector, 6)))
{
set_buffer_internal_1 (XBUFFER (AREF (vector, 6)));
- AREF (vector, 6) = Qnil;
+ ASET (vector, 6, Qnil);
}
Vmode_line_unwind_vector = vector;
break;
/* Remember where item was displayed. */
- AREF (items, i + 3) = make_number (it.hpos);
+ ASET (items, i + 3, make_number (it.hpos));
/* Display the item, pad with one space. */
if (it.current_x < it.last_visible_x)
if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name))
{
pane_name = ENCODE_MENU_STRING (pane_name);
- AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name;
+ ASET (menu_items, i + MENU_ITEMS_PANE_NAME, pane_name);
}
#endif
pane_string = (NILP (pane_name)
if (STRING_MULTIBYTE (item_name))
{
item_name = ENCODE_MENU_STRING (item_name);
- AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name;
+ ASET (menu_items, i + MENU_ITEMS_ITEM_NAME, item_name);
}
if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
{
descrip = ENCODE_MENU_STRING (descrip);
- AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip;
+ ASET (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY, descrip);
}
#endif /* not HAVE_MULTILINGUAL_MENU */
if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name))
{
pane_name = ENCODE_MENU_STRING (pane_name);
- AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name;
+ ASET (menu_items, i + MENU_ITEMS_PANE_NAME, pane_name);
}
#endif
pane_string = (NILP (pane_name)
if (STRINGP (item_name) && STRING_MULTIBYTE (item_name))
{
item_name = ENCODE_MENU_STRING (item_name);
- AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name;
+ ASET (menu_items, i + MENU_ITEMS_ITEM_NAME, item_name);
}
if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
{
descrip = ENCODE_MENU_STRING (descrip);
- AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip;
+ ASET (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY, descrip);
}
#endif /* not HAVE_MULTILINGUAL_MENU */
}
vec = Fmake_vector (make_number (4), Qnil);
- AREF (vec, 0) = SYMBOL_NAME (x_atom_to_symbol (FRAME_X_DISPLAY (f),
- event->message_type));
- AREF (vec, 1) = frame;
- AREF (vec, 2) = make_number (event->format);
- AREF (vec, 3) = x_property_data_to_lisp (f,
- data,
- event->message_type,
- event->format,
- size);
+ ASET (vec, 0, SYMBOL_NAME (x_atom_to_symbol (FRAME_X_DISPLAY (f),
+ event->message_type)));
+ ASET (vec, 1, frame);
+ ASET (vec, 2, make_number (event->format));
+ ASET (vec, 3, x_property_data_to_lisp (f,
+ data,
+ event->message_type,
+ event->format,
+ size));
mouse_position_for_drop (f, &x, &y);
bufp->kind = DRAG_N_DROP_EVENT;