aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c37
1 files changed, 11 insertions, 26 deletions
diff --git a/src/data.c b/src/data.c
index 1dbec4687b8..69ed68782b0 100644
--- a/src/data.c
+++ b/src/data.c
@@ -30,7 +30,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
30 30
31#include "lisp.h" 31#include "lisp.h"
32#include "bignum.h" 32#include "bignum.h"
33#include "puresize.h"
34#include "character.h" 33#include "character.h"
35#include "buffer.h" 34#include "buffer.h"
36#include "keyboard.h" 35#include "keyboard.h"
@@ -144,12 +143,6 @@ wrong_type_argument (Lisp_Object predicate, Lisp_Object value)
144} 143}
145 144
146void 145void
147pure_write_error (Lisp_Object obj)
148{
149 xsignal2 (Qerror, build_string ("Attempt to modify read-only object"), obj);
150}
151
152void
153args_out_of_range (Lisp_Object a1, Lisp_Object a2) 146args_out_of_range (Lisp_Object a1, Lisp_Object a2)
154{ 147{
155 xsignal2 (Qargs_out_of_range, a1, a2); 148 xsignal2 (Qargs_out_of_range, a1, a2);
@@ -645,7 +638,6 @@ DEFUN ("setcar", Fsetcar, Ssetcar, 2, 2, 0,
645 (register Lisp_Object cell, Lisp_Object newcar) 638 (register Lisp_Object cell, Lisp_Object newcar)
646{ 639{
647 CHECK_CONS (cell); 640 CHECK_CONS (cell);
648 CHECK_IMPURE (cell, XCONS (cell));
649 XSETCAR (cell, newcar); 641 XSETCAR (cell, newcar);
650 return newcar; 642 return newcar;
651} 643}
@@ -655,7 +647,6 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0,
655 (register Lisp_Object cell, Lisp_Object newcdr) 647 (register Lisp_Object cell, Lisp_Object newcdr)
656{ 648{
657 CHECK_CONS (cell); 649 CHECK_CONS (cell);
658 CHECK_IMPURE (cell, XCONS (cell));
659 XSETCDR (cell, newcdr); 650 XSETCDR (cell, newcdr);
660 return newcdr; 651 return newcdr;
661} 652}
@@ -943,10 +934,6 @@ The return value is undefined. */)
943 (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) 934 (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring)
944{ 935{
945 CHECK_SYMBOL (symbol); 936 CHECK_SYMBOL (symbol);
946 if (!NILP (Vpurify_flag)
947 /* If `definition' is a keymap, immutable (and copying) is wrong. */
948 && !KEYMAPP (definition))
949 definition = Fpurecopy (definition);
950 937
951 defalias (symbol, definition); 938 defalias (symbol, definition);
952 939
@@ -2590,7 +2577,6 @@ bool-vector. IDX starts at 0. */)
2590 2577
2591 if (VECTORP (array)) 2578 if (VECTORP (array))
2592 { 2579 {
2593 CHECK_IMPURE (array, XVECTOR (array));
2594 if (idxval < 0 || idxval >= ASIZE (array)) 2580 if (idxval < 0 || idxval >= ASIZE (array))
2595 args_out_of_range (array, idx); 2581 args_out_of_range (array, idx);
2596 ASET (array, idxval, newelt); 2582 ASET (array, idxval, newelt);
@@ -2614,7 +2600,6 @@ bool-vector. IDX starts at 0. */)
2614 } 2600 }
2615 else /* STRINGP */ 2601 else /* STRINGP */
2616 { 2602 {
2617 CHECK_IMPURE (array, XSTRING (array));
2618 if (idxval < 0 || idxval >= SCHARS (array)) 2603 if (idxval < 0 || idxval >= SCHARS (array))
2619 args_out_of_range (array, idx); 2604 args_out_of_range (array, idx);
2620 CHECK_CHARACTER (newelt); 2605 CHECK_CHARACTER (newelt);
@@ -4143,7 +4128,7 @@ syms_of_data (void)
4143 4128
4144 DEFSYM (Qcdr, "cdr"); 4129 DEFSYM (Qcdr, "cdr");
4145 4130
4146 error_tail = pure_cons (Qerror, Qnil); 4131 error_tail = Fcons (Qerror, Qnil);
4147 4132
4148 /* ERROR is used as a signaler for random errors for which nothing else is 4133 /* ERROR is used as a signaler for random errors for which nothing else is
4149 right. */ 4134 right. */
@@ -4151,14 +4136,14 @@ syms_of_data (void)
4151 Fput (Qerror, Qerror_conditions, 4136 Fput (Qerror, Qerror_conditions,
4152 error_tail); 4137 error_tail);
4153 Fput (Qerror, Qerror_message, 4138 Fput (Qerror, Qerror_message,
4154 build_pure_c_string ("error")); 4139 build_string ("error"));
4155 4140
4156#define PUT_ERROR(sym, tail, msg) \ 4141#define PUT_ERROR(sym, tail, msg) \
4157 Fput (sym, Qerror_conditions, pure_cons (sym, tail)); \ 4142 Fput (sym, Qerror_conditions, Fcons (sym, tail)); \
4158 Fput (sym, Qerror_message, build_pure_c_string (msg)) 4143 Fput (sym, Qerror_message, build_string (msg))
4159 4144
4160 PUT_ERROR (Qquit, Qnil, "Quit"); 4145 PUT_ERROR (Qquit, Qnil, "Quit");
4161 PUT_ERROR (Qminibuffer_quit, pure_cons (Qquit, Qnil), "Quit"); 4146 PUT_ERROR (Qminibuffer_quit, Fcons (Qquit, Qnil), "Quit");
4162 4147
4163 PUT_ERROR (Quser_error, error_tail, ""); 4148 PUT_ERROR (Quser_error, error_tail, "");
4164 PUT_ERROR (Qwrong_length_argument, error_tail, "Wrong length argument"); 4149 PUT_ERROR (Qwrong_length_argument, error_tail, "Wrong length argument");
@@ -4184,14 +4169,14 @@ syms_of_data (void)
4184 PUT_ERROR (Qno_catch, error_tail, "No catch for tag"); 4169 PUT_ERROR (Qno_catch, error_tail, "No catch for tag");
4185 PUT_ERROR (Qend_of_file, error_tail, "End of file during parsing"); 4170 PUT_ERROR (Qend_of_file, error_tail, "End of file during parsing");
4186 4171
4187 arith_tail = pure_cons (Qarith_error, error_tail); 4172 arith_tail = Fcons (Qarith_error, error_tail);
4188 Fput (Qarith_error, Qerror_conditions, arith_tail); 4173 Fput (Qarith_error, Qerror_conditions, arith_tail);
4189 Fput (Qarith_error, Qerror_message, build_pure_c_string ("Arithmetic error")); 4174 Fput (Qarith_error, Qerror_message, build_string ("Arithmetic error"));
4190 4175
4191 PUT_ERROR (Qbeginning_of_buffer, error_tail, "Beginning of buffer"); 4176 PUT_ERROR (Qbeginning_of_buffer, error_tail, "Beginning of buffer");
4192 PUT_ERROR (Qend_of_buffer, error_tail, "End of buffer"); 4177 PUT_ERROR (Qend_of_buffer, error_tail, "End of buffer");
4193 PUT_ERROR (Qbuffer_read_only, error_tail, "Buffer is read-only"); 4178 PUT_ERROR (Qbuffer_read_only, error_tail, "Buffer is read-only");
4194 PUT_ERROR (Qtext_read_only, pure_cons (Qbuffer_read_only, error_tail), 4179 PUT_ERROR (Qtext_read_only, Fcons (Qbuffer_read_only, error_tail),
4195 "Text is read-only"); 4180 "Text is read-only");
4196 PUT_ERROR (Qinhibited_interaction, error_tail, 4181 PUT_ERROR (Qinhibited_interaction, error_tail,
4197 "User interaction while inhibited"); 4182 "User interaction while inhibited");
@@ -4214,10 +4199,10 @@ syms_of_data (void)
4214 PUT_ERROR (Qunderflow_error, Fcons (Qrange_error, arith_tail), 4199 PUT_ERROR (Qunderflow_error, Fcons (Qrange_error, arith_tail),
4215 "Arithmetic underflow error"); 4200 "Arithmetic underflow error");
4216 4201
4217 recursion_tail = pure_cons (Qrecursion_error, error_tail); 4202 recursion_tail = Fcons (Qrecursion_error, error_tail);
4218 Fput (Qrecursion_error, Qerror_conditions, recursion_tail); 4203 Fput (Qrecursion_error, Qerror_conditions, recursion_tail);
4219 Fput (Qrecursion_error, Qerror_message, build_pure_c_string 4204 Fput (Qrecursion_error, Qerror_message,
4220 ("Excessive recursive calling error")); 4205 build_string ("Excessive recursive calling error"));
4221 4206
4222 PUT_ERROR (Qexcessive_variable_binding, recursion_tail, 4207 PUT_ERROR (Qexcessive_variable_binding, recursion_tail,
4223 "Variable binding depth exceeds max-specpdl-size"); 4208 "Variable binding depth exceeds max-specpdl-size");