* src/eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
.gdbinit. * src/data.c (pure_write_error): Add `object' argument. * src/puresize.h (CHECK_IMPURE): Use it. * src/keyboard.c (safe_run_hooks_error): Improve error message.
This commit is contained in:
parent
2f23b3ab02
commit
a8a7c5f651
5 changed files with 22 additions and 9 deletions
|
@ -1,3 +1,13 @@
|
|||
2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
|
||||
.gdbinit.
|
||||
|
||||
* keyboard.c (safe_run_hooks_error): Improve error message.
|
||||
|
||||
* data.c (pure_write_error): Add `object' argument.
|
||||
* puresize.h (CHECK_IMPURE): Use it.
|
||||
|
||||
2013-06-03 Michael Albinus <michael.albinus@gmx.de>
|
||||
|
||||
* Makefile.in (NOTIFY_OBJ): New variable.
|
||||
|
|
|
@ -100,9 +100,10 @@ wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value)
|
|||
}
|
||||
|
||||
void
|
||||
pure_write_error (void)
|
||||
pure_write_error (Lisp_Object obj)
|
||||
{
|
||||
error ("Attempt to modify read-only object");
|
||||
Fsignal (Qerror, Fcons (build_string ("Attempt to modify read-only object"),
|
||||
Fcons (obj, Qnil)));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
10
src/eval.c
10
src/eval.c
|
@ -128,16 +128,18 @@ void set_backtrace_debug_on_exit (struct specbinding *pdl, bool doe)
|
|||
|
||||
/* Helper functions to scan the backtrace. */
|
||||
|
||||
LISP_INLINE bool backtrace_p (struct specbinding *pdl)
|
||||
EXTERN_INLINE bool backtrace_p (struct specbinding *pdl)
|
||||
{ return pdl >= specpdl; }
|
||||
LISP_INLINE struct specbinding *backtrace_top (void)
|
||||
|
||||
EXTERN_INLINE struct specbinding *backtrace_top (void)
|
||||
{
|
||||
struct specbinding *pdl = specpdl_ptr - 1;
|
||||
while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE) \
|
||||
while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE)
|
||||
pdl--;
|
||||
return pdl;
|
||||
}
|
||||
LISP_INLINE struct specbinding *backtrace_next (struct specbinding *pdl)
|
||||
|
||||
EXTERN_INLINE struct specbinding *backtrace_next (struct specbinding *pdl)
|
||||
{
|
||||
pdl--;
|
||||
while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE)
|
||||
|
|
|
@ -1882,7 +1882,7 @@ safe_run_hooks_error (Lisp_Object error_data)
|
|||
= CONSP (Vinhibit_quit) ? XCAR (Vinhibit_quit) : Vinhibit_quit;
|
||||
Lisp_Object fun = CONSP (Vinhibit_quit) ? XCDR (Vinhibit_quit) : Qnil;
|
||||
Lisp_Object args[4];
|
||||
args[0] = build_string ("Error in %s (%s): %S");
|
||||
args[0] = build_string ("Error in %s (%S): %S");
|
||||
args[1] = hook;
|
||||
args[2] = fun;
|
||||
args[3] = error_data;
|
||||
|
|
|
@ -73,9 +73,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
|||
/* Signal an error if OBJ is pure. */
|
||||
#define CHECK_IMPURE(obj) \
|
||||
{ if (PURE_P (obj)) \
|
||||
pure_write_error (); }
|
||||
pure_write_error (obj); }
|
||||
|
||||
extern _Noreturn void pure_write_error (void);
|
||||
extern _Noreturn void pure_write_error (Lisp_Object);
|
||||
|
||||
/* Define PURE_P. */
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue