unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Emacs Hackers <emacs-devel@gnu.org>
Subject: Patch: AREF -vs- ASET
Date: 01 Feb 2007 19:46:29 -0700	[thread overview]
Message-ID: <m3ps8tmg3e.fsf@localhost.localdomain> (raw)

I noticed that Emacs has both AREF and ASET macros, but they are not
consistently used.  Sometimes ASET is used to set an array element,
but sometimes AREF is used instead.

This patch mostly changes Emacs to use ASET rather than AREF.  I chose
this, rather than removing ASET, because using a settor macro like
ASET allows the future possibility of a write barrier, needed for some
kinds of GC.

Unfortunately it is not possible to change AREF to use
LISP_MAKE_RVALUE, because there is code like:

  XSETBUFFER (AREF (vector, i), current_buffer);

... but, more importantly, macros like LFACE_HEIGHT, which expand to
AREF and for which there is no "SET" equivalent.

These problems are fixable, of course.  But is this the direction the
Emacs maintainers want to go?

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* xselect.c (x_handle_dnd_message): Use ASET.
	* xmenu.c (digest_single_submenu): Use ASET.
	(xmenu_show): Likewise.
	* xfaces.c (Finternal_make_lisp_face): Use ASET.
	* xdisp.c (with_echo_area_buffer_unwind_data): Use ASET.
	(format_mode_line_unwind_data): Likewise.
	(unwind_format_mode_line): Likewise.
	(display_menu_bar): Likewise.
	* macmenu.c (digest_single_submenu): Use ASET.
	(mac_menu_show): Likewise.
	* keyboard.c (add_command_key): Use ASET.
	(parse_menu_item): Likewise.
	* fontset.c (make_fontset): Use ASET.
	(free_face_fontset): Likewise.
	(Ffontset_info): Likewise.
	(syms_of_fontset): Likewise.
	* fns.c (concat): Use ASET.
	(hash_clear): Likewise.
	* eval.c (Ffetch_bytecode): Use ASET.
	* ccl.c (resolve_symbol_ccl_program): Use ASET.
	(ccl_get_compiled_code): Likewise.
	(Fregister_code_conversion_map): Likewise.
	* buffer.c (add_overlay_mod_hooklist): Use ASET.

Index: buffer.c
===================================================================
RCS file: /sources/emacs/emacs/src/buffer.c,v
retrieving revision 1.521
diff -u -r1.521 buffer.c
--- buffer.c 21 Jan 2007 04:18:17 -0000 1.521
+++ buffer.c 2 Feb 2007 04:44:47 -0000
@@ -4185,8 +4185,12 @@
 	     XVECTOR (last_overlay_modification_hooks)->contents,
 	     sizeof (Lisp_Object) * oldsize);
     }
-  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);
+  ASET (last_overlay_modification_hooks,
+	last_overlay_modification_hooks_used++,
+	overlay);
 }
 \f
 /* Run the modification-hooks of overlays that include
Index: ccl.c
===================================================================
RCS file: /sources/emacs/emacs/src/ccl.c,v
retrieving revision 1.96
diff -u -r1.96 ccl.c
--- ccl.c 21 Jan 2007 04:18:16 -0000 1.96
+++ ccl.c 2 Feb 2007 04:44:49 -0000
@@ -1988,7 +1988,7 @@
 
 	  val = Fget (XCAR (contents), XCDR (contents));
 	  if (NATNUMP (val))
-	    AREF (result, i) = val;
+	    ASET (result, i, val);
 	  else
 	    unresolved = 1;
 	  continue;
@@ -2003,17 +2003,17 @@
 
 	  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;
 		}
@@ -2063,8 +2063,8 @@
       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);
 }
@@ -2421,15 +2421,14 @@
       int j;
 
       for (j = 0; j < len; j++)
-	AREF (new_vector, j)
-	  = AREF (Vcode_conversion_map_vector, j);
+	ASET (new_vector, j, AREF (Vcode_conversion_map_vector, j));
       Vcode_conversion_map_vector = new_vector;
     }
 
   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;
 }
 
Index: eval.c
===================================================================
RCS file: /sources/emacs/emacs/src/eval.c,v
retrieving revision 1.276
diff -u -r1.276 eval.c
--- eval.c 21 Jan 2007 04:18:16 -0000 1.276
+++ eval.c 2 Feb 2007 04:44:54 -0000
@@ -1238,7 +1238,7 @@
    the handler stack as we go, so that the proper handlers are in
    effect for each unwind-protect clause we run.  At the end, restore
    some static info saved in CATCH, and longjmp to the location
-   specified in the
+   specified there.
 
    This is used for correct unwinding in Fthrow and Fsignal.  */
 
