aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-10-05 09:51:48 +0000
committerGerd Moellmann2001-10-05 09:51:48 +0000
commita97569cbf284dc18f285174194de1fa55cc3ee3a (patch)
tree9768a384073b66ad294bda3b5f889cbeb23559ac
parenta9dff54b9422ed37535789a2095c3d721e8dcba9 (diff)
downloademacs-a97569cbf284dc18f285174194de1fa55cc3ee3a.tar.gz
emacs-a97569cbf284dc18f285174194de1fa55cc3ee3a.zip
Use SYMBOL_VALUE/ SET_SYMBOL_VALUE macros instead of accessing
symbols' value directly.
-rw-r--r--src/abbrev.c26
-rw-r--r--src/sunfns.c4
-rw-r--r--src/w16select.c6
3 files changed, 19 insertions, 17 deletions
diff --git a/src/abbrev.c b/src/abbrev.c
index f30986db343..06bb1f98e5e 100644
--- a/src/abbrev.c
+++ b/src/abbrev.c
@@ -1,5 +1,6 @@
1/* Primitives for word-abbrev mode. 1/* Primitives for word-abbrev mode.
2 Copyright (C) 1985, 1986, 1993, 1996, 1998 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1993, 1996, 1998, 2001
3 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -128,7 +129,7 @@ which is incremented each time the abbrev is used.")
128 129
129 sym = Fintern (name, table); 130 sym = Fintern (name, table);
130 131
131 oexp = XSYMBOL (sym)->value; 132 oexp = SYMBOL_VALUE (sym);
132 ohook = XSYMBOL (sym)->function; 133 ohook = XSYMBOL (sym)->function;
133 if (!((EQ (oexp, expansion) 134 if (!((EQ (oexp, expansion)
134 || (STRINGP (oexp) && STRINGP (expansion) 135 || (STRINGP (oexp) && STRINGP (expansion)
@@ -189,12 +190,13 @@ The default is to try buffer's mode-specific abbrev table, then global table.")
189 sym = Qnil; 190 sym = Qnil;
190 if (!NILP (current_buffer->abbrev_table)) 191 if (!NILP (current_buffer->abbrev_table))
191 sym = Fintern_soft (abbrev, current_buffer->abbrev_table); 192 sym = Fintern_soft (abbrev, current_buffer->abbrev_table);
192 if (NILP (XSYMBOL (sym)->value)) 193 if (NILP (SYMBOL_VALUE (sym)))
193 sym = Qnil; 194 sym = Qnil;
194 if (NILP (sym)) 195 if (NILP (sym))
195 sym = Fintern_soft (abbrev, Vglobal_abbrev_table); 196 sym = Fintern_soft (abbrev, Vglobal_abbrev_table);
196 } 197 }
197 if (NILP (XSYMBOL (sym)->value)) return Qnil; 198 if (NILP (SYMBOL_VALUE (sym)))
199 return Qnil;
198 return sym; 200 return sym;
199} 201}
200 202
@@ -290,10 +292,10 @@ Returns the abbrev symbol, if expansion took place.")
290 wordend - wordstart, wordend_byte - wordstart_byte); 292 wordend - wordstart, wordend_byte - wordstart_byte);
291 else 293 else
292 XSETFASTINT (sym, 0); 294 XSETFASTINT (sym, 0);
293 if (INTEGERP (sym) || NILP (XSYMBOL (sym)->value)) 295 if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym)))
294 sym = oblookup (Vglobal_abbrev_table, buffer, 296 sym = oblookup (Vglobal_abbrev_table, buffer,
295 wordend - wordstart, wordend_byte - wordstart_byte); 297 wordend - wordstart, wordend_byte - wordstart_byte);
296 if (INTEGERP (sym) || NILP (XSYMBOL (sym)->value)) 298 if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym)))
297 return value; 299 return value;
298 300
299 if (INTERACTIVE && !EQ (minibuf_window, selected_window)) 301 if (INTERACTIVE && !EQ (minibuf_window, selected_window))
@@ -318,7 +320,7 @@ Returns the abbrev symbol, if expansion took place.")
318 320
319 /* If this abbrev has an expansion, delete the abbrev 321 /* If this abbrev has an expansion, delete the abbrev
320 and insert the expansion. */ 322 and insert the expansion. */
321 expansion = XSYMBOL (sym)->value; 323 expansion = SYMBOL_VALUE (sym);
322 if (STRINGP (expansion)) 324 if (STRINGP (expansion))
323 { 325 {
324 SET_PT (wordstart); 326 SET_PT (wordstart);
@@ -404,7 +406,7 @@ is not undone.")
404 Lisp_Object val; 406 Lisp_Object val;
405 int zv_before; 407 int zv_before;
406 408
407 val = XSYMBOL (Vlast_abbrev)->value; 409 val = SYMBOL_VALUE (Vlast_abbrev);
408 if (!STRINGP (val)) 410 if (!STRINGP (val))
409 error ("value of abbrev-symbol must be a string"); 411 error ("value of abbrev-symbol must be a string");
410 zv_before = ZV; 412 zv_before = ZV;
@@ -426,13 +428,13 @@ write_abbrev (sym, stream)
426 Lisp_Object sym, stream; 428 Lisp_Object sym, stream;
427{ 429{
428 Lisp_Object name; 430 Lisp_Object name;
429 if (NILP (XSYMBOL (sym)->value)) 431 if (NILP (SYMBOL_VALUE (sym)))
430 return; 432 return;
431 insert (" (", 5); 433 insert (" (", 5);
432 XSETSTRING (name, XSYMBOL (sym)->name); 434 XSETSTRING (name, XSYMBOL (sym)->name);
433 Fprin1 (name, stream); 435 Fprin1 (name, stream);
434 insert (" ", 1); 436 insert (" ", 1);
435 Fprin1 (XSYMBOL (sym)->value, stream); 437 Fprin1 (SYMBOL_VALUE (sym), stream);
436 insert (" ", 1); 438 insert (" ", 1);
437 Fprin1 (XSYMBOL (sym)->function, stream); 439 Fprin1 (XSYMBOL (sym)->function, stream);
438 insert (" ", 1); 440 insert (" ", 1);
@@ -446,14 +448,14 @@ describe_abbrev (sym, stream)
446{ 448{
447 Lisp_Object one; 449 Lisp_Object one;
448 450
449 if (NILP (XSYMBOL (sym)->value)) 451 if (NILP (SYMBOL_VALUE (sym)))
450 return; 452 return;
451 one = make_number (1); 453 one = make_number (1);
452 Fprin1 (Fsymbol_name (sym), stream); 454 Fprin1 (Fsymbol_name (sym), stream);
453 Findent_to (make_number (15), one); 455 Findent_to (make_number (15), one);
454 Fprin1 (XSYMBOL (sym)->plist, stream); 456 Fprin1 (XSYMBOL (sym)->plist, stream);
455 Findent_to (make_number (20), one); 457 Findent_to (make_number (20), one);
456 Fprin1 (XSYMBOL (sym)->value, stream); 458 Fprin1 (SYMBOL_VALUE (sym), stream);
457 if (!NILP (XSYMBOL (sym)->function)) 459 if (!NILP (XSYMBOL (sym)->function))
458 { 460 {
459 Findent_to (make_number (45), one); 461 Findent_to (make_number (45), one);
diff --git a/src/sunfns.c b/src/sunfns.c
index 065e2490828..c5261002576 100644
--- a/src/sunfns.c
+++ b/src/sunfns.c
@@ -1,5 +1,5 @@
1/* Functions for Sun Windows menus and selection buffer. 1/* Functions for Sun Windows menus and selection buffer.
2 Copyright (C) 1987, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1987, 1999, 2001 Free Software Foundation, Inc.
3 3
4This file is probably totally obsolete. In any case, the FSF is 4This file is probably totally obsolete. In any case, the FSF is
5unwilling to support it. We agreed to include it in our distribution 5unwilling to support it. We agreed to include it in our distribution
@@ -366,7 +366,7 @@ sun_item_create (Pair)
366 CHECK_STRING(String, 0); 366 CHECK_STRING(String, 0);
367 Value = Fcdr(Pair); 367 Value = Fcdr(Pair);
368 if (SYMBOLP (Value)) 368 if (SYMBOLP (Value))
369 Value = XSYMBOL(Value)->value; 369 Value = SYMBOL_VALUE (Value);
370 if (VECTORP (Value)) { 370 if (VECTORP (Value)) {
371 submenu = sun_menu_create (Value); 371 submenu = sun_menu_create (Value);
372 menu_item = menu_create_item 372 menu_item = menu_create_item
diff --git a/src/w16select.c b/src/w16select.c
index df739a1356c..f92e1a8c173 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -1,5 +1,5 @@
1/* 16-bit Windows Selection processing for emacs on MS-Windows 1/* 16-bit Windows Selection processing for emacs on MS-Windows
2 Copyright (C) 1996, 1997 Free Software Foundation. 2 Copyright (C) 1996, 1997, 2001 Free Software Foundation.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -714,8 +714,8 @@ and t is the same as `SECONDARY'.")
714 into the clipboard if we run under Windows, so we cannot check 714 into the clipboard if we run under Windows, so we cannot check
715 the clipboard alone.) */ 715 the clipboard alone.) */
716 if ((EQ (selection, Qnil) || EQ (selection, QPRIMARY)) 716 if ((EQ (selection, Qnil) || EQ (selection, QPRIMARY))
717 && ! NILP (XSYMBOL (Fintern_soft (build_string ("kill-ring"), 717 && ! NILP (SYMBOL_VALUE (Fintern_soft (build_string ("kill-ring"),
718 Qnil))->value)) 718 Qnil))))
719 return Qt; 719 return Qt;
720 720
721 if (EQ (selection, QCLIPBOARD)) 721 if (EQ (selection, QCLIPBOARD))