From: Pip Cet Date: Tue, 20 Aug 2024 19:00:20 +0000 (+0000) Subject: Pure storage removal: Replace calls to removed functions X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=38f9bd5554c7316ef0c12037b43065cb006ae2e1;p=emacs.git Pure storage removal: Replace calls to removed functions * src/alloc.c (string_bytes, pin_string, valid_lisp_object_p) (process_mark_stack, survives_gc_p, syms_of_alloc): * src/androidterm.c (android_term_init): Replace call to 'build_pure_c_string'. * src/buffer.c (init_buffer_once, syms_of_buffer): * src/bytecode.c (exec_byte_code): * src/callint.c (syms_of_callint): * src/callproc.c (syms_of_callproc): * src/category.c (Fdefine_category): * src/coding.c (syms_of_coding): * src/comp.c (Fcomp__compile_ctxt_to_file0) (maybe_defer_native_compilation, syms_of_comp): * src/data.c (Fsetcar, Fsetcdr, Fdefalias, Faset, syms_of_data): * src/dbusbind.c (syms_of_dbusbind): * src/doc.c (Fsnarf_documentation): * src/emacs-module.c (syms_of_module): * src/eval.c (Finternal__define_uninitialized_variable) (Fdefconst_1, define_error, syms_of_eval): * src/fileio.c (syms_of_fileio): * src/fns.c (Ffillarray, Fclear_string, check_mutable_hash_table): * src/fontset.c (syms_of_fontset): * src/frame.c (make_initial_frame): * src/haikufns.c (syms_of_haikufns): * src/intervals.c (create_root_interval): * src/keyboard.c (syms_of_keyboard): * src/keymap.c (Fmake_sparse_keymap, Fset_keymap_parent) (store_in_keymap, syms_of_keymap): * src/lisp.h: * src/lread.c (Fload, read0, intern_c_string_1, define_symbol) (Fintern, defsubr, syms_of_lread): * src/pdumper.c (Fdump_emacs_portable): * src/pgtkfns.c (syms_of_pgtkfns): * src/pgtkterm.c (syms_of_pgtkterm): * src/process.c (syms_of_process): * src/search.c (syms_of_search): * src/sqlite.c (syms_of_sqlite): * src/syntax.c (syms_of_syntax): * src/treesit.c (syms_of_treesit): * src/w32fns.c (syms_of_w32fns): * src/xdisp.c (syms_of_xdisp): * src/xfaces.c (syms_of_xfaces): * src/xfns.c (syms_of_xfns): * src/xftfont.c (syms_of_xftfont): * src/xterm.c (syms_of_xterm): Remove calls to 'PURE_P', 'CHECK_IMPURE', 'Fpurecopy', and replace calls to 'build_pure_c_string', 'pure_list', 'pure_listn', etc., by impure equivalents. (cherry picked from commit 5ec86966638885a0f8df8afa28a01ca103ad2a49) --- diff --git a/src/alloc.c b/src/alloc.c index dcc5f567013..36a28e0652f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1689,7 +1689,7 @@ string_bytes (struct Lisp_String *s) ptrdiff_t nbytes = (s->u.s.size_byte < 0 ? s->u.s.size & ~ARRAY_MARK_FLAG : s->u.s.size_byte); - if (!PURE_P (s) && !pdumper_object_p (s) && s->u.s.data + if (!pdumper_object_p (s) && s->u.s.data && nbytes != SDATA_NBYTES (SDATA_OF_STRING (s))) emacs_abort (); return nbytes; @@ -2540,7 +2540,7 @@ pin_string (Lisp_Object string) unsigned char *data = s->u.s.data; if (!(size > LARGE_STRING_BYTES - || PURE_P (data) || pdumper_object_p (data) + || pdumper_object_p (data) || s->u.s.size_byte == -3)) { eassert (s->u.s.size_byte == -1); @@ -5498,8 +5498,6 @@ valid_lisp_object_p (Lisp_Object obj) return 1; void *p = XPNTR (obj); - if (PURE_P (p)) - return 1; if (BARE_SYMBOL_P (obj) && c_symbol_p (p)) return ((char *) p - (char *) lispsym) % sizeof lispsym[0] == 0; @@ -6686,8 +6684,6 @@ process_mark_stack (ptrdiff_t base_sp) Lisp_Object obj = mark_stack_pop (); mark_obj: ; void *po = XPNTR (obj); - if (PURE_P (po)) - continue; #if GC_REMEMBER_LAST_MARKED last_marked[last_marked_index++] = obj; @@ -6931,8 +6927,7 @@ process_mark_stack (ptrdiff_t base_sp) break; default: emacs_abort (); } - if (!PURE_P (XSTRING (ptr->u.s.name))) - set_string_marked (XSTRING (ptr->u.s.name)); + set_string_marked (XSTRING (ptr->u.s.name)); mark_interval_tree (string_intervals (ptr->u.s.name)); /* Inner loop to mark next symbol in this bucket, if any. */ po = ptr = ptr->u.s.next; @@ -7067,7 +7062,7 @@ survives_gc_p (Lisp_Object obj) emacs_abort (); } - return survives_p || PURE_P (XPNTR (obj)); + return survives_p; } @@ -7736,10 +7731,10 @@ allocated but to know if we're in the preload phase of Emacs's build. */); /* We build this in advance because if we wait until we need it, we might not be able to allocate the memory to hold it. */ Vmemory_signal_data - = pure_list (Qerror, - build_pure_c_string ("Memory exhausted--use" - " M-x save-some-buffers then" - " exit and restart Emacs")); + = list (Qerror, + build_string ("Memory exhausted--use" + " M-x save-some-buffers then" + " exit and restart Emacs")); DEFVAR_LISP ("memory-full", Vmemory_full, doc: /* Non-nil means Emacs cannot get much more Lisp memory. */); diff --git a/src/androidterm.c b/src/androidterm.c index e0f66652300..3e367b391a8 100644 --- a/src/androidterm.c +++ b/src/androidterm.c @@ -6631,7 +6631,7 @@ android_term_init (void) x_display_list = dpyinfo; dpyinfo->name_list_element - = Fcons (build_pure_c_string ("android"), Qnil); + = Fcons (build_string ("android"), Qnil); color_file = Fexpand_file_name (build_string ("rgb.txt"), Vdata_directory); diff --git a/src/buffer.c b/src/buffer.c index 07a4e00fa68..40f7ec83d6b 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4788,8 +4788,8 @@ init_buffer_once (void) set_buffer_intervals (&buffer_defaults, NULL); set_buffer_intervals (&buffer_local_symbols, NULL); /* This is not strictly necessary, but let's make them initialized. */ - bset_name (&buffer_defaults, build_pure_c_string (" *buffer-defaults*")); - bset_name (&buffer_local_symbols, build_pure_c_string (" *buffer-local-symbols*")); + bset_name (&buffer_defaults, build_string (" *buffer-defaults*")); + bset_name (&buffer_local_symbols, build_string (" *buffer-local-symbols*")); BUFFER_PVEC_INIT (&buffer_defaults); BUFFER_PVEC_INIT (&buffer_local_symbols); @@ -4797,7 +4797,7 @@ init_buffer_once (void) /* Must do these before making the first buffer! */ /* real setup is done in bindings.el */ - bset_mode_line_format (&buffer_defaults, build_pure_c_string ("%-")); + bset_mode_line_format (&buffer_defaults, build_string ("%-")); bset_header_line_format (&buffer_defaults, Qnil); bset_tab_line_format (&buffer_defaults, Qnil); bset_abbrev_mode (&buffer_defaults, Qnil); @@ -4865,7 +4865,7 @@ init_buffer_once (void) current_buffer = 0; pdumper_remember_lv_ptr_raw (¤t_buffer, Lisp_Vectorlike); - QSFundamental = build_pure_c_string ("Fundamental"); + QSFundamental = build_string ("Fundamental"); DEFSYM (Qfundamental_mode, "fundamental-mode"); bset_major_mode (&buffer_defaults, Qfundamental_mode); @@ -4879,10 +4879,10 @@ init_buffer_once (void) /* Super-magic invisible buffer. */ Vprin1_to_string_buffer = - Fget_buffer_create (build_pure_c_string (" prin1"), Qt); + Fget_buffer_create (build_string (" prin1"), Qt); Vbuffer_alist = Qnil; - Fset_buffer (Fget_buffer_create (build_pure_c_string ("*scratch*"), Qnil)); + Fset_buffer (Fget_buffer_create (build_string ("*scratch*"), Qnil)); inhibit_modification_hooks = 0; } @@ -5065,9 +5065,9 @@ syms_of_buffer (void) Qoverwrite_mode_binary)); Fput (Qprotected_field, Qerror_conditions, - pure_list (Qprotected_field, Qerror)); + list (Qprotected_field, Qerror)); Fput (Qprotected_field, Qerror_message, - build_pure_c_string ("Attempt to modify a protected field")); + build_string ("Attempt to modify a protected field")); DEFSYM (Qclone_indirect_buffer_hook, "clone-indirect-buffer-hook"); diff --git a/src/bytecode.c b/src/bytecode.c index b2d77ef03a6..ecea0c6df36 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -1638,7 +1638,6 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, record_in_backtrace (Qsetcar, &TOP, 2); wrong_type_argument (Qconsp, cell); } - CHECK_IMPURE (cell, XCONS (cell)); XSETCAR (cell, newval); TOP = newval; NEXT; @@ -1653,7 +1652,6 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, record_in_backtrace (Qsetcdr, &TOP, 2); wrong_type_argument (Qconsp, cell); } - CHECK_IMPURE (cell, XCONS (cell)); XSETCDR (cell, newval); TOP = newval; NEXT; diff --git a/src/callint.c b/src/callint.c index c8d29040d3d..7979d8b2ef0 100644 --- a/src/callint.c +++ b/src/callint.c @@ -810,10 +810,10 @@ syms_of_callint (void) callint_message = Qnil; staticpro (&callint_message); - preserved_fns = pure_list (intern_c_string ("region-beginning"), - intern_c_string ("region-end"), - intern_c_string ("point"), - intern_c_string ("mark")); + preserved_fns = list (intern_c_string ("region-beginning"), + intern_c_string ("region-end"), + intern_c_string ("point"), + intern_c_string ("mark")); staticpro (&preserved_fns); DEFSYM (Qlist, "list"); diff --git a/src/callproc.c b/src/callproc.c index a70c374881f..cc6df35998d 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -2171,9 +2171,9 @@ See `setenv' and `getenv'. */); Use this instead of calling `ctags' directly, as `ctags' may have been renamed to comply with executable naming restrictions on the system. */); #if !defined HAVE_ANDROID || defined ANDROID_STUBIFY - Vctags_program_name = build_pure_c_string ("ctags"); + Vctags_program_name = build_string ("ctags"); #else - Vctags_program_name = build_pure_c_string ("libctags.so"); + Vctags_program_name = build_string ("libctags.so"); #endif DEFVAR_LISP ("etags-program-name", Vetags_program_name, @@ -2181,9 +2181,9 @@ renamed to comply with executable naming restrictions on the system. */); Use this instead of calling `etags' directly, as `etags' may have been renamed to comply with executable naming restrictions on the system. */); #if !defined HAVE_ANDROID || defined ANDROID_STUBIFY - Vetags_program_name = build_pure_c_string ("etags"); + Vetags_program_name = build_string ("etags"); #else - Vetags_program_name = build_pure_c_string ("libetags.so"); + Vetags_program_name = build_string ("libetags.so"); #endif DEFVAR_LISP ("hexl-program-name", Vhexl_program_name, @@ -2191,9 +2191,9 @@ renamed to comply with executable naming restrictions on the system. */); Use this instead of calling `hexl' directly, as `hexl' may have been renamed to comply with executable naming restrictions on the system. */); #if !defined HAVE_ANDROID || defined ANDROID_STUBIFY - Vhexl_program_name = build_pure_c_string ("hexl"); + Vhexl_program_name = build_string ("hexl"); #else - Vhexl_program_name = build_pure_c_string ("libhexl.so"); + Vhexl_program_name = build_string ("libhexl.so"); #endif DEFVAR_LISP ("emacsclient-program-name", Vemacsclient_program_name, @@ -2202,9 +2202,9 @@ Use this instead of calling `emacsclient' directly, as `emacsclient' may have been renamed to comply with executable naming restrictions on the system. */); #if !defined HAVE_ANDROID || defined ANDROID_STUBIFY - Vemacsclient_program_name = build_pure_c_string ("emacsclient"); + Vemacsclient_program_name = build_string ("emacsclient"); #else - Vemacsclient_program_name = build_pure_c_string ("libemacsclient.so"); + Vemacsclient_program_name = build_string ("libemacsclient.so"); #endif DEFVAR_LISP ("movemail-program-name", Vmovemail_program_name, @@ -2216,9 +2216,9 @@ the system. */); use movemail from another source. */ #if !defined HAVE_ANDROID || defined ANDROID_STUBIFY \ || defined HAVE_MAILUTILS - Vmovemail_program_name = build_pure_c_string ("movemail"); + Vmovemail_program_name = build_string ("movemail"); #else - Vmovemail_program_name = build_pure_c_string ("libmovemail.so"); + Vmovemail_program_name = build_string ("libmovemail.so"); #endif DEFVAR_LISP ("rcs2log-program-name", Vrcs2log_program_name, @@ -2227,9 +2227,9 @@ Use this instead of calling `rcs2log' directly, as `rcs2log' may have been renamed to comply with executable naming restrictions on the system. */); #if !defined HAVE_ANDROID || defined ANDROID_STUBIFY - Vrcs2log_program_name = build_pure_c_string ("rcs2log"); + Vrcs2log_program_name = build_string ("rcs2log"); #else /* HAVE_ANDROID && !ANDROID_STUBIFY */ - Vrcs2log_program_name = build_pure_c_string ("librcs2log.so"); + Vrcs2log_program_name = build_string ("librcs2log.so"); #endif /* !HAVE_ANDROID || ANDROID_STUBIFY */ defsubr (&Scall_process); diff --git a/src/category.c b/src/category.c index 2611d6419e8..b5eb2136bb3 100644 --- a/src/category.c +++ b/src/category.c @@ -118,8 +118,6 @@ the current buffer's category table. */) if (!NILP (CATEGORY_DOCSTRING (table, XFIXNAT (category)))) error ("Category `%c' is already defined", (int) XFIXNAT (category)); - if (!NILP (Vpurify_flag)) - docstring = Fpurecopy (docstring); SET_CATEGORY_DOCSTRING (table, XFIXNAT (category), docstring); return Qnil; diff --git a/src/coding.c b/src/coding.c index 6875d4af823..4f7cf23e96e 100644 --- a/src/coding.c +++ b/src/coding.c @@ -11766,7 +11766,7 @@ syms_of_coding (void) Vcode_conversion_reused_workbuf = Qnil; staticpro (&Vcode_conversion_workbuf_name); - Vcode_conversion_workbuf_name = build_pure_c_string (" *code-conversion-work*"); + Vcode_conversion_workbuf_name = build_string (" *code-conversion-work*"); reused_workbuf_in_use = false; PDUMPER_REMEMBER_SCALAR (reused_workbuf_in_use); @@ -11830,9 +11830,9 @@ syms_of_coding (void) /* Error signaled when there's a problem with detecting a coding system. */ DEFSYM (Qcoding_system_error, "coding-system-error"); Fput (Qcoding_system_error, Qerror_conditions, - pure_list (Qcoding_system_error, Qerror)); + list (Qcoding_system_error, Qerror)); Fput (Qcoding_system_error, Qerror_message, - build_pure_c_string ("Invalid coding system")); + build_string ("Invalid coding system")); DEFSYM (Qtranslation_table, "translation-table"); Fput (Qtranslation_table, Qchar_table_extra_slots, make_fixnum (2)); @@ -12107,22 +12107,22 @@ used for encoding standard output and error streams. */); DEFVAR_LISP ("eol-mnemonic-unix", eol_mnemonic_unix, doc: /* String displayed in mode line for UNIX-like (LF) end-of-line format. */); - eol_mnemonic_unix = build_pure_c_string (":"); + eol_mnemonic_unix = build_string (":"); DEFVAR_LISP ("eol-mnemonic-dos", eol_mnemonic_dos, doc: /* String displayed in mode line for DOS-like (CRLF) end-of-line format. */); - eol_mnemonic_dos = build_pure_c_string ("\\"); + eol_mnemonic_dos = build_string ("\\"); DEFVAR_LISP ("eol-mnemonic-mac", eol_mnemonic_mac, doc: /* String displayed in mode line for MAC-like (CR) end-of-line format. */); - eol_mnemonic_mac = build_pure_c_string ("/"); + eol_mnemonic_mac = build_string ("/"); DEFVAR_LISP ("eol-mnemonic-undecided", eol_mnemonic_undecided, doc: /* String displayed in mode line when end-of-line format is not yet determined. */); - eol_mnemonic_undecided = build_pure_c_string (":"); + eol_mnemonic_undecided = build_string (":"); DEFVAR_LISP ("enable-character-translation", Venable_character_translation, doc: /* @@ -12262,7 +12262,7 @@ internal character representation. */); intern_c_string (":for-unibyte"), args[coding_arg_for_unibyte] = Qt, intern_c_string (":docstring"), - (build_pure_c_string + (build_string ("Do no conversion.\n" "\n" "When you visit a file with this coding, the file is read into a\n" @@ -12282,7 +12282,7 @@ internal character representation. */); plist[8] = intern_c_string (":charset-list"); plist[9] = args[coding_arg_charset_list] = list1 (Qascii); plist[11] = args[coding_arg_for_unibyte] = Qnil; - plist[13] = build_pure_c_string ("No conversion on encoding, " + plist[13] = build_string ("No conversion on encoding, " "automatic conversion on decoding."); plist[15] = args[coding_arg_eol_type] = Qnil; args[coding_arg_plist] = CALLMANY (Flist, plist); diff --git a/src/comp.c b/src/comp.c index 25b00f31f1e..1631e2b4ce0 100644 --- a/src/comp.c +++ b/src/comp.c @@ -4945,7 +4945,6 @@ DEFUN ("comp--compile-ctxt-to-file0", Fcomp__compile_ctxt_to_file0, define_GET_SYMBOL_WITH_POSITION (); define_CHECK_TYPE (); define_SYMBOL_WITH_POS_SYM (); - define_CHECK_IMPURE (); define_bool_to_lisp_obj (); define_setcar_setcdr (); define_add1_sub1 (); @@ -5192,11 +5191,11 @@ maybe_defer_native_compilation (Lisp_Object function_name, return; Lisp_Object src = - concat2 (CALLNI (file-name-sans-extension, Vload_true_file_name), - build_pure_c_string (".el")); + concat2 (CALL1I (file-name-sans-extension, Vload_true_file_name), + build_string (".el")); if (NILP (Ffile_exists_p (src))) { - src = concat2 (src, build_pure_c_string (".gz")); + src = concat2 (src, build_string (".gz")); if (NILP (Ffile_exists_p (src))) return; } @@ -5755,48 +5754,48 @@ natively-compiled one. */); /* To be signaled by the compiler. */ DEFSYM (Qnative_compiler_error, "native-compiler-error"); Fput (Qnative_compiler_error, Qerror_conditions, - pure_list (Qnative_compiler_error, Qerror)); + list (Qnative_compiler_error, Qerror)); Fput (Qnative_compiler_error, Qerror_message, - build_pure_c_string ("Native compiler error")); + build_string ("Native compiler error")); DEFSYM (Qnative_ice, "native-ice"); Fput (Qnative_ice, Qerror_conditions, - pure_list (Qnative_ice, Qnative_compiler_error, Qerror)); + list (Qnative_ice, Qnative_compiler_error, Qerror)); Fput (Qnative_ice, Qerror_message, - build_pure_c_string ("Internal native compiler error")); + build_string ("Internal native compiler error")); /* By the load machinery. */ DEFSYM (Qnative_lisp_load_failed, "native-lisp-load-failed"); Fput (Qnative_lisp_load_failed, Qerror_conditions, - pure_list (Qnative_lisp_load_failed, Qerror)); + list (Qnative_lisp_load_failed, Qerror)); Fput (Qnative_lisp_load_failed, Qerror_message, - build_pure_c_string ("Native elisp load failed")); + build_string ("Native elisp load failed")); DEFSYM (Qnative_lisp_wrong_reloc, "native-lisp-wrong-reloc"); Fput (Qnative_lisp_wrong_reloc, Qerror_conditions, - pure_list (Qnative_lisp_wrong_reloc, Qnative_lisp_load_failed, Qerror)); + list (Qnative_lisp_wrong_reloc, Qnative_lisp_load_failed, Qerror)); Fput (Qnative_lisp_wrong_reloc, Qerror_message, - build_pure_c_string ("Primitive redefined or wrong relocation")); + build_string ("Primitive redefined or wrong relocation")); DEFSYM (Qwrong_register_subr_call, "wrong-register-subr-call"); Fput (Qwrong_register_subr_call, Qerror_conditions, - pure_list (Qwrong_register_subr_call, Qnative_lisp_load_failed, Qerror)); + list (Qwrong_register_subr_call, Qnative_lisp_load_failed, Qerror)); Fput (Qwrong_register_subr_call, Qerror_message, - build_pure_c_string ("comp--register-subr can only be called during " - "native lisp load phase.")); + build_string ("comp--register-subr can only be called during " + "native lisp load phase.")); DEFSYM (Qnative_lisp_file_inconsistent, "native-lisp-file-inconsistent"); Fput (Qnative_lisp_file_inconsistent, Qerror_conditions, - pure_list (Qnative_lisp_file_inconsistent, Qnative_lisp_load_failed, Qerror)); + list (Qnative_lisp_file_inconsistent, Qnative_lisp_load_failed, Qerror)); Fput (Qnative_lisp_file_inconsistent, Qerror_message, - build_pure_c_string ("eln file inconsistent with current runtime " - "configuration, please recompile")); + build_string ("eln file inconsistent with current runtime " + "configuration, please recompile")); DEFSYM (Qcomp_sanitizer_error, "comp-sanitizer-error"); Fput (Qcomp_sanitizer_error, Qerror_conditions, - pure_list (Qcomp_sanitizer_error, Qerror)); + list (Qcomp_sanitizer_error, Qerror)); Fput (Qcomp_sanitizer_error, Qerror_message, - build_pure_c_string ("Native code sanitizer runtime error")); + build_string ("Native code sanitizer runtime error")); DEFSYM (Qnative__compile_async, "native--compile-async"); diff --git a/src/data.c b/src/data.c index 6df1276e4a3..5fcdda1b6e8 100644 --- a/src/data.c +++ b/src/data.c @@ -688,7 +688,6 @@ DEFUN ("setcar", Fsetcar, Ssetcar, 2, 2, 0, (register Lisp_Object cell, Lisp_Object newcar) { CHECK_CONS (cell); - CHECK_IMPURE (cell, XCONS (cell)); XSETCAR (cell, newcar); return newcar; } @@ -698,7 +697,6 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0, (register Lisp_Object cell, Lisp_Object newcdr) { CHECK_CONS (cell); - CHECK_IMPURE (cell, XCONS (cell)); XSETCDR (cell, newcdr); return newcdr; } @@ -996,10 +994,6 @@ The return value is undefined. */) (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) { CHECK_SYMBOL (symbol); - if (!NILP (Vpurify_flag) - /* If `definition' is a keymap, immutable (and copying) is wrong. */ - && !KEYMAPP (definition)) - definition = Fpurecopy (definition); defalias (symbol, definition); @@ -2589,7 +2583,6 @@ bool-vector. IDX starts at 0. */) if (VECTORP (array)) { - CHECK_IMPURE (array, XVECTOR (array)); if (idxval < 0 || idxval >= ASIZE (array)) args_out_of_range (array, idx); ASET (array, idxval, newelt); @@ -2607,14 +2600,12 @@ bool-vector. IDX starts at 0. */) } else if (RECORDP (array)) { - CHECK_IMPURE (array, XVECTOR (array)); if (idxval < 0 || idxval >= PVSIZE (array)) args_out_of_range (array, idx); ASET (array, idxval, newelt); } else /* STRINGP */ { - CHECK_IMPURE (array, XSTRING (array)); if (idxval < 0 || idxval >= SCHARS (array)) args_out_of_range (array, idx); CHECK_CHARACTER (newelt); @@ -4074,7 +4065,7 @@ syms_of_data (void) DEFSYM (Qaref, "aref"); DEFSYM (Qaset, "aset"); - error_tail = pure_cons (Qerror, Qnil); + error_tail = Fcons (Qerror, Qnil); /* ERROR is used as a signaler for random errors for which nothing else is right. */ @@ -4082,14 +4073,14 @@ syms_of_data (void) Fput (Qerror, Qerror_conditions, error_tail); Fput (Qerror, Qerror_message, - build_pure_c_string ("error")); + build_string ("error")); #define PUT_ERROR(sym, tail, msg) \ - Fput (sym, Qerror_conditions, pure_cons (sym, tail)); \ - Fput (sym, Qerror_message, build_pure_c_string (msg)) + Fput (sym, Qerror_conditions, Fcons (sym, tail)); \ + Fput (sym, Qerror_message, build_string (msg)) PUT_ERROR (Qquit, Qnil, "Quit"); - PUT_ERROR (Qminibuffer_quit, pure_cons (Qquit, Qnil), "Quit"); + PUT_ERROR (Qminibuffer_quit, Fcons (Qquit, Qnil), "Quit"); PUT_ERROR (Quser_error, error_tail, ""); PUT_ERROR (Qwrong_length_argument, error_tail, "Wrong length argument"); @@ -4118,14 +4109,14 @@ syms_of_data (void) PUT_ERROR (Qno_catch, error_tail, "No catch for tag"); PUT_ERROR (Qend_of_file, error_tail, "End of file during parsing"); - arith_tail = pure_cons (Qarith_error, error_tail); + arith_tail = Fcons (Qarith_error, error_tail); Fput (Qarith_error, Qerror_conditions, arith_tail); - Fput (Qarith_error, Qerror_message, build_pure_c_string ("Arithmetic error")); + Fput (Qarith_error, Qerror_message, build_string ("Arithmetic error")); PUT_ERROR (Qbeginning_of_buffer, error_tail, "Beginning of buffer"); PUT_ERROR (Qend_of_buffer, error_tail, "End of buffer"); PUT_ERROR (Qbuffer_read_only, error_tail, "Buffer is read-only"); - PUT_ERROR (Qtext_read_only, pure_cons (Qbuffer_read_only, error_tail), + PUT_ERROR (Qtext_read_only, Fcons (Qbuffer_read_only, error_tail), "Text is read-only"); PUT_ERROR (Qinhibited_interaction, error_tail, "User interaction while inhibited"); @@ -4148,10 +4139,10 @@ syms_of_data (void) PUT_ERROR (Qunderflow_error, Fcons (Qrange_error, arith_tail), "Arithmetic underflow error"); - recursion_tail = pure_cons (Qrecursion_error, error_tail); + recursion_tail = Fcons (Qrecursion_error, error_tail); Fput (Qrecursion_error, Qerror_conditions, recursion_tail); - Fput (Qrecursion_error, Qerror_message, build_pure_c_string - ("Excessive recursive calling error")); + Fput (Qrecursion_error, Qerror_message, + build_string ("Excessive recursive calling error")); PUT_ERROR (Qexcessive_lisp_nesting, recursion_tail, "Lisp nesting exceeds `max-lisp-eval-depth'"); diff --git a/src/dbusbind.c b/src/dbusbind.c index d98009f68b4..5f89122eaf7 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -1909,7 +1909,7 @@ syms_of_dbusbind (void) Fput (Qdbus_error, Qerror_conditions, list2 (Qdbus_error, Qerror)); Fput (Qdbus_error, Qerror_message, - build_pure_c_string ("D-Bus error")); + build_string ("D-Bus error")); DEFSYM (QD_Bus, "D-Bus"); /* Lisp symbols of the system and session buses. */ @@ -1959,7 +1959,7 @@ syms_of_dbusbind (void) Vdbus_compiled_version, doc: /* The version of D-Bus Emacs is compiled against. */); #ifdef DBUS_VERSION_STRING - Vdbus_compiled_version = build_pure_c_string (DBUS_VERSION_STRING); + Vdbus_compiled_version = build_string (DBUS_VERSION_STRING); #else Vdbus_compiled_version = Qnil; #endif diff --git a/src/doc.c b/src/doc.c index 09e099efcdb..6bc34550d31 100644 --- a/src/doc.c +++ b/src/doc.c @@ -549,7 +549,6 @@ the same file name is found in the `doc-directory'. */) int i = ARRAYELTS (buildobj); while (0 <= --i) Vbuild_files = Fcons (build_string (buildobj[i]), Vbuild_files); - Vbuild_files = Fpurecopy (Vbuild_files); } doc_fd fd = doc_open (name, O_RDONLY, 0); diff --git a/src/emacs-module.c b/src/emacs-module.c index 196b8a57754..18760182a03 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c @@ -1713,40 +1713,40 @@ syms_of_module (void) DEFSYM (Qmodule_load_failed, "module-load-failed"); Fput (Qmodule_load_failed, Qerror_conditions, - pure_list (Qmodule_load_failed, Qerror)); + list (Qmodule_load_failed, Qerror)); Fput (Qmodule_load_failed, Qerror_message, - build_pure_c_string ("Module load failed")); + build_string ("Module load failed")); DEFSYM (Qmodule_open_failed, "module-open-failed"); Fput (Qmodule_open_failed, Qerror_conditions, - pure_list (Qmodule_open_failed, Qmodule_load_failed, Qerror)); + list (Qmodule_open_failed, Qmodule_load_failed, Qerror)); Fput (Qmodule_open_failed, Qerror_message, - build_pure_c_string ("Module could not be opened")); + build_string ("Module could not be opened")); DEFSYM (Qmodule_not_gpl_compatible, "module-not-gpl-compatible"); Fput (Qmodule_not_gpl_compatible, Qerror_conditions, - pure_list (Qmodule_not_gpl_compatible, Qmodule_load_failed, Qerror)); + list (Qmodule_not_gpl_compatible, Qmodule_load_failed, Qerror)); Fput (Qmodule_not_gpl_compatible, Qerror_message, - build_pure_c_string ("Module is not GPL compatible")); + build_string ("Module is not GPL compatible")); DEFSYM (Qmissing_module_init_function, "missing-module-init-function"); Fput (Qmissing_module_init_function, Qerror_conditions, - pure_list (Qmissing_module_init_function, Qmodule_load_failed, - Qerror)); + list (Qmissing_module_init_function, Qmodule_load_failed, + Qerror)); Fput (Qmissing_module_init_function, Qerror_message, - build_pure_c_string ("Module does not export an " + build_string ("Module does not export an " "initialization function")); DEFSYM (Qmodule_init_failed, "module-init-failed"); Fput (Qmodule_init_failed, Qerror_conditions, - pure_list (Qmodule_init_failed, Qmodule_load_failed, Qerror)); + list (Qmodule_init_failed, Qmodule_load_failed, Qerror)); Fput (Qmodule_init_failed, Qerror_message, - build_pure_c_string ("Module initialization failed")); + build_string ("Module initialization failed")); DEFSYM (Qinvalid_arity, "invalid-arity"); - Fput (Qinvalid_arity, Qerror_conditions, pure_list (Qinvalid_arity, Qerror)); + Fput (Qinvalid_arity, Qerror_conditions, list (Qinvalid_arity, Qerror)); Fput (Qinvalid_arity, Qerror_message, - build_pure_c_string ("Invalid function arity")); + build_string ("Invalid function arity")); DEFSYM (Qmodule_function_p, "module-function-p"); DEFSYM (Qunicode_string_p, "unicode-string-p"); diff --git a/src/eval.c b/src/eval.c index cf05d3baea4..f724d6d8052 100644 --- a/src/eval.c +++ b/src/eval.c @@ -817,8 +817,6 @@ value. */) XSYMBOL (symbol)->u.s.declared_special = true; if (!NILP (doc)) { - if (!NILP (Vpurify_flag)) - doc = Fpurecopy (doc); Fput (symbol, Qvariable_documentation, doc); } LOADHIST_ATTACH (symbol); @@ -967,8 +965,6 @@ More specifically, behaves like (defconst SYM 'INITVALUE DOCSTRING). */) CHECK_SYMBOL (sym); Lisp_Object tem = initvalue; Finternal__define_uninitialized_variable (sym, docstring); - if (!NILP (Vpurify_flag)) - tem = Fpurecopy (tem); Fset_default (sym, tem); /* FIXME: set-default-toplevel-value? */ Fput (sym, Qrisky_local_variable, Qt); /* FIXME: Why? */ return sym; @@ -2004,8 +2000,8 @@ define_error (Lisp_Object name, const char *message, Lisp_Object parent) eassert (CONSP (parent_conditions)); eassert (!NILP (Fmemq (parent, parent_conditions))); eassert (NILP (Fmemq (name, parent_conditions))); - Fput (name, Qerror_conditions, pure_cons (name, parent_conditions)); - Fput (name, Qerror_message, build_pure_c_string (message)); + Fput (name, Qerror_conditions, Fcons (name, parent_conditions)); + Fput (name, Qerror_message, build_string (message)); } /* Use this for arithmetic overflow, e.g., when an integer result is @@ -4480,7 +4476,7 @@ alist of active lexical bindings. */); also use something like Fcons (Qnil, Qnil), but json.c treats any cons cell as error data, so use an uninterned symbol instead. */ Qcatch_all_memory_full - = Fmake_symbol (build_pure_c_string ("catch-all-memory-full")); + = Fmake_symbol (build_string ("catch-all-memory-full")); staticpro (&list_of_t); list_of_t = list1 (Qt); diff --git a/src/fileio.c b/src/fileio.c index d832967bb6b..0c27bb3174c 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -6671,39 +6671,39 @@ behaves as if file names were encoded in `utf-8'. */); DEFSYM (Qcar_less_than_car, "car-less-than-car"); Fput (Qfile_error, Qerror_conditions, - Fpurecopy (list2 (Qfile_error, Qerror))); + list2 (Qfile_error, Qerror)); Fput (Qfile_error, Qerror_message, - build_pure_c_string ("File error")); + build_string ("File error")); Fput (Qfile_already_exists, Qerror_conditions, - Fpurecopy (list3 (Qfile_already_exists, Qfile_error, Qerror))); + list3 (Qfile_already_exists, Qfile_error, Qerror)); Fput (Qfile_already_exists, Qerror_message, - build_pure_c_string ("File already exists")); + build_string ("File already exists")); Fput (Qfile_date_error, Qerror_conditions, - Fpurecopy (list3 (Qfile_date_error, Qfile_error, Qerror))); + list3 (Qfile_date_error, Qfile_error, Qerror)); Fput (Qfile_date_error, Qerror_message, - build_pure_c_string ("Cannot set file date")); + build_string ("Cannot set file date")); Fput (Qfile_missing, Qerror_conditions, - Fpurecopy (list3 (Qfile_missing, Qfile_error, Qerror))); + list3 (Qfile_missing, Qfile_error, Qerror)); Fput (Qfile_missing, Qerror_message, - build_pure_c_string ("File is missing")); + build_string ("File is missing")); Fput (Qpermission_denied, Qerror_conditions, - Fpurecopy (list3 (Qpermission_denied, Qfile_error, Qerror))); + list3 (Qpermission_denied, Qfile_error, Qerror)); Fput (Qpermission_denied, Qerror_message, - build_pure_c_string ("Cannot access file or directory")); + build_string ("Cannot access file or directory")); Fput (Qfile_notify_error, Qerror_conditions, - Fpurecopy (list3 (Qfile_notify_error, Qfile_error, Qerror))); + list3 (Qfile_notify_error, Qfile_error, Qerror)); Fput (Qfile_notify_error, Qerror_message, - build_pure_c_string ("File notification error")); + build_string ("File notification error")); Fput (Qremote_file_error, Qerror_conditions, - Fpurecopy (list3 (Qremote_file_error, Qfile_error, Qerror))); + list3 (Qremote_file_error, Qfile_error, Qerror)); Fput (Qremote_file_error, Qerror_message, - build_pure_c_string ("Remote file error")); + build_string ("Remote file error")); DEFVAR_LISP ("file-name-handler-alist", Vfile_name_handler_alist, doc: /* Alist of elements (REGEXP . HANDLER) for file names handled specially. diff --git a/src/fns.c b/src/fns.c index 78f1429ddab..d62712f24d9 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3274,7 +3274,6 @@ ARRAY is a vector, string, char-table, or bool-vector. */) size = SCHARS (array); if (size != 0) { - CHECK_IMPURE (array, XSTRING (array)); unsigned char str[MAX_MULTIBYTE_LENGTH]; int len; if (STRING_MULTIBYTE (array)) @@ -3317,7 +3316,6 @@ removes all text properties. This may change its length. */) Qnil, string); if (len != 0 || STRING_MULTIBYTE (string)) { - CHECK_IMPURE (string, XSTRING (string)); memset (SDATA (string), 0, len); STRING_SET_CHARS (string, len); STRING_SET_UNIBYTE (string); @@ -5136,7 +5134,6 @@ check_mutable_hash_table (Lisp_Object obj, struct Lisp_Hash_Table *h) { if (!h->mutable) signal_error ("hash table test modifies table", obj); - eassert (!PURE_P (h)); } /* Put an entry into hash table H that associates KEY with VALUE. diff --git a/src/fontset.c b/src/fontset.c index c0086b49257..f71730d8a2e 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -2174,7 +2174,7 @@ syms_of_fontset (void) set_fontset_id (Vdefault_fontset, make_fixnum (0)); set_fontset_name (Vdefault_fontset, - build_pure_c_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default")); + build_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default")); ASET (Vfontset_table, 0, Vdefault_fontset); next_fontset_id = 1; PDUMPER_REMEMBER_SCALAR (next_fontset_id); @@ -2232,7 +2232,7 @@ alternate fontnames (if any) are tried instead. */); doc: /* Alist of fontset names vs the aliases. */); Vfontset_alias_alist = list1 (Fcons (FONTSET_NAME (Vdefault_fontset), - build_pure_c_string ("fontset-default"))); + build_string ("fontset-default"))); DEFVAR_LISP ("vertical-centering-font-regexp", Vvertical_centering_font_regexp, diff --git a/src/frame.c b/src/frame.c index 473254175a2..511c4d8718d 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1242,7 +1242,7 @@ make_initial_frame (void) Vframe_list = Fcons (frame, Vframe_list); tty_frame_count = 1; - fset_name (f, build_pure_c_string ("F1")); + fset_name (f, build_string ("F1")); SET_FRAME_VISIBLE (f, true); diff --git a/src/haikufns.c b/src/haikufns.c index 22e82048fc4..6490a22bd01 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -3300,7 +3300,7 @@ invalid color. */); int len = sprintf (cairo_version, "%d.%d.%d", CAIRO_VERSION_MAJOR, CAIRO_VERSION_MINOR, CAIRO_VERSION_MICRO); - Vcairo_version_string = make_pure_string (cairo_version, len, len, false); + Vcairo_version_string = make_specified_string (cairo_version, len, len, false); } #endif diff --git a/src/intervals.c b/src/intervals.c index 4fb2edf4ba3..a6c7d938df7 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -100,7 +100,6 @@ create_root_interval (Lisp_Object parent) } else { - CHECK_IMPURE (parent, XSTRING (parent)); new->total_length = SCHARS (parent); eassert (TOTAL_LENGTH (new) >= 0); set_string_intervals (parent, new); diff --git a/src/keyboard.c b/src/keyboard.c index d3516984691..83e00cc517a 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -12840,14 +12840,14 @@ syms_of_keyboard (void) pending_funcalls = Qnil; staticpro (&pending_funcalls); - Vlispy_mouse_stem = build_pure_c_string ("mouse"); + Vlispy_mouse_stem = build_string ("mouse"); staticpro (&Vlispy_mouse_stem); - regular_top_level_message = build_pure_c_string ("Back to top level"); + regular_top_level_message = build_string ("Back to top level"); staticpro (®ular_top_level_message); #ifdef HAVE_STACK_OVERFLOW_HANDLING recover_top_level_message - = build_pure_c_string ("Re-entering top level after C stack overflow"); + = build_string ("Re-entering top level after C stack overflow"); staticpro (&recover_top_level_message); #endif DEFVAR_LISP ("internal--top-level-message", Vinternal__top_level_message, diff --git a/src/keymap.c b/src/keymap.c index 521a8f70d00..5691b34c40d 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -120,8 +120,6 @@ in case you use it as a menu with `x-popup-menu'. */) { if (!NILP (string)) { - if (!NILP (Vpurify_flag)) - string = Fpurecopy (string); return list2 (Qkeymap, string); } return list1 (Qkeymap); @@ -300,7 +298,6 @@ Return PARENT. PARENT should be nil or another keymap. */) If we came to the end, add the parent in PREV. */ if (!CONSP (list) || KEYMAPP (list)) { - CHECK_IMPURE (prev, XCONS (prev)); XSETCDR (prev, parent); return parent; } @@ -743,7 +740,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, /* If we are preparing to dump, and DEF is a menu element with a menu item indicator, copy it to ensure it is not pure. */ - if (CONSP (def) && PURE_P (XCONS (def)) + if (CONSP (def) && (EQ (XCAR (def), Qmenu_item) || STRINGP (XCAR (def)))) def = Fcons (XCAR (def), XCDR (def)); @@ -787,7 +784,6 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, { if (FIXNATP (idx) && XFIXNAT (idx) < ASIZE (elt)) { - CHECK_IMPURE (elt, XVECTOR (elt)); ASET (elt, XFIXNAT (idx), def); return def; } @@ -845,7 +841,6 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, } else if (EQ (idx, XCAR (elt))) { - CHECK_IMPURE (elt, XCONS (elt)); if (remove) /* Remove the element. */ insertion_point = Fdelq (elt, insertion_point); @@ -900,7 +895,6 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, } else elt = Fcons (idx, def); - CHECK_IMPURE (insertion_point, XCONS (insertion_point)); XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point))); } } @@ -3356,12 +3350,12 @@ syms_of_keymap (void) current_global_map = Qnil; staticpro (¤t_global_map); - exclude_keys = pure_list - (pure_cons (build_pure_c_string ("DEL"), build_pure_c_string ("\\d")), - pure_cons (build_pure_c_string ("TAB"), build_pure_c_string ("\\t")), - pure_cons (build_pure_c_string ("RET"), build_pure_c_string ("\\r")), - pure_cons (build_pure_c_string ("ESC"), build_pure_c_string ("\\e")), - pure_cons (build_pure_c_string ("SPC"), build_pure_c_string (" "))); + exclude_keys = list + (Fcons (build_string ("DEL"), build_string ("\\d")), + Fcons (build_string ("TAB"), build_string ("\\t")), + Fcons (build_string ("RET"), build_string ("\\r")), + Fcons (build_string ("ESC"), build_string ("\\e")), + Fcons (build_string ("SPC"), build_string (" "))); staticpro (&exclude_keys); DEFVAR_LISP ("minibuffer-local-map", Vminibuffer_local_map, @@ -3423,13 +3417,13 @@ that describe key bindings. That is why the default is nil. */); DEFSYM (Qmode_line, "mode-line"); staticpro (&Vmouse_events); - Vmouse_events = pure_list (Qmenu_bar, Qtab_bar, Qtool_bar, - Qtab_line, Qheader_line, Qmode_line, - intern_c_string ("mouse-1"), - intern_c_string ("mouse-2"), - intern_c_string ("mouse-3"), - intern_c_string ("mouse-4"), - intern_c_string ("mouse-5")); + Vmouse_events = list (Qmenu_bar, Qtab_bar, Qtool_bar, Qtab_line, + Qheader_line, Qmode_line, + intern_c_string ("mouse-1"), + intern_c_string ("mouse-2"), + intern_c_string ("mouse-3"), + intern_c_string ("mouse-4"), + intern_c_string ("mouse-5")); /* Keymap used for minibuffers when doing completion. */ /* Keymap used for minibuffers when doing completion and require a match. */ diff --git a/src/lisp.h b/src/lisp.h index 6a694efa80b..8c40130cc43 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4578,7 +4578,6 @@ build_string (const char *str) return make_string (str, strlen (str)); } -extern Lisp_Object pure_cons (Lisp_Object, Lisp_Object); extern Lisp_Object make_vector (ptrdiff_t, Lisp_Object); extern struct Lisp_Vector *allocate_nil_vector (ptrdiff_t) ATTRIBUTE_RETURNS_NONNULL; diff --git a/src/lread.c b/src/lread.c index de1b0ae2d06..0e4512be122 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1673,7 +1673,7 @@ Return t if the file exists and loads successfully. */) } if (! NILP (Vpurify_flag)) - Vpreloaded_file_list = Fcons (Fpurecopy (file), Vpreloaded_file_list); + Vpreloaded_file_list = Fcons (file, Vpreloaded_file_list); if (NILP (nomessage) || force_load_messages) { @@ -4431,10 +4431,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms) if (uninterned_symbol) { Lisp_Object name - = (!NILP (Vpurify_flag) - ? make_pure_string (read_buffer, nchars, nbytes, multibyte) - : make_specified_string (read_buffer, nchars, nbytes, - multibyte)); + = make_specified_string (read_buffer, nchars, nbytes, multibyte); result = Fmake_symbol (name); } else @@ -4966,10 +4963,7 @@ intern_c_string_1 (const char *str, ptrdiff_t len) { Lisp_Object string; - if (NILP (Vpurify_flag)) - string = make_string (str, len); - else - string = make_pure_c_string (str, len); + string = make_string (str, len); tem = intern_driver (string, obarray, tem); } @@ -4992,7 +4986,7 @@ static void define_symbol (Lisp_Object sym, char const *str) { ptrdiff_t len = strlen (str); - Lisp_Object string = make_pure_c_string (str, len); + Lisp_Object string = make_string (str, len); init_symbol (sym, string); /* Qunbound is uninterned, so that it's not confused with any symbol @@ -5036,8 +5030,7 @@ it defaults to the value of `obarray'. */) xfree (longhand); } else - tem = intern_driver (NILP (Vpurify_flag) ? string : Fpurecopy (string), - obarray, tem); + tem = intern_driver (string, obarray, tem); } return tem; } @@ -5480,7 +5473,7 @@ defsubr (union Aligned_Lisp_Subr *aname) set_symbol_function (sym, tem); #ifdef HAVE_NATIVE_COMP eassert (NILP (Vcomp_abi_hash)); - Vcomp_subr_list = Fpurecopy (Fcons (tem, Vcomp_subr_list)); + Vcomp_subr_list = Fcons (tem, Vcomp_subr_list); #endif } @@ -5866,19 +5859,19 @@ This list includes suffixes for both compiled and source Emacs Lisp files. This list should not include the empty string. `load' and related functions try to append these suffixes, in order, to the specified file name if a suffix is allowed or required. */); - Vload_suffixes = list2 (build_pure_c_string (".elc"), - build_pure_c_string (".el")); + Vload_suffixes = list2 (build_string (".elc"), + build_string (".el")); #ifdef HAVE_MODULES - Vload_suffixes = Fcons (build_pure_c_string (MODULES_SUFFIX), Vload_suffixes); + Vload_suffixes = Fcons (build_string (MODULES_SUFFIX), Vload_suffixes); #ifdef MODULES_SECONDARY_SUFFIX Vload_suffixes = - Fcons (build_pure_c_string (MODULES_SECONDARY_SUFFIX), Vload_suffixes); + Fcons (build_string (MODULES_SECONDARY_SUFFIX), Vload_suffixes); #endif #endif DEFVAR_LISP ("module-file-suffix", Vmodule_file_suffix, doc: /* Suffix of loadable module file, or nil if modules are not supported. */); #ifdef HAVE_MODULES - Vmodule_file_suffix = build_pure_c_string (MODULES_SUFFIX); + Vmodule_file_suffix = build_string (MODULES_SUFFIX); #else Vmodule_file_suffix = Qnil; #endif @@ -5888,9 +5881,9 @@ to the specified file name if a suffix is allowed or required. */); #ifndef MSDOS Vdynamic_library_suffixes - = Fcons (build_pure_c_string (DYNAMIC_LIB_SECONDARY_SUFFIX), Qnil); + = Fcons (build_string (DYNAMIC_LIB_SECONDARY_SUFFIX), Qnil); Vdynamic_library_suffixes - = Fcons (build_pure_c_string (DYNAMIC_LIB_SUFFIX), + = Fcons (build_string (DYNAMIC_LIB_SUFFIX), Vdynamic_library_suffixes); #else Vdynamic_library_suffixes = Qnil; @@ -6042,8 +6035,7 @@ from the file, and matches them against this regular expression. When the regular expression matches, the file is considered to be safe to load. */); Vbytecomp_version_regexp - = build_pure_c_string - ("^;;;.\\(?:in Emacs version\\|bytecomp version FSF\\)"); + = build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); DEFSYM (Qlexical_binding, "lexical-binding"); DEFVAR_LISP ("lexical-binding", Vlexical_binding, @@ -6113,7 +6105,7 @@ through `require'. */); #if !IEEE_FLOATING_POINT for (int negative = 0; negative < 2; negative++) { - not_a_number[negative] = build_pure_c_string (&"-0.0e+NaN"[!negative]); + not_a_number[negative] = build_string (&"-0.0e+NaN"[!negative]); staticpro (¬_a_number[negative]); } #endif diff --git a/src/pdumper.c b/src/pdumper.c index 7b1ec229601..015c899a704 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -4144,8 +4144,6 @@ types. */) calln (intern_c_string ("load--fixup-all-elns")); #endif - check_pure_size (); - /* Clear out any detritus in memory. */ do { diff --git a/src/pgtkfns.c b/src/pgtkfns.c index 2c87ba8e326..73cd6e5695d 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -3881,7 +3881,7 @@ syms_of_pgtkfns (void) GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); int len = strlen (ver); - Vgtk_version_string = make_pure_string (ver, len, len, false); + Vgtk_version_string = make_specified_string (ver, len, len, false); g_free (ver); } @@ -3895,7 +3895,7 @@ syms_of_pgtkfns (void) CAIRO_VERSION_MAJOR, CAIRO_VERSION_MINOR, CAIRO_VERSION_MICRO); int len = strlen (ver); - Vcairo_version_string = make_pure_string (ver, len, len, false); + Vcairo_version_string = make_specified_string (ver, len, len, false); g_free (ver); } diff --git a/src/pgtkterm.c b/src/pgtkterm.c index dd85d622a62..afaab483d57 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -7419,7 +7419,7 @@ syms_of_pgtkterm (void) DEFSYM (Qlatin_1, "latin-1"); xg_default_icon_file - = build_pure_c_string ("icons/hicolor/scalable/apps/emacs.svg"); + = build_string ("icons/hicolor/scalable/apps/emacs.svg"); staticpro (&xg_default_icon_file); DEFSYM (Qx_gtk_map_stock, "x-gtk-map-stock"); diff --git a/src/process.c b/src/process.c index c7473d3111f..807f06f990b 100644 --- a/src/process.c +++ b/src/process.c @@ -9007,7 +9007,7 @@ sentinel or a process filter function has an error. */); const struct socket_options *sopt; #define ADD_SUBFEATURE(key, val) \ - subfeatures = pure_cons (pure_cons (key, pure_cons (val, Qnil)), subfeatures) + subfeatures = Fcons (Fcons (key, Fcons (val, Qnil)), subfeatures) ADD_SUBFEATURE (QCnowait, Qt); #ifdef DATAGRAM_SOCKETS @@ -9029,7 +9029,7 @@ sentinel or a process filter function has an error. */); ADD_SUBFEATURE (QCserver, Qt); for (sopt = socket_options; sopt->name; sopt++) - subfeatures = pure_cons (intern_c_string (sopt->name), subfeatures); + subfeatures = Fcons (intern_c_string (sopt->name), subfeatures); Fprovide (intern_c_string ("make-network-process"), subfeatures); } diff --git a/src/search.c b/src/search.c index f0672fca151..4a1a4868a82 100644 --- a/src/search.c +++ b/src/search.c @@ -3454,19 +3454,19 @@ syms_of_search (void) DEFSYM (Qinvalid_regexp, "invalid-regexp"); Fput (Qsearch_failed, Qerror_conditions, - pure_list (Qsearch_failed, Qerror)); + list (Qsearch_failed, Qerror)); Fput (Qsearch_failed, Qerror_message, - build_pure_c_string ("Search failed")); + build_string ("Search failed")); Fput (Quser_search_failed, Qerror_conditions, - pure_list (Quser_search_failed, Quser_error, Qsearch_failed, Qerror)); + list (Quser_search_failed, Quser_error, Qsearch_failed, Qerror)); Fput (Quser_search_failed, Qerror_message, - build_pure_c_string ("Search failed")); + build_string ("Search failed")); Fput (Qinvalid_regexp, Qerror_conditions, - pure_list (Qinvalid_regexp, Qerror)); + list (Qinvalid_regexp, Qerror)); Fput (Qinvalid_regexp, Qerror_message, - build_pure_c_string ("Invalid regexp")); + build_string ("Invalid regexp")); re_match_object = Qnil; staticpro (&re_match_object); diff --git a/src/sqlite.c b/src/sqlite.c index ec3f1b54c96..0de7488d8fd 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -899,15 +899,15 @@ syms_of_sqlite (void) DEFSYM (Qsqlite_error, "sqlite-error"); Fput (Qsqlite_error, Qerror_conditions, - Fpurecopy (list2 (Qsqlite_error, Qerror))); + list2 (Qsqlite_error, Qerror)); Fput (Qsqlite_error, Qerror_message, - build_pure_c_string ("Database error")); + build_string ("Database error")); DEFSYM (Qsqlite_locked_error, "sqlite-locked-error"); Fput (Qsqlite_locked_error, Qerror_conditions, - Fpurecopy (list3 (Qsqlite_locked_error, Qsqlite_error, Qerror))); + list3 (Qsqlite_locked_error, Qsqlite_error, Qerror)); Fput (Qsqlite_locked_error, Qerror_message, - build_pure_c_string ("Database locked")); + build_string ("Database locked")); DEFSYM (Qsqlitep, "sqlitep"); DEFSYM (Qfalse, "false"); diff --git a/src/syntax.c b/src/syntax.c index 6751989bd3b..fbb5dffcd22 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -3679,9 +3679,9 @@ syms_of_syntax (void) DEFSYM (Qscan_error, "scan-error"); Fput (Qscan_error, Qerror_conditions, - pure_list (Qscan_error, Qerror)); + list (Qscan_error, Qerror)); Fput (Qscan_error, Qerror_message, - build_pure_c_string ("Scan error")); + build_string ("Scan error")); DEFVAR_BOOL ("parse-sexp-ignore-comments", parse_sexp_ignore_comments, doc: /* Non-nil means `forward-sexp', etc., should treat comments as whitespace. */); diff --git a/src/treesit.c b/src/treesit.c index 2c14f965c2d..62606d99749 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -4481,43 +4481,43 @@ applies to LANGUAGE-A will be redirected to LANGUAGE-B instead. */); Fmake_variable_buffer_local (Qtreesit_language_remap_alist); staticpro (&Vtreesit_str_libtree_sitter); - Vtreesit_str_libtree_sitter = build_pure_c_string ("libtree-sitter-"); + Vtreesit_str_libtree_sitter = build_string ("libtree-sitter-"); staticpro (&Vtreesit_str_tree_sitter); - Vtreesit_str_tree_sitter = build_pure_c_string ("tree-sitter-"); + Vtreesit_str_tree_sitter = build_string ("tree-sitter-"); #ifndef WINDOWSNT staticpro (&Vtreesit_str_dot_0); - Vtreesit_str_dot_0 = build_pure_c_string (".0"); + Vtreesit_str_dot_0 = build_string (".0"); #endif staticpro (&Vtreesit_str_dot); - Vtreesit_str_dot = build_pure_c_string ("."); + Vtreesit_str_dot = build_string ("."); staticpro (&Vtreesit_str_question_mark); - Vtreesit_str_question_mark = build_pure_c_string ("?"); + Vtreesit_str_question_mark = build_string ("?"); staticpro (&Vtreesit_str_star); - Vtreesit_str_star = build_pure_c_string ("*"); + Vtreesit_str_star = build_string ("*"); staticpro (&Vtreesit_str_plus); - Vtreesit_str_plus = build_pure_c_string ("+"); + Vtreesit_str_plus = build_string ("+"); staticpro (&Vtreesit_str_pound_equal); - Vtreesit_str_pound_equal = build_pure_c_string ("#equal"); + Vtreesit_str_pound_equal = build_string ("#equal"); staticpro (&Vtreesit_str_pound_match); - Vtreesit_str_pound_match = build_pure_c_string ("#match"); + Vtreesit_str_pound_match = build_string ("#match"); staticpro (&Vtreesit_str_pound_pred); - Vtreesit_str_pound_pred = build_pure_c_string ("#pred"); + Vtreesit_str_pound_pred = build_string ("#pred"); staticpro (&Vtreesit_str_open_bracket); - Vtreesit_str_open_bracket = build_pure_c_string ("["); + Vtreesit_str_open_bracket = build_string ("["); staticpro (&Vtreesit_str_close_bracket); - Vtreesit_str_close_bracket = build_pure_c_string ("]"); + Vtreesit_str_close_bracket = build_string ("]"); staticpro (&Vtreesit_str_open_paren); - Vtreesit_str_open_paren = build_pure_c_string ("("); + Vtreesit_str_open_paren = build_string ("("); staticpro (&Vtreesit_str_close_paren); - Vtreesit_str_close_paren = build_pure_c_string (")"); + Vtreesit_str_close_paren = build_string (")"); staticpro (&Vtreesit_str_space); - Vtreesit_str_space = build_pure_c_string (" "); + Vtreesit_str_space = build_string (" "); staticpro (&Vtreesit_str_equal); - Vtreesit_str_equal = build_pure_c_string ("equal"); + Vtreesit_str_equal = build_string ("equal"); staticpro (&Vtreesit_str_match); - Vtreesit_str_match = build_pure_c_string ("match"); + Vtreesit_str_match = build_string ("match"); staticpro (&Vtreesit_str_pred); - Vtreesit_str_pred = build_pure_c_string ("pred"); + Vtreesit_str_pred = build_string ("pred"); defsubr (&Streesit_language_available_p); defsubr (&Streesit_library_abi_version); diff --git a/src/w32fns.c b/src/w32fns.c index 225a3a0999e..89a4d46240a 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -11064,9 +11064,9 @@ syms_of_w32fns (void) DEFSYM (Qjson, "json"); Fput (Qundefined_color, Qerror_conditions, - pure_list (Qundefined_color, Qerror)); + list (Qundefined_color, Qerror)); Fput (Qundefined_color, Qerror_message, - build_pure_c_string ("Undefined color")); + build_string ("Undefined color")); staticpro (&w32_grabbed_keys); w32_grabbed_keys = Qnil; diff --git a/src/xdisp.c b/src/xdisp.c index bbb21c2e061..738ffa27442 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -37675,7 +37675,7 @@ See also `overlay-arrow-string'. */); DEFVAR_LISP ("overlay-arrow-string", Voverlay_arrow_string, doc: /* String to display as an arrow in text-mode frames. See also `overlay-arrow-position'. */); - Voverlay_arrow_string = build_pure_c_string ("=>"); + Voverlay_arrow_string = build_string ("=>"); DEFVAR_LISP ("overlay-arrow-variable-list", Voverlay_arrow_variable_list, doc: /* List of variables (symbols) which hold markers for overlay arrows. @@ -37808,17 +37808,17 @@ as `mode-line-format' (which see), and is used only on frames for which no explicit name has been set \(see `modify-frame-parameters'). If the value is t, that means use `frame-title-format' for iconified frames. */); - /* Do not nest calls to pure_list. This works around a bug in + /* Do not nest calls to list. This works around a bug in Oracle Developer Studio 12.6. */ Lisp_Object icon_title_name_format - = pure_list (empty_unibyte_string, - build_pure_c_string ("%b - GNU Emacs at "), - intern_c_string ("system-name")); + = list (empty_unibyte_string, + build_string ("%b - GNU Emacs at "), + intern_c_string ("system-name")); Vicon_title_format = Vframe_title_format - = pure_list (intern_c_string ("multiple-frames"), - build_pure_c_string ("%b"), - icon_title_name_format); + = list (intern_c_string ("multiple-frames"), + build_string ("%b"), + icon_title_name_format); DEFVAR_LISP ("message-log-max", Vmessage_log_max, doc: /* Maximum number of lines to keep in the message log buffer. diff --git a/src/xfaces.c b/src/xfaces.c index e9500b98524..602f551252e 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -7544,7 +7544,7 @@ only for this purpose. */); This stipple pattern is used on monochrome displays instead of shades of gray for a face background color. See `set-face-stipple' for possible values for this variable. */); - Vface_default_stipple = build_pure_c_string ("gray3"); + Vface_default_stipple = build_string ("gray3"); DEFVAR_LISP ("tty-defined-color-alist", Vtty_defined_color_alist, doc: /* An alist of defined terminal colors and their RGB values. diff --git a/src/xfns.c b/src/xfns.c index f0207ebbcee..ec7d54180e4 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -10253,9 +10253,9 @@ syms_of_xfns (void) DEFSYM (QXdndActionPrivate, "XdndActionPrivate"); Fput (Qundefined_color, Qerror_conditions, - pure_list (Qundefined_color, Qerror)); + list (Qundefined_color, Qerror)); Fput (Qundefined_color, Qerror_message, - build_pure_c_string ("Undefined color")); + build_string ("Undefined color")); DEFVAR_LISP ("x-pointer-shape", Vx_pointer_shape, doc: /* The shape of the pointer when over text. @@ -10482,7 +10482,7 @@ eliminated in future versions of Emacs. */); char gtk_version[sizeof ".." + 3 * INT_STRLEN_BOUND (int)]; int len = sprintf (gtk_version, "%d.%d.%d", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); - Vgtk_version_string = make_pure_string (gtk_version, len, len, false); + Vgtk_version_string = make_specified_string (gtk_version, len, len, false); } #endif /* USE_GTK */ @@ -10496,7 +10496,8 @@ eliminated in future versions of Emacs. */); int len = sprintf (cairo_version, "%d.%d.%d", CAIRO_VERSION_MAJOR, CAIRO_VERSION_MINOR, CAIRO_VERSION_MICRO); - Vcairo_version_string = make_pure_string (cairo_version, len, len, false); + Vcairo_version_string = make_specified_string (cairo_version, len, len, + false); } #endif diff --git a/src/xftfont.c b/src/xftfont.c index 459c5158d80..d18106d9936 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -810,7 +810,7 @@ do not actually have glyphs with colors that can cause Xft crashes. The font families in this list will not be ignored when `xft-ignore-color-fonts' is non-nil. */); - Vxft_color_font_whitelist = list1 (build_pure_c_string ("Source Code Pro")); + Vxft_color_font_whitelist = list1 (build_string ("Source Code Pro")); pdumper_do_now_and_after_load (syms_of_xftfont_for_pdumper); } diff --git a/src/xterm.c b/src/xterm.c index e024b36daf5..5159aed495c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -32587,7 +32587,7 @@ syms_of_xterm (void) DEFSYM (Qwheel_right, "wheel-right"); #ifdef USE_GTK - xg_default_icon_file = build_pure_c_string ("icons/hicolor/scalable/apps/emacs.svg"); + xg_default_icon_file = build_string ("icons/hicolor/scalable/apps/emacs.svg"); staticpro (&xg_default_icon_file); DEFSYM (Qx_gtk_map_stock, "x-gtk-map-stock");