aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-08-07 17:37:21 +0400
committerDmitry Antipov2012-08-07 17:37:21 +0400
commitc644523bd8a23e518c91b61a1b8520e866b715b9 (patch)
tree60fae47e02ad6c87b5e657110606255e849ecf77 /src/data.c
parent6a3d20cc46da1e59f230923056b6b351acb097b9 (diff)
downloademacs-c644523bd8a23e518c91b61a1b8520e866b715b9.tar.gz
emacs-c644523bd8a23e518c91b61a1b8520e866b715b9.zip
Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
* src/lisp.h (struct Lisp_Symbol): Change xname to meaningful name since all xname users are fixed long time ago. Do not use INTERNAL_FIELD. (set_symbol_name, set_symbol_function, set_symbol_plist): (set_symbol_next, set_overlay_plist): New function. (struct Lisp_Cons): Do not use INTERNAL_FIELD. (struct Lisp_Overlay): Likewise. (CVAR, MVAR, SVAR): Remove. * src/alloc.c, src/buffer.c, src/buffer.h, src/bytecode.c: * src/cmds.c, src/data.c, src/doc.c, src/eval.c, src/fns.c: * src/keyboard.c, src/lread.c, src/nsselect.m, src/xterm.c: Adjust users. * src/.gdbinit: Change to use name field of struct Lisp_Symbol where appropriate. * admin/coccinelle/overlay.cocci, admin/coccinelle/symbol.cocci: Remove.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/data.c b/src/data.c
index 3a8e0b11d6a..c4519fc5e02 100644
--- a/src/data.c
+++ b/src/data.c
@@ -562,7 +562,7 @@ DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0,
562 (register Lisp_Object symbol) 562 (register Lisp_Object symbol)
563{ 563{
564 CHECK_SYMBOL (symbol); 564 CHECK_SYMBOL (symbol);
565 return (EQ (SVAR (XSYMBOL (symbol), function), Qunbound) ? Qnil : Qt); 565 return EQ (XSYMBOL (symbol)->function, Qunbound) ? Qnil : Qt;
566} 566}
567 567
568DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0, 568DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0,
@@ -585,7 +585,7 @@ Return SYMBOL. */)
585 CHECK_SYMBOL (symbol); 585 CHECK_SYMBOL (symbol);
586 if (NILP (symbol) || EQ (symbol, Qt)) 586 if (NILP (symbol) || EQ (symbol, Qt))
587 xsignal1 (Qsetting_constant, symbol); 587 xsignal1 (Qsetting_constant, symbol);
588 SVAR (XSYMBOL (symbol), function) = Qunbound; 588 set_symbol_function (symbol, Qunbound);
589 return symbol; 589 return symbol;
590} 590}
591 591
@@ -594,8 +594,8 @@ DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
594 (register Lisp_Object symbol) 594 (register Lisp_Object symbol)
595{ 595{
596 CHECK_SYMBOL (symbol); 596 CHECK_SYMBOL (symbol);
597 if (!EQ (SVAR (XSYMBOL (symbol), function), Qunbound)) 597 if (!EQ (XSYMBOL (symbol)->function, Qunbound))
598 return SVAR (XSYMBOL (symbol), function); 598 return XSYMBOL (symbol)->function;
599 xsignal1 (Qvoid_function, symbol); 599 xsignal1 (Qvoid_function, symbol);
600} 600}
601 601
@@ -604,7 +604,7 @@ DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0,
604 (register Lisp_Object symbol) 604 (register Lisp_Object symbol)
605{ 605{
606 CHECK_SYMBOL (symbol); 606 CHECK_SYMBOL (symbol);
607 return SVAR (XSYMBOL (symbol), plist); 607 return XSYMBOL (symbol)->plist;
608} 608}
609 609
610DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0, 610DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0,
@@ -628,7 +628,7 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
628 if (NILP (symbol) || EQ (symbol, Qt)) 628 if (NILP (symbol) || EQ (symbol, Qt))
629 xsignal1 (Qsetting_constant, symbol); 629 xsignal1 (Qsetting_constant, symbol);
630 630
631 function = SVAR (XSYMBOL (symbol), function); 631 function = XSYMBOL (symbol)->function;
632 632
633 if (!NILP (Vautoload_queue) && !EQ (function, Qunbound)) 633 if (!NILP (Vautoload_queue) && !EQ (function, Qunbound))
634 Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue); 634 Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue);
@@ -636,13 +636,13 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
636 if (CONSP (function) && EQ (XCAR (function), Qautoload)) 636 if (CONSP (function) && EQ (XCAR (function), Qautoload))
637 Fput (symbol, Qautoload, XCDR (function)); 637 Fput (symbol, Qautoload, XCDR (function));
638 638
639 SVAR (XSYMBOL (symbol), function) = definition; 639 set_symbol_function (symbol, definition);
640 /* Handle automatic advice activation. */ 640 /* Handle automatic advice activation. */
641 if (CONSP (SVAR (XSYMBOL (symbol), plist)) 641 if (CONSP (XSYMBOL (symbol)->plist)
642 && !NILP (Fget (symbol, Qad_advice_info))) 642 && !NILP (Fget (symbol, Qad_advice_info)))
643 { 643 {
644 call2 (Qad_activate_internal, symbol, Qnil); 644 call2 (Qad_activate_internal, symbol, Qnil);
645 definition = SVAR (XSYMBOL (symbol), function); 645 definition = XSYMBOL (symbol)->function;
646 } 646 }
647 return definition; 647 return definition;
648} 648}
@@ -657,8 +657,8 @@ The return value is undefined. */)
657 (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) 657 (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring)
658{ 658{
659 CHECK_SYMBOL (symbol); 659 CHECK_SYMBOL (symbol);
660 if (CONSP (SVAR (XSYMBOL (symbol), function)) 660 if (CONSP (XSYMBOL (symbol)->function)
661 && EQ (XCAR (SVAR (XSYMBOL (symbol), function)), Qautoload)) 661 && EQ (XCAR (XSYMBOL (symbol)->function), Qautoload))
662 LOADHIST_ATTACH (Fcons (Qt, symbol)); 662 LOADHIST_ATTACH (Fcons (Qt, symbol));
663 if (!NILP (Vpurify_flag) 663 if (!NILP (Vpurify_flag)
664 /* If `definition' is a keymap, immutable (and copying) is wrong. */ 664 /* If `definition' is a keymap, immutable (and copying) is wrong. */
@@ -679,7 +679,7 @@ DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0,
679 (register Lisp_Object symbol, Lisp_Object newplist) 679 (register Lisp_Object symbol, Lisp_Object newplist)
680{ 680{
681 CHECK_SYMBOL (symbol); 681 CHECK_SYMBOL (symbol);
682 SVAR (XSYMBOL (symbol), plist) = newplist; 682 set_symbol_plist (symbol, newplist);
683 return newplist; 683 return newplist;
684} 684}
685 685
@@ -2019,12 +2019,12 @@ indirect_function (register Lisp_Object object)
2019 { 2019 {
2020 if (!SYMBOLP (hare) || EQ (hare, Qunbound)) 2020 if (!SYMBOLP (hare) || EQ (hare, Qunbound))
2021 break; 2021 break;
2022 hare = SVAR (XSYMBOL (hare), function); 2022 hare = XSYMBOL (hare)->function;
2023 if (!SYMBOLP (hare) || EQ (hare, Qunbound)) 2023 if (!SYMBOLP (hare) || EQ (hare, Qunbound))
2024 break; 2024 break;
2025 hare = SVAR (XSYMBOL (hare), function); 2025 hare = XSYMBOL (hare)->function;
2026 2026
2027 tortoise = SVAR (XSYMBOL (tortoise), function); 2027 tortoise = XSYMBOL (tortoise)->function;
2028 2028
2029 if (EQ (hare, tortoise)) 2029 if (EQ (hare, tortoise))
2030 xsignal1 (Qcyclic_function_indirection, object); 2030 xsignal1 (Qcyclic_function_indirection, object);
@@ -2048,7 +2048,7 @@ function chain of symbols. */)
2048 /* Optimize for no indirection. */ 2048 /* Optimize for no indirection. */
2049 result = object; 2049 result = object;
2050 if (SYMBOLP (result) && !EQ (result, Qunbound) 2050 if (SYMBOLP (result) && !EQ (result, Qunbound)
2051 && (result = SVAR (XSYMBOL (result), function), SYMBOLP (result))) 2051 && (result = XSYMBOL (result)->function, SYMBOLP (result)))
2052 result = indirect_function (result); 2052 result = indirect_function (result);
2053 if (!EQ (result, Qunbound)) 2053 if (!EQ (result, Qunbound))
2054 return result; 2054 return result;
@@ -3196,7 +3196,7 @@ syms_of_data (void)
3196 defsubr (&Ssubr_arity); 3196 defsubr (&Ssubr_arity);
3197 defsubr (&Ssubr_name); 3197 defsubr (&Ssubr_name);
3198 3198
3199 SVAR (XSYMBOL (Qwholenump), function) = SVAR (XSYMBOL (Qnatnump), function); 3199 set_symbol_function (Qwholenump, XSYMBOL (Qnatnump)->function);
3200 3200
3201 DEFVAR_LISP ("most-positive-fixnum", Vmost_positive_fixnum, 3201 DEFVAR_LISP ("most-positive-fixnum", Vmost_positive_fixnum,
3202 doc: /* The largest value that is representable in a Lisp integer. */); 3202 doc: /* The largest value that is representable in a Lisp integer. */);