diff options
| author | Jim Blandy | 1992-05-18 08:14:41 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-05-18 08:14:41 +0000 |
| commit | ffd56f97cf56501f7a6981c184192e9043e4eafd (patch) | |
| tree | d463f4585c85fa76b33d3663271bbb4126d7b116 /src/eval.c | |
| parent | 502ddf238f0ed280a301426804b2ed16ec1c49cc (diff) | |
| download | emacs-ffd56f97cf56501f7a6981c184192e9043e4eafd.tar.gz emacs-ffd56f97cf56501f7a6981c184192e9043e4eafd.zip | |
*** empty log message ***
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 62 |
1 files changed, 14 insertions, 48 deletions
diff --git a/src/eval.c b/src/eval.c index c4fcc808c5d..ab0ae207f2c 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -465,12 +465,7 @@ and input is currently coming from the keyboard (not in keyboard macro).") | |||
| 465 | that DOES eval its args. | 465 | that DOES eval its args. |
| 466 | If it is a built-in function (such as load or eval-region) | 466 | If it is a built-in function (such as load or eval-region) |
| 467 | return nil. */ | 467 | return nil. */ |
| 468 | fun = *btp->function; | 468 | fun = Findirect_function (*btp->function); |
| 469 | while (XTYPE (fun) == Lisp_Symbol) | ||
| 470 | { | ||
| 471 | QUIT; | ||
| 472 | fun = Fsymbol_function (fun); | ||
| 473 | } | ||
| 474 | if (XTYPE (fun) == Lisp_Subr) | 469 | if (XTYPE (fun) == Lisp_Subr) |
| 475 | return Qnil; | 470 | return Qnil; |
| 476 | /* btp points to the frame of a Lisp function that called interactive-p. | 471 | /* btp points to the frame of a Lisp function that called interactive-p. |
| @@ -1206,14 +1201,9 @@ Also, a symbol satisfies `commandp' if its function definition does so.") | |||
| 1206 | 1201 | ||
| 1207 | fun = function; | 1202 | fun = function; |
| 1208 | 1203 | ||
| 1209 | /* Dereference symbols, but avoid infinte loops. Eech. */ | 1204 | fun = indirect_function (fun); |
| 1210 | while (XTYPE (fun) == Lisp_Symbol) | 1205 | if (EQ (fun, Qunbound)) |
| 1211 | { | 1206 | return Qnil; |
| 1212 | if (++i > 10) return Qnil; | ||
| 1213 | tem = Ffboundp (fun); | ||
| 1214 | if (NILP (tem)) return Qnil; | ||
| 1215 | fun = Fsymbol_function (fun); | ||
| 1216 | } | ||
| 1217 | 1207 | ||
| 1218 | /* Emacs primitives are interactive if their DEFUN specifies an | 1208 | /* Emacs primitives are interactive if their DEFUN specifies an |
| 1219 | interactive spec. */ | 1209 | interactive spec. */ |
| @@ -1333,14 +1323,8 @@ do_autoload (fundef, funname) | |||
| 1333 | Vautoload_queue = Qt; | 1323 | Vautoload_queue = Qt; |
| 1334 | unbind_to (count, Qnil); | 1324 | unbind_to (count, Qnil); |
| 1335 | 1325 | ||
| 1336 | while (XTYPE (fun) == Lisp_Symbol) | 1326 | fun = Findirect_function (fun); |
| 1337 | { | 1327 | |
| 1338 | QUIT; | ||
| 1339 | val = XSYMBOL (fun)->function; | ||
| 1340 | if (EQ (val, Qunbound)) | ||
| 1341 | Fsymbol_function (fun); /* Get the right kind of error! */ | ||
| 1342 | fun = val; | ||
| 1343 | } | ||
| 1344 | if (XTYPE (fun) == Lisp_Cons | 1328 | if (XTYPE (fun) == Lisp_Cons |
| 1345 | && EQ (XCONS (fun)->car, Qautoload)) | 1329 | && EQ (XCONS (fun)->car, Qautoload)) |
| 1346 | error ("Autoloading failed to define function %s", | 1330 | error ("Autoloading failed to define function %s", |
| @@ -1404,15 +1388,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, | |||
| 1404 | /* At this point, only original_fun and original_args | 1388 | /* At this point, only original_fun and original_args |
| 1405 | have values that will be used below */ | 1389 | have values that will be used below */ |
| 1406 | retry: | 1390 | retry: |
| 1407 | fun = original_fun; | 1391 | fun = Findirect_function (original_fun); |
| 1408 | while (XTYPE (fun) == Lisp_Symbol) | ||
| 1409 | { | ||
| 1410 | QUIT; | ||
| 1411 | val = XSYMBOL (fun)->function; | ||
| 1412 | if (EQ (val, Qunbound)) | ||
| 1413 | Fsymbol_function (fun); /* Get the right kind of error! */ | ||
| 1414 | fun = val; | ||
| 1415 | } | ||
| 1416 | 1392 | ||
| 1417 | if (XTYPE (fun) == Lisp_Subr) | 1393 | if (XTYPE (fun) == Lisp_Subr) |
| 1418 | { | 1394 | { |
| @@ -1582,16 +1558,12 @@ Thus, (apply '+ 1 2 '(3 4)) returns 10.") | |||
| 1582 | 1558 | ||
| 1583 | numargs += nargs - 2; | 1559 | numargs += nargs - 2; |
| 1584 | 1560 | ||
| 1585 | while (XTYPE (fun) == Lisp_Symbol) | 1561 | fun = indirect_function (fun); |
| 1562 | if (EQ (fun, Qunbound)) | ||
| 1586 | { | 1563 | { |
| 1587 | QUIT; | 1564 | /* Let funcall get the error */ |
| 1588 | fun = XSYMBOL (fun)->function; | 1565 | fun = args[0]; |
| 1589 | if (EQ (fun, Qunbound)) | 1566 | goto funcall; |
| 1590 | { | ||
| 1591 | /* Let funcall get the error */ | ||
| 1592 | fun = args[0]; | ||
| 1593 | goto funcall; | ||
| 1594 | } | ||
| 1595 | } | 1567 | } |
| 1596 | 1568 | ||
| 1597 | if (XTYPE (fun) == Lisp_Subr) | 1569 | if (XTYPE (fun) == Lisp_Subr) |
| @@ -1779,14 +1751,8 @@ Thus, (funcall 'cons 'x 'y) returns (x . y).") | |||
| 1779 | retry: | 1751 | retry: |
| 1780 | 1752 | ||
| 1781 | fun = args[0]; | 1753 | fun = args[0]; |
| 1782 | while (XTYPE (fun) == Lisp_Symbol) | 1754 | |
| 1783 | { | 1755 | fun = Findirect_function (fun); |
| 1784 | QUIT; | ||
| 1785 | val = XSYMBOL (fun)->function; | ||
| 1786 | if (EQ (val, Qunbound)) | ||
| 1787 | Fsymbol_function (fun); /* Get the right kind of error! */ | ||
| 1788 | fun = val; | ||
| 1789 | } | ||
| 1790 | 1756 | ||
| 1791 | if (XTYPE (fun) == Lisp_Subr) | 1757 | if (XTYPE (fun) == Lisp_Subr) |
| 1792 | { | 1758 | { |