aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorPip Cet2021-05-16 15:44:26 +0200
committerStefan Monnier2022-07-01 18:59:35 -0400
commitb6a526361b57f8d9f6d5078ccd97832d0a1fb036 (patch)
tree0c752a1c74920a2b731bb2e3c2ff6623be240a72 /src/keymap.c
parent3daf833ff3f3e99b44731808cb197c0912649997 (diff)
downloademacs-scratch/no-purespace-old.tar.gz
emacs-scratch/no-purespace-old.zip
Remove purespace and ancillary codescratch/no-purespace-old
Now that purespace is not used any more, remove it, along with the functions used to allocate into it. Use equivalent functions allocating into the normal heap. Remove calls to PURE_P since they always return false. * src/puresize.h: Delete file. * src/alloc.c: Don't include `puresize.h` any more. (pure, purebeg, pure_size, pure_bytes_used_before_overflow) (pure_bytes_used_lisp, pure_bytes_used_non_lisp, symbol_block_pinned) (pinned_objects): Delete vars. (PUREBEG): Delete macro. (pointer_align): Move after definition of USE_ALIGNED_ALLOC and only define it if USE_ALIGNED_ALLOC is not used. (cons_listn): Remove `cons` arg, hardcode `Fcons` instead. (pure_listn, pure_alloc, check_pure_size, make_pure_string) (make_pure_c_string, pure_cons): Delete functions. (init_symbol): Don't set `pinned` any more. (mark_pinned_objects, mark_pinned_symbols): Delete functions. (garbage_collect): Don't call them any more. (init_alloc_once_for_pdumper): Don't initialize purebeg and pure_size. * src/print.c (print_object) <PVEC_HASH_TABLE>: Don't print `purecopy`. * src/pdumper.c (dump_symbol, dump_hash_table): Update sig hash. (dump_symbol): Don't dump `pinned`. (dump_hash_table): Don't dump `purecopy`. * src/lread.c (readevalloop, read_internal_start): Adjust call to `make_hash_table`. (read0, intern_c_string_1, define_symbol, Fintern): Don't purify symbol names. (string): Avoid `pure_cons` and `build_pure_c_string`. * src/lisp.h (struct Lisp_Symbol): Remove `pinned` field. (struct Lisp_Hash_Table): Remove `purecopy` field. (check_pure_size, pure_listn, pure_list, make_pure_string) (make_pure_c_string, pure_cons): Remove prototypes. (build_pure_c_string): Delete function. * src/keymap.c: Don't include `puresize.h` any more. (Fmake_sparse_keymap): Don't purecopy the menu name. (Fset_keymap_parent, store_in_keymap): Don't `CHECK_IMPURE` any more. (syms_of_keymap): Avoid `pure_cons` and `build_pure_c_string`. * src/intervals.c: Don't include `puresize.h` any more. (create_root_interval): Don't `CHECK_IMPURE` any more. * src/fns.c: Don't include `puresize.h` any more. (Ffillarray, Fclear_string): Don't `CHECK_IMPURE` any more. (make_hash_table): Remove `purecopy` arg. (Fmake_hash_table): Remove `:purecopy` keyword argument. * src/eval.c (Finternal__define_uninitialized_variable): Don't purecopy the doc any more. (Fdefconst_1): Don't purecopy the initvalue any more. (Fautoload): Get rid of hack needed when we used hash-consing. (syms_of_eval): Avoid `build_pure_c_string`. * src/emacs.c: Don't include `puresize.h` any more. (Fdump_emacs): Don't `check_pure_size`. * src/doc.c (Fsnarf_documentation): Don't purecopy the build files. * src/deps.mk: Remove puresize.h. * src/data.c: Don't include `puresize.h` any more. (pure_write_error): Delete function. (Fsetcar, Fsetcdr): Don't `CHECK_IMPURE` any more. (Fdefalias): Don't purecopy the definition any more. (Faset): Don't `CHECK_IMPURE` any more. (syms_of_data): Avoid `pure_cons` and `build_pure_c_string`. * src/conf_post.h (SYSTEM_PURESIZE_EXTRA): Delete macro. * src/comp.c: Don't include `puresize.h` any more. (helper_link_table): Remove `pure_write_error`. (define_CHECK_IMPURE): Delete function. (maybe_defer_native_compilation, syms_of_comp): Avoid `build_pure_c_string`. * src/category.c (hash_get_category_set): Update call to `make_hash_table`. (Fdefine_category): Don't purecopy the docstring any more. * src/bytecode.c: Don't include `puresize.h` any more. (Bsetcar, Bsetcdr): Don't `CHECK_IMPURE` any more. * doc/lispref/internals.texi (Pure Storage): Delete section. (Garbage Collection): Remove note about purespace overflow. * src/xfaces.c (syms_of_xfaces): * src/emacs-module.c (syms_of_module): * src/frame.c (make_frame, make_initial_frame): * src/fileio.c (syms_of_fileio): * src/image.c (xpm_make_color_table_h): * src/process.c (ADD_SUBFEATURE, syms_of_process): * src/profiler.c (make_log): * src/json.c (define_error): * src/xterm.c (syms_of_xterm): * src/xfns.c (syms_of_xfns): * src/xdisp.c (syms_of_xdisp): * src/w32fns.c (syms_of_w32fns): * src/syntax.c (syms_of_syntax): * src/sqlite.c (syms_of_sqlite): * src/search.c (syms_of_search): * src/keyboard.c (syms_of_keyboard): * src/fontset.c (syms_of_fontset): * src/dbusbind.c (syms_of_dbusbind): * src/coding.c (syms_of_coding): * src/callint.c (syms_of_callint): * src/buffer.c (init_buffer_once, syms_of_buffer): Avoid `build_pure_c_string`, `Fpurecopy`, `pure_cons`, and `pure_list`, and adjust calls to `make_hash_table`.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 2b77a7fc444..c6188a251cb 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -50,7 +50,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
50#include "keyboard.h" 50#include "keyboard.h"
51#include "termhooks.h" 51#include "termhooks.h"
52#include "blockinput.h" 52#include "blockinput.h"
53#include "puresize.h"
54#include "intervals.h" 53#include "intervals.h"
55#include "keymap.h" 54#include "keymap.h"
56#include "window.h" 55#include "window.h"
@@ -121,8 +120,6 @@ in case you use it as a menu with `x-popup-menu'. */)
121{ 120{
122 if (!NILP (string)) 121 if (!NILP (string))
123 { 122 {
124 if (!NILP (Vpurify_flag))
125 string = Fpurecopy (string);
126 return list2 (Qkeymap, string); 123 return list2 (Qkeymap, string);
127 } 124 }
128 return list1 (Qkeymap); 125 return list1 (Qkeymap);
@@ -301,7 +298,6 @@ Return PARENT. PARENT should be nil or another keymap. */)
301 If we came to the end, add the parent in PREV. */ 298 If we came to the end, add the parent in PREV. */
302 if (!CONSP (list) || KEYMAPP (list)) 299 if (!CONSP (list) || KEYMAPP (list))
303 { 300 {
304 CHECK_IMPURE (prev, XCONS (prev));
305 XSETCDR (prev, parent); 301 XSETCDR (prev, parent);
306 return parent; 302 return parent;
307 } 303 }
@@ -744,7 +740,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx,
744 740
745 /* If we are preparing to dump, and DEF is a menu element 741 /* If we are preparing to dump, and DEF is a menu element
746 with a menu item indicator, copy it to ensure it is not pure. */ 742 with a menu item indicator, copy it to ensure it is not pure. */
747 if (CONSP (def) && PURE_P (XCONS (def)) 743 if (CONSP (def)
748 && (EQ (XCAR (def), Qmenu_item) || STRINGP (XCAR (def)))) 744 && (EQ (XCAR (def), Qmenu_item) || STRINGP (XCAR (def))))
749 def = Fcons (XCAR (def), XCDR (def)); 745 def = Fcons (XCAR (def), XCDR (def));
750 746
@@ -788,7 +784,6 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx,
788 { 784 {
789 if (FIXNATP (idx) && XFIXNAT (idx) < ASIZE (elt)) 785 if (FIXNATP (idx) && XFIXNAT (idx) < ASIZE (elt))
790 { 786 {
791 CHECK_IMPURE (elt, XVECTOR (elt));
792 ASET (elt, XFIXNAT (idx), def); 787 ASET (elt, XFIXNAT (idx), def);
793 return def; 788 return def;
794 } 789 }
@@ -846,7 +841,6 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx,
846 } 841 }
847 else if (EQ (idx, XCAR (elt))) 842 else if (EQ (idx, XCAR (elt)))
848 { 843 {
849 CHECK_IMPURE (elt, XCONS (elt));
850 if (remove) 844 if (remove)
851 /* Remove the element. */ 845 /* Remove the element. */
852 insertion_point = Fdelq (elt, insertion_point); 846 insertion_point = Fdelq (elt, insertion_point);
@@ -900,7 +894,6 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx,
900 } 894 }
901 else 895 else
902 elt = Fcons (idx, def); 896 elt = Fcons (idx, def);
903 CHECK_IMPURE (insertion_point, XCONS (insertion_point));
904 XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point))); 897 XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point)));
905 } 898 }
906 } 899 }
@@ -3340,12 +3333,12 @@ syms_of_keymap (void)
3340 current_global_map = Qnil; 3333 current_global_map = Qnil;
3341 staticpro (&current_global_map); 3334 staticpro (&current_global_map);
3342 3335
3343 exclude_keys = pure_list 3336 exclude_keys = list
3344 (pure_cons (build_pure_c_string ("DEL"), build_pure_c_string ("\\d")), 3337 (Fcons (build_string ("DEL"), build_string ("\\d")),
3345 pure_cons (build_pure_c_string ("TAB"), build_pure_c_string ("\\t")), 3338 Fcons (build_string ("TAB"), build_string ("\\t")),
3346 pure_cons (build_pure_c_string ("RET"), build_pure_c_string ("\\r")), 3339 Fcons (build_string ("RET"), build_string ("\\r")),
3347 pure_cons (build_pure_c_string ("ESC"), build_pure_c_string ("\\e")), 3340 Fcons (build_string ("ESC"), build_string ("\\e")),
3348 pure_cons (build_pure_c_string ("SPC"), build_pure_c_string (" "))); 3341 Fcons (build_string ("SPC"), build_string (" ")));
3349 staticpro (&exclude_keys); 3342 staticpro (&exclude_keys);
3350 3343
3351 DEFVAR_LISP ("minibuffer-local-map", Vminibuffer_local_map, 3344 DEFVAR_LISP ("minibuffer-local-map", Vminibuffer_local_map,
@@ -3407,13 +3400,13 @@ that describe key bindings. That is why the default is nil. */);
3407 DEFSYM (Qmode_line, "mode-line"); 3400 DEFSYM (Qmode_line, "mode-line");
3408 3401
3409 staticpro (&Vmouse_events); 3402 staticpro (&Vmouse_events);
3410 Vmouse_events = pure_list (Qmenu_bar, Qtab_bar, Qtool_bar, 3403 Vmouse_events = list (Qmenu_bar, Qtab_bar, Qtool_bar, Qtab_line,
3411 Qtab_line, Qheader_line, Qmode_line, 3404 Qheader_line, Qmode_line,
3412 intern_c_string ("mouse-1"), 3405 intern_c_string ("mouse-1"),
3413 intern_c_string ("mouse-2"), 3406 intern_c_string ("mouse-2"),
3414 intern_c_string ("mouse-3"), 3407 intern_c_string ("mouse-3"),
3415 intern_c_string ("mouse-4"), 3408 intern_c_string ("mouse-4"),
3416 intern_c_string ("mouse-5")); 3409 intern_c_string ("mouse-5"));
3417 3410
3418 /* Keymap used for minibuffers when doing completion. */ 3411 /* Keymap used for minibuffers when doing completion. */
3419 /* Keymap used for minibuffers when doing completion and require a match. */ 3412 /* Keymap used for minibuffers when doing completion and require a match. */