aboutsummaryrefslogtreecommitdiffstats
path: root/src/abbrev.c
diff options
context:
space:
mode:
authorGerd Moellmann2001-10-05 09:51:48 +0000
committerGerd Moellmann2001-10-05 09:51:48 +0000
commita97569cbf284dc18f285174194de1fa55cc3ee3a (patch)
tree9768a384073b66ad294bda3b5f889cbeb23559ac /src/abbrev.c
parenta9dff54b9422ed37535789a2095c3d721e8dcba9 (diff)
downloademacs-a97569cbf284dc18f285174194de1fa55cc3ee3a.tar.gz
emacs-a97569cbf284dc18f285174194de1fa55cc3ee3a.zip
Use SYMBOL_VALUE/ SET_SYMBOL_VALUE macros instead of accessing
symbols' value directly.
Diffstat (limited to 'src/abbrev.c')
-rw-r--r--src/abbrev.c26
1 files changed, 14 insertions, 12 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);