@@ -3208,8 +3208,8 @@
 	  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;
 }
Index: fns.c
===================================================================
RCS file: /sources/emacs/emacs/src/fns.c,v
retrieving revision 1.424
diff -u -r1.424 fns.c
--- fns.c 21 Jan 2007 04:18:16 -0000 1.424
+++ fns.c 2 Feb 2007 04:44:59 -0000
@@ -780,7 +780,7 @@
 		tail = XCDR (tail);
 	      }
 	    else if (VECTORP (val))
-	      AREF (val, toindex++) = elt;
+	      ASET (val, toindex++, elt);
 	    else
 	      {
 		CHECK_NUMBER (elt);
@@ -4863,7 +4863,7 @@
 	}
 
       for (i = 0; i < ASIZE (h->index); ++i)
-	AREF (h->index, i) = Qnil;
+	ASET (h->index, i, Qnil);
 
       h->next_free = make_number (0);
       h->count = make_number (0);
Index: fontset.c
===================================================================
RCS file: /sources/emacs/emacs/src/fontset.c,v
retrieving revision 1.103
diff -u -r1.103 fontset.c
--- fontset.c 21 Jan 2007 20:49:43 -0000 1.103
+++ fontset.c 2 Feb 2007 04:45:00 -0000
@@ -396,7 +396,7 @@
 
       tem = Fmake_vector (make_number (size + 8), Qnil);
       for (i = 0; i < size; i++)
-	AREF (tem, i) = AREF (Vfontset_table, i);
+	ASET (tem, i, AREF (Vfontset_table, i));
       Vfontset_table = tem;
     }
 
@@ -407,7 +407,7 @@
   FONTSET_FRAME (fontset) = frame;
   FONTSET_BASE (fontset) = base;
 
-  AREF (Vfontset_table, id) = fontset;
+  ASET (Vfontset_table, id, fontset);
   next_fontset_id = id + 1;
   return fontset;
 }
@@ -493,7 +493,7 @@
 {
   if (fontset_id_valid_p (face->fontset))
     {
-      AREF (Vfontset_table, face->fontset) = Qnil;
+      ASET (Vfontset_table, face->fontset, Qnil);
       if (face->fontset < next_fontset_id)
 	next_fontset_id = face->fontset;
     }
@@ -1528,8 +1528,8 @@
       fontp = (*query_font_func) (f, SDATA (elt));
     }
   val = Fmake_vector (make_number (3), val);
-  AREF (val, 0) = fontp ? make_number (fontp->size) : make_number (0);
-  AREF (val, 1) = fontp ? make_number (fontp->height) : make_number (0);
+  ASET (val, 0, fontp ? make_number (fontp->size) : make_number (0));
+  ASET (val, 1, fontp ? make_number (fontp->height) : make_number (0));
   return val;
 }
 
@@ -1653,7 +1653,7 @@
   FONTSET_ID (Vdefault_fontset) = make_number (0);
   FONTSET_NAME (Vdefault_fontset)
     = build_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default");
-  AREF (Vfontset_table, 0) = Vdefault_fontset;
+  ASET (Vfontset_table, 0, Vdefault_fontset);
   next_fontset_id = 1;
 
   Voverriding_fontspec_alist = Qnil;
Index: keyboard.c
===================================================================
RCS file: /sources/emacs/emacs/src/keyboard.c,v
retrieving revision 1.892
diff -u -r1.892 keyboard.c
--- keyboard.c 27 Jan 2007 18:18:31 -0000 1.892
+++ keyboard.c 2 Feb 2007 04:45:20 -0000
@@ -966,7 +966,7 @@
 				       2 * ASIZE (this_command_keys),
 				       Qnil);
 
