aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorJim Blandy <[email protected]>1992-06-24 05:09:26 +0000
committerJim Blandy <[email protected]>1992-06-24 05:09:26 +0000
commitdaa3760289bd389e8c174c8d24b375cd875cd911 (patch)
tree0abe3e6108e0e5a7c98f4c4aa68a495b0ecef09a /src/eval.c
parenta4275ad1c8f60239b0bad43cef97ca86d35a51a3 (diff)
*** empty log message ***
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c42
1 files changed, 28 insertions, 14 deletions
diff --git a/src/eval.c b/src/eval.c
index d3d475f4d1..0e012d4500 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -41,8 +41,9 @@ struct backtrace
struct backtrace *next;
Lisp_Object *function;
Lisp_Object *args; /* Points to vector of args. */
- int nargs; /* length of vector */
- /* if nargs is UNEVALLED, args points to slot holding list of unevalled args */
+ int nargs; /* Length of vector.
+ If nargs is UNEVALLED, args points to slot holding
+ list of unevalled args */
char evalargs;
/* Nonzero means call value of debugger when done with this operation. */
char debug_on_exit;
@@ -451,20 +452,33 @@ and input is currently coming from the keyboard (not in keyboard macro).")
if (!INTERACTIVE)
return Qnil;
- /* Unless the object was compiled, skip the frame of interactive-p itself
- (if interpreted) or the frame of byte-code (if called from
- compiled function). */
btp = backtrace_list;
- if (XTYPE (*btp->function) != Lisp_Compiled)
+
+ /* If this isn't a byte-compiled function, there may be a frame at
+ the top for Finteractive_p itself. If so, skip it. */
+ fun = Findirect_function (*btp->function);
+ if (XTYPE (fun) == Lisp_Subr
+ && (struct Lisp_Subr *) XPNTR (fun) == &Sinteractive_p)
btp = btp->next;
- while (btp
- && (btp->nargs == UNEVALLED || EQ (*btp->function, Qbytecode)))
+
+ /* If we're running an Emacs 18-style byte-compiled function, there
+ may be a frame for Fbytecode. Now, given the strictest
+ definition, this function isn't really being called
+ interactively, but because that's the way Emacs 18 always builds
+ byte-compiled functions, we'll accept it for now. */
+ if (EQ (*btp->function, Qbytecode))
+ btp = btp->next;
+
+ /* If this isn't a byte-compiled function, then we may now be
+ looking at several frames for special forms. Skip past them. */
+ while (btp &&
+ btp->nargs == UNEVALLED)
btp = btp->next;
- /* btp now points at the frame of the innermost function
- that DOES eval its args.
- If it is a built-in function (such as load or eval-region)
- return nil. */
+ /* btp now points at the frame of the innermost function that isn't
+ a special form, ignoring frames for Finteractive_p and/or
+ Fbytecode at the top. If this frame is for a built-in function
+ (such as load or eval-region) return nil. */
fun = Findirect_function (*btp->function);
if (XTYPE (fun) == Lisp_Subr)
return Qnil;
@@ -2320,8 +2334,8 @@ See also variable `debug-on-quit'.");
DEFVAR_BOOL ("debug-on-quit", &debug_on_quit,
"*Non-nil means enter debugger if quit is signaled (C-G, for example).\n\
-Does not apply if quit is handled by a `condition-case'.
-A non-nil value is equivalent to a `debug-on-error' value containing 'quit.");
+Does not apply if quit is handled by a `condition-case'.\n\
+A non-nil value is equivalent to a `debug-on-error' value containing `quit'.");
debug_on_quit = 0;
DEFVAR_BOOL ("debug-on-next-call", &debug_on_next_call,