aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorJim Blandy1992-07-08 22:47:39 +0000
committerJim Blandy1992-07-08 22:47:39 +0000
commit23d6b5a6ee9ddd1d6bffe06d4b73e7ec16e0396f (patch)
tree94e62f3af94e981b958884ce6336708390baa5d5 /src/eval.c
parentbe53b4110027210bd96008798b29478b6701e11d (diff)
downloademacs-23d6b5a6ee9ddd1d6bffe06d4b73e7ec16e0396f.tar.gz
emacs-23d6b5a6ee9ddd1d6bffe06d4b73e7ec16e0396f.zip
*** empty log message ***
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c37
1 files changed, 9 insertions, 28 deletions
diff --git a/src/eval.c b/src/eval.c
index 572410e9617..4d4ca7c584c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -743,6 +743,7 @@ definitions to shadow the loaded ones for use in file byte-compilation.")
743 register Lisp_Object form; 743 register Lisp_Object form;
744 Lisp_Object env; 744 Lisp_Object env;
745{ 745{
746 /* With cleanups from Hallvard Furuseth. */
746 register Lisp_Object expander, sym, def, tem; 747 register Lisp_Object expander, sym, def, tem;
747 748
748 while (1) 749 while (1)
@@ -751,42 +752,23 @@ definitions to shadow the loaded ones for use in file byte-compilation.")
751 in case it expands into another macro call. */ 752 in case it expands into another macro call. */
752 if (XTYPE (form) != Lisp_Cons) 753 if (XTYPE (form) != Lisp_Cons)
753 break; 754 break;
754 sym = XCONS (form)->car; 755 /* Set SYM, give DEF and TEM right values in case SYM is not a symbol. */
755 /* Detect ((macro lambda ...) ...) */ 756 def = sym = XCONS (form)->car;
756 if (XTYPE (sym) == Lisp_Cons 757 tem = Qnil;
757 && EQ (XCONS (sym)->car, Qmacro))
758 {
759 expander = XCONS (sym)->cdr;
760 goto explicit;
761 }
762 if (XTYPE (sym) != Lisp_Symbol)
763 break;
764 /* Trace symbols aliases to other symbols 758 /* Trace symbols aliases to other symbols
765 until we get a symbol that is not an alias. */ 759 until we get a symbol that is not an alias. */
766 while (1) 760 while (XTYPE (def) == Lisp_Symbol)
767 { 761 {
768 QUIT; 762 QUIT;
763 sym = def;
769 tem = Fassq (sym, env); 764 tem = Fassq (sym, env);
770 if (NILP (tem)) 765 if (NILP (tem))
771 { 766 {
772 def = XSYMBOL (sym)->function; 767 def = XSYMBOL (sym)->function;
773 if (XTYPE (def) == Lisp_Symbol && !EQ (def, Qunbound)) 768 if (!EQ (def, Qunbound))
774 sym = def; 769 continue;
775 else
776 break;
777 }
778 else
779 {
780#if 0 /* This is turned off because it caused an element (foo . bar)
781 to have the effect of defining foo as an alias for the macro bar.
782 That is inconsistent; bar should be a function to expand foo. */
783 if (XTYPE (tem) == Lisp_Cons
784 && XTYPE (XCONS (tem)->cdr) == Lisp_Symbol)
785 sym = XCONS (tem)->cdr;
786 else
787#endif
788 break;
789 } 770 }
771 break;
790 } 772 }
791 /* Right now TEM is the result from SYM in ENV, 773 /* Right now TEM is the result from SYM in ENV,
792 and if TEM is nil then DEF is SYM's function definition. */ 774 and if TEM is nil then DEF is SYM's function definition. */
@@ -818,7 +800,6 @@ definitions to shadow the loaded ones for use in file byte-compilation.")
818 if (NILP (expander)) 800 if (NILP (expander))
819 break; 801 break;
820 } 802 }
821 explicit:
822 form = apply1 (expander, XCONS (form)->cdr); 803 form = apply1 (expander, XCONS (form)->cdr);
823 } 804 }
824 return form; 805 return form;