-  AREF (this_command_keys, this_command_key_count) = key;
+  ASET (this_command_keys, this_command_key_count, key);
   ++this_command_key_count;
 }
 
@@ -7468,11 +7468,11 @@
 
   /* Initialize optional entries.  */
   for (i = ITEM_PROPERTY_DEF; i < ITEM_PROPERTY_ENABLE; i++)
-    AREF (item_properties, i) = Qnil;
-  AREF (item_properties, ITEM_PROPERTY_ENABLE) = Qt;
+    ASET (item_properties, i, Qnil);
+  ASET (item_properties, ITEM_PROPERTY_ENABLE, Qt);
 
   /* Save the item here to protect it from GC.  */
-  AREF (item_properties, ITEM_PROPERTY_ITEM) = item;
+  ASET (item_properties, ITEM_PROPERTY_ITEM, item);
 
   item_string = XCAR (item);
 
@@ -7481,12 +7481,12 @@
   if (STRINGP (item_string))
     {
       /* Old format menu item.  */
-      AREF (item_properties, ITEM_PROPERTY_NAME) = item_string;
+      ASET (item_properties, ITEM_PROPERTY_NAME, item_string);
 
       /* Maybe help string.  */
       if (CONSP (item) && STRINGP (XCAR (item)))
 	{
-	  AREF (item_properties, ITEM_PROPERTY_HELP) = XCAR (item);
+	  ASET (item_properties, ITEM_PROPERTY_HELP, XCAR (item));
 	  start = item;
 	  item = XCDR (item);
 	}
@@ -7501,27 +7501,27 @@
 	}
 
       /* This is the real definition--the function to run.  */
-      AREF (item_properties, ITEM_PROPERTY_DEF) = item;
+      ASET (item_properties, ITEM_PROPERTY_DEF, item);
 
       /* Get enable property, if any.  */
       if (SYMBOLP (item))
 	{
 	  tem = Fget (item, Qmenu_enable);
 	  if (!NILP (Venable_disabled_menus_and_buttons))
-	    AREF (item_properties, ITEM_PROPERTY_ENABLE) = Qt;
+	    ASET (item_properties, ITEM_PROPERTY_ENABLE, Qt);
 	  else if (!NILP (tem))
-	    AREF (item_properties, ITEM_PROPERTY_ENABLE) = tem;
+	    ASET (item_properties, ITEM_PROPERTY_ENABLE, tem);
 	}
     }
   else if (EQ (item_string, Qmenu_item) && CONSP (item))
     {
       /* New format menu item.  */
-      AREF (item_properties, ITEM_PROPERTY_NAME) = XCAR (item);
+      ASET (item_properties, ITEM_PROPERTY_NAME, XCAR (item));
       start = XCDR (item);
       if (CONSP (start))
 	{
 	  /* We have a real binding.  */
-	  AREF (item_properties, ITEM_PROPERTY_DEF) = XCAR (start);
+	  ASET (item_properties, ITEM_PROPERTY_DEF, XCAR (start));
 
 	  item = XCDR (start);
 	  /* Is there a cache list with key equivalences. */
@@ -7540,9 +7540,9 @@
 	      if (EQ (tem, QCenable))
 		{
 		  if (!NILP (Venable_disabled_menus_and_buttons))
-		    AREF (item_properties, ITEM_PROPERTY_ENABLE) = Qt;
+		    ASET (item_properties, ITEM_PROPERTY_ENABLE, Qt);
 		  else
-		    AREF (item_properties, ITEM_PROPERTY_ENABLE) = XCAR (item);
+		    ASET (item_properties, ITEM_PROPERTY_ENABLE, XCAR (item));
 		}
 	      else if (EQ (tem, QCvisible) && !notreal)
 		{
@@ -7553,7 +7553,7 @@
 		    return 0;
 	 	}
 	      else if (EQ (tem, QChelp))
-		AREF (item_properties, ITEM_PROPERTY_HELP) = XCAR (item);
+		ASET (item_properties, ITEM_PROPERTY_HELP, XCAR (item));
 	      else if (EQ (tem, QCfilter))
 		filter = item;
 	      else if (EQ (tem, QCkey_sequence))
@@ -7568,7 +7568,7 @@
 		{
 		  tem = XCAR (item);
 		  if (CONSP (tem) || (STRINGP (tem) && NILP (cachelist)))
-		    AREF (item_properties, ITEM_PROPERTY_KEYEQ) = tem;
+		    ASET (item_properties, ITEM_PROPERTY_KEYEQ, tem);
 		}
 	      else if (EQ (tem, QCbutton) && CONSP (XCAR (item)))
 		{
@@ -7577,10 +7577,10 @@
 		  type = XCAR (tem);
 		  if (EQ (type, QCtoggle) || EQ (type, QCradio))
 		    {
-		      AREF (item_properties, ITEM_PROPERTY_SELECTED)
-			= XCDR (tem);
-		      AREF (item_properties, ITEM_PROPERTY_TYPE)
-			= type;
+		      ASET (item_properties, ITEM_PROPERTY_SELECTED,
+			    XCDR (tem));
+		      ASET (item_properties, ITEM_PROPERTY_TYPE,
+			    type);
 		    }
 		}
 	      item = XCDR (item);
@@ -7600,7 +7600,7 @@
       item_string = menu_item_eval_property (item_string);
       if (!STRINGP (item_string))
 	return 0;
-      AREF (item_properties, ITEM_PROPERTY_NAME) = item_string;
+      ASET (item_properties, ITEM_PROPERTY_NAME, item_string);
     }
 
   /* If got a filter apply it on definition.  */
@@ -7610,7 +7610,7 @@
       def = menu_item_eval_property (list2 (XCAR (filter),
 					    list2 (Qquote, def)));
 
-      AREF (item_properties, ITEM_PROPERTY_DEF) = def;
+      ASET (item_properties, ITEM_PROPERTY_DEF, def);
     }
 
   /* Enable or disable selection of item.  */
