X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/23c3caf6025f1cbe37781ceb359fac2c67268f45..5c3534ffdcce41b1aab7bd158cf07224446caa9d:/src/eval.c diff --git a/src/eval.c b/src/eval.c index 571681c318..fe6460d53b 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1,14 +1,14 @@ /* Evaluator for GNU Emacs Lisp interpreter. -Copyright (C) 1985-1987, 1993-1995, 1999-2015 Free Software Foundation, +Copyright (C) 1985-1987, 1993-1995, 1999-2016 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -1191,7 +1191,7 @@ suppresses the debugger). When a handler handles an error, control returns to the `condition-case' and it executes the handler's BODY... with VAR bound to (ERROR-SYMBOL . SIGNAL-DATA) from the error. -(If VAR is nil, the handler can't access that information.) +\(If VAR is nil, the handler can't access that information.) Then the value of the last BODY form is returned from the `condition-case' expression. @@ -1245,7 +1245,7 @@ internal_lisp_condition_case (volatile Lisp_Object var, Lisp_Object bodyform, for (i = 0; i < clausenb; i++) { Lisp_Object clause = clauses[i]; - Lisp_Object condition = XCAR (clause); + Lisp_Object condition = CONSP (clause) ? XCAR (clause) : Qnil; if (!CONSP (condition)) condition = Fcons (condition, Qnil); struct handler *c = push_handler (condition, CONDITION_CASE); @@ -2409,7 +2409,7 @@ may be nil, a function, or a list of functions. Call each function in order with arguments ARGS, stopping at the first one that returns nil, and return nil. Otherwise (if all functions return non-nil, or if there are no functions to call), return non-nil -(do not rely on the precise return value in this case). +\(do not rely on the precise return value in this case). Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. @@ -3196,15 +3196,12 @@ unbind_to (ptrdiff_t count, Lisp_Object value) { /* If variable has a trivial value (no forwarding), we can just set it. No need to check for constant symbols here, since that was already done by specbind. */ - Lisp_Object symbol = specpdl_symbol (specpdl_ptr); - if (SYMBOLP (symbol)) + Lisp_Object sym = specpdl_symbol (specpdl_ptr); + if (SYMBOLP (sym) && XSYMBOL (sym)->redirect == SYMBOL_PLAINVAL) { - struct Lisp_Symbol *sym = XSYMBOL (symbol); - if (sym->redirect == SYMBOL_PLAINVAL) - { - SET_SYMBOL_VAL (sym, specpdl_old_value (specpdl_ptr)); - break; - } + SET_SYMBOL_VAL (XSYMBOL (sym), + specpdl_old_value (specpdl_ptr)); + break; } else { /* FALLTHROUGH!! @@ -3412,12 +3409,12 @@ backtrace_eval_unrewind (int distance) { /* If variable has a trivial value (no forwarding), we can just set it. No need to check for constant symbols here, since that was already done by specbind. */ - struct Lisp_Symbol *sym = XSYMBOL (specpdl_symbol (tmp)); - if (sym->redirect == SYMBOL_PLAINVAL) + Lisp_Object sym = specpdl_symbol (tmp); + if (SYMBOLP (sym) && XSYMBOL (sym)->redirect == SYMBOL_PLAINVAL) { Lisp_Object old_value = specpdl_old_value (tmp); - set_specpdl_old_value (tmp, SYMBOL_VAL (sym)); - SET_SYMBOL_VAL (sym, old_value); + set_specpdl_old_value (tmp, SYMBOL_VAL (XSYMBOL (sym))); + SET_SYMBOL_VAL (XSYMBOL (sym), old_value); break; } else