aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2013-06-03 11:18:18 -0400
committerStefan Monnier2013-06-03 11:18:18 -0400
commita8a7c5f651cd9c3d354a4cb4938e5289d4cbbe4b (patch)
treecf9664003563a682554c9f6826ac967d92e9b012
parent2f23b3ab02d48e972fbce7f4a38527e07c651aa0 (diff)
downloademacs-a8a7c5f651cd9c3d354a4cb4938e5289d4cbbe4b.tar.gz
emacs-a8a7c5f651cd9c3d354a4cb4938e5289d4cbbe4b.zip
* 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.
-rw-r--r--src/ChangeLog10
-rw-r--r--src/data.c5
-rw-r--r--src/eval.c10
-rw-r--r--src/keyboard.c2
-rw-r--r--src/puresize.h4
5 files changed, 22 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index fce07f9db1a..2b719b068ae 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
4 .gdbinit.
5
6 * keyboard.c (safe_run_hooks_error): Improve error message.
7
8 * data.c (pure_write_error): Add `object' argument.
9 * puresize.h (CHECK_IMPURE): Use it.
10
12013-06-03 Michael Albinus <michael.albinus@gmx.de> 112013-06-03 Michael Albinus <michael.albinus@gmx.de>
2 12
3 * Makefile.in (NOTIFY_OBJ): New variable. 13 * Makefile.in (NOTIFY_OBJ): New variable.
diff --git a/src/data.c b/src/data.c
index b33d9656d57..fc66cea6497 100644
--- a/src/data.c
+++ b/src/data.c
@@ -100,9 +100,10 @@ wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value)
100} 100}
101 101
102void 102void
103pure_write_error (void) 103pure_write_error (Lisp_Object obj)
104{ 104{
105 error ("Attempt to modify read-only object"); 105 Fsignal (Qerror, Fcons (build_string ("Attempt to modify read-only object"),
106 Fcons (obj, Qnil)));
106} 107}
107 108
108void 109void
diff --git a/src/eval.c b/src/eval.c
index fac71e34a22..d6236b6edf2 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -128,16 +128,18 @@ void set_backtrace_debug_on_exit (struct specbinding *pdl, bool doe)
128 128
129/* Helper functions to scan the backtrace. */ 129/* Helper functions to scan the backtrace. */
130 130
131LISP_INLINE bool backtrace_p (struct specbinding *pdl) 131EXTERN_INLINE bool backtrace_p (struct specbinding *pdl)
132{ return pdl >= specpdl; } 132{ return pdl >= specpdl; }
133LISP_INLINE struct specbinding *backtrace_top (void) 133
134EXTERN_INLINE struct specbinding *backtrace_top (void)
134{ 135{
135 struct specbinding *pdl = specpdl_ptr - 1; 136 struct specbinding *pdl = specpdl_ptr - 1;
136 while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE) \ 137 while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE)
137 pdl--; 138 pdl--;
138 return pdl; 139 return pdl;
139} 140}
140LISP_INLINE struct specbinding *backtrace_next (struct specbinding *pdl) 141
142EXTERN_INLINE struct specbinding *backtrace_next (struct specbinding *pdl)
141{ 143{
142 pdl--; 144 pdl--;
143 while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE) 145 while (backtrace_p (pdl) && pdl->kind != SPECPDL_BACKTRACE)
diff --git a/src/keyboard.c b/src/keyboard.c
index a243b95470a..8dd109d252d 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1882,7 +1882,7 @@ safe_run_hooks_error (Lisp_Object error_data)
1882 = CONSP (Vinhibit_quit) ? XCAR (Vinhibit_quit) : Vinhibit_quit; 1882 = CONSP (Vinhibit_quit) ? XCAR (Vinhibit_quit) : Vinhibit_quit;
1883 Lisp_Object fun = CONSP (Vinhibit_quit) ? XCDR (Vinhibit_quit) : Qnil; 1883 Lisp_Object fun = CONSP (Vinhibit_quit) ? XCDR (Vinhibit_quit) : Qnil;
1884 Lisp_Object args[4]; 1884 Lisp_Object args[4];
1885 args[0] = build_string ("Error in %s (%s): %S"); 1885 args[0] = build_string ("Error in %s (%S): %S");
1886 args[1] = hook; 1886 args[1] = hook;
1887 args[2] = fun; 1887 args[2] = fun;
1888 args[3] = error_data; 1888 args[3] = error_data;
diff --git a/src/puresize.h b/src/puresize.h
index 2f717571c7c..25a11aafbcc 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -73,9 +73,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
73/* Signal an error if OBJ is pure. */ 73/* Signal an error if OBJ is pure. */
74#define CHECK_IMPURE(obj) \ 74#define CHECK_IMPURE(obj) \
75 { if (PURE_P (obj)) \ 75 { if (PURE_P (obj)) \
76 pure_write_error (); } 76 pure_write_error (obj); }
77 77
78extern _Noreturn void pure_write_error (void); 78extern _Noreturn void pure_write_error (Lisp_Object);
79 79
80/* Define PURE_P. */ 80/* Define PURE_P. */
81 81