@@ -7623,7 +7623,7 @@
 	tem = menu_item_eval_property (tem);
       if (inmenubar && NILP (tem))
 	return 0;		/* Ignore disabled items in menu bar.  */
-      AREF (item_properties, ITEM_PROPERTY_ENABLE) = tem;
+      ASET (item_properties, ITEM_PROPERTY_ENABLE, tem);
     }
 
   /* If we got no definition, this item is just unselectable text which
@@ -7637,8 +7637,8 @@
   /* For a subkeymap, just record its details and exit.  */
   if (CONSP (tem))
     {
-      AREF (item_properties, ITEM_PROPERTY_MAP) = tem;
-      AREF (item_properties, ITEM_PROPERTY_DEF) = tem;
+      ASET (item_properties, ITEM_PROPERTY_MAP, tem);
+      ASET (item_properties, ITEM_PROPERTY_DEF, tem);
       return 1;
     }
 
@@ -7761,7 +7761,7 @@
     return 1;
 
   /* If we have an equivalent key binding, use that.  */
-  AREF (item_properties, ITEM_PROPERTY_KEYEQ) = tem;
+  ASET (item_properties, ITEM_PROPERTY_KEYEQ, tem);
 
   /* Include this when menu help is implemented.
   tem = XVECTOR (item_properties)->contents[ITEM_PROPERTY_HELP];
@@ -7777,8 +7777,8 @@
   /* Handle radio buttons or toggle boxes.  */
   tem = AREF (item_properties, ITEM_PROPERTY_SELECTED);
   if (!NILP (tem))
-    AREF (item_properties, ITEM_PROPERTY_SELECTED)
-      = menu_item_eval_property (tem);
+    ASET (item_properties, ITEM_PROPERTY_SELECTED,
+	  menu_item_eval_property (tem));
 
   return 1;
 }
Index: macmenu.c
===================================================================
RCS file: /sources/emacs/emacs/src/macmenu.c,v
retrieving revision 1.54
diff -u -r1.54 macmenu.c
--- macmenu.c 21 Jan 2007 04:18:15 -0000 1.54
+++ macmenu.c 2 Feb 2007 04:45:29 -0000
@@ -1417,7 +1417,7 @@
 	  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)
@@ -1473,13 +1473,13 @@
           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 */
 
@@ -2085,7 +2085,7 @@
 	  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)
@@ -2139,13 +2139,13 @@
           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 */
 
Index: xdisp.c
===================================================================
RCS file: /sources/emacs/emacs/src/xdisp.c,v
retrieving revision 1.1139
diff -u -r1.1139 xdisp.c
--- xdisp.c 21 Jan 2007 23:29:20 -0000 1.1139
+++ xdisp.c 2 Feb 2007 04:46:00 -0000
@@ -7967,21 +7967,21 @@
     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;
+  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;
+      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));
@@ -8844,17 +8844,17 @@
   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);
   else
-    AREF (vector, 6) = Qnil;
+    ASET (vector, 6, Qnil);
 
   return vector;
 }
@@ -8874,7 +8874,7 @@
   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;
@@ -16475,7 +16475,7 @@
 	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)
Index: xfaces.c
===================================================================
RCS file: /sources/emacs/emacs/src/xfaces.c,v
retrieving revision 1.358
diff -u -r1.358 xfaces.c
--- xfaces.c 21 Jan 2007 04:18:14 -0000 1.358
+++ xfaces.c 2 Feb 2007 04:46:11 -0000
@@ -3866,7 +3866,7 @@
     {
       global_lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE),
 				   Qunspecified);
-      AREF (global_lface, 0) = Qface;
+      ASET (global_lface, 0, Qface);
       Vface_new_frame_defaults = Fcons (Fcons (face, global_lface),
 					Vface_new_frame_defaults);
 
@@ -3888,7 +3888,7 @@
     }
   else if (f == NULL)
     for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
-      AREF (global_lface, i) = Qunspecified;
+      ASET (global_lface, i, Qunspecified);
 
   /* Add a frame-local definition.  */
   if (f)
@@ -3897,12 +3897,12 @@
 	{
 	  lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE),
 				Qunspecified);
-	  AREF (lface, 0) = Qface;
+	  ASET (lface, 0, Qface);
 	  f->face_alist = Fcons (Fcons (face, lface), f->face_alist);
 	}
       else
 	for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
-	  AREF (lface, i) = Qunspecified;
+	  ASET (lface, i, Qunspecified);
     }
   else
     lface = global_lface;
Index: xmenu.c
===================================================================
RCS file: /sources/emacs/emacs/src/xmenu.c,v
retrieving revision 1.317
diff -u -r1.317 xmenu.c
--- xmenu.c 21 Jan 2007 04:18:14 -0000 1.317
+++ xmenu.c 2 Feb 2007 04:46:15 -0000
@@ -1934,7 +1934,7 @@
 	  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)
@@ -1990,13 +1990,13 @@
           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 */
 
@@ -2898,7 +2898,7 @@
 	  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)
@@ -2952,13 +2952,13 @@
           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 */
 
Index: xselect.c
===================================================================
RCS file: /sources/emacs/emacs/src/xselect.c,v
retrieving revision 1.167
diff -u -r1.167 xselect.c
--- xselect.c 21 Jan 2007 04:18:14 -0000 1.167
+++ xselect.c 2 Feb 2007 04:46:19 -0000
@@ -2765,15 +2765,15 @@
     }
 
   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;

             reply	other threads:[~2007-02-02  2:46 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-02  2:46 Tom Tromey [this message]
2007-02-02  9:58 ` Patch: AREF -vs- ASET Sascha Wilde
2007-02-02 11:35   ` Miles Bader
2007-02-02 16:31     ` Sascha Wilde
2007-02-02 15:33 ` Stefan Monnier
2007-02-02 20:37 ` Richard Stallman
2007-02-03 11:02   ` Eli Zaretskii
2007-02-03 22:43     ` Richard Stallman
2007-02-04  4:06       ` Eli Zaretskii
2007-02-05  0:22         ` Richard Stallman
2007-02-06  8:59           ` copyrights to be fixed [was Re: Patch: AREF -vs- ASET] Glenn Morris
2007-02-06  9:47             ` copyrights to be fixed Glenn Morris
2007-02-06 23:05             ` Chong Yidong
2007-02-06 23:20               ` Miles Bader
2007-02-06 23:44                 ` Chong Yidong
2007-02-07 19:41                   ` Richard Stallman
2007-02-07 21:06                     ` Chong Yidong
2007-02-07 21:32                       ` Stuart D. Herring
2007-02-08  0:38                         ` Glenn Morris
2007-02-16 21:33                           ` Reiner Steib
2007-02-17  7:24                             ` Richard Stallman
2007-02-08 19:45                       ` Richard Stallman
2007-02-12 21:20                 ` Chong Yidong
2007-02-13 16:27                   ` Richard Stallman
2007-02-13 16:47                     ` Chong Yidong
2007-02-14  4:10                       ` Richard Stallman
2007-02-16 21:28                   ` Reiner Steib
2007-02-07  1:37               ` Richard Stallman
2007-02-07 17:40                 ` Jesper Harder
2007-02-08 19:45                   ` Richard Stallman
2007-02-11 20:18                     ` Jesper Harder
2007-02-12 17:53                       ` Richard Stallman
2007-02-06 23:15             ` copyrights to be fixed [was Re: Patch: AREF -vs- ASET] Richard Stallman
2007-02-06 23:39               ` Nick Roberts
2007-02-08  0:44                 ` copyrights to be fixed Glenn Morris
2007-02-08  2:31                   ` Nick Roberts
2007-02-11  1:45                     ` Glenn Morris
2007-02-07 23:01             ` Chong Yidong
2007-02-08  2:27               ` Glenn Morris
2007-02-08  4:21                 ` Chong Yidong
2007-02-08 19:46               ` Richard Stallman
2007-02-08 21:32                 ` Chong Yidong
2007-02-09 14:22                   ` Richard Stallman
2007-02-09 23:49                   ` Richard Stallman
2007-02-10  0:14                     ` Chong Yidong
2007-02-08 21:34                 ` Kim F. Storm
2007-02-08 23:36                   ` Paul Pogonyshev
2007-02-09  7:13                     ` David Kastrup
2007-02-09  9:47                       ` Romain Francoise
2007-02-09 15:00                         ` Stefan Monnier
2007-02-09 15:11                           ` joakim
2007-02-10 17:40                           ` Richard Stallman
2007-02-10 18:46                             ` Robert J. Chassell
2007-02-11 10:54                               ` Richard Stallman
2007-02-11 13:18                                 ` joakim
2007-02-11 14:00                                   ` David Kastrup
2007-02-11 14:53                                     ` Jan Djärv
2007-02-12 17:52                                       ` Richard Stallman
2007-02-13 18:30                                         ` multi-tty branch + GTK (Re: copyrights to be fixed) Károly Lo"rentey
2007-02-14 17:45                                           ` Richard Stallman
2007-02-15 11:32                                             ` Karoly Lorentey
2007-02-15 12:45                                               ` Jan Djärv
2007-02-15 12:57                                                 ` David Kastrup
2007-02-15 13:24                                                   ` Jan Djärv
2007-02-16  0:26                                               ` Richard Stallman
2007-02-16  7:22                                                 ` Jan Djärv
2007-02-11 20:22                                   ` copyrights to be fixed Stefan Monnier
2007-02-11  1:28                             ` Mark Plaksin
2007-02-11  2:39                             ` Manoj Srivastava
2007-02-11  9:30                             ` Dan Nicolaescu
2007-02-11 10:21                               ` David Kastrup
2007-02-13 18:51                                 ` Multi-tty merge plan (Re: copyrights to be fixed) Károly Lőrentey
2007-02-12  4:54                               ` copyrights to be fixed Richard Stallman
2007-02-13 18:29                                 ` Multi-tty vs. non-Un*x ports (Re: copyrights to be fixed) Károly Lo"rentey
2007-02-14 17:44                                   ` Richard Stallman
2007-02-09 16:09                       ` copyrights to be fixed Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ps8tmg3e.fsf@localhost.localdomain \
    --to=tromey@redhat.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).