aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorPo Lu2024-05-09 14:58:45 +0800
committerPo Lu2024-05-09 15:07:22 +0800
commit67ab6bcdbac572a6266d7c9d15833bd2ddd049fa (patch)
tree3469eaa3f625da33e3c5c5e0e91cc5c202552c81 /src/keymap.c
parent9b7dd30807ed4be9afe4f66cfa5130aa7d178989 (diff)
downloademacs-67ab6bcdbac572a6266d7c9d15833bd2ddd049fa.tar.gz
emacs-67ab6bcdbac572a6266d7c9d15833bd2ddd049fa.zip
Replace calls to intern with a constant string with DEFSYMs
* src/alloc.c (display_malloc_warning, syms_of_alloc): * src/buffer.c (Fmake_indirect_buffer, Fbuffer_local_variables) (Frename_buffer, Fkill_buffer, Fset_buffer_major_mode) (Fset_buffer_multibyte, syms_of_buffer): * src/callint.c (read_file_name, Fcall_interactively) (syms_of_callint): * src/callproc.c (call_process, create_temp_file) (syms_of_callproc): * src/charset.c (Fdefine_charset_internal, syms_of_charset): * src/cmds.c (internal_self_insert, syms_of_cmds): * src/coding.c (record_conversion_result) (Fdefine_coding_system_internal, syms_of_coding): * src/dbusbind.c (xd_signature, Fdbus_message_internal) (syms_of_dbusbind): * src/dispnew.c (init_faces_initial): * src/doc.c (Fsnarf_documentation, syms_of_doc): * src/dosfns.c (system_process_attributes, syms_of_dosfns): * src/emacs.c (init_cmdargs, Fdump_emacs, decode_env_path) (syms_of_emacs): * src/eval.c (call_debugger, Fdefvaralias, syms_of_eval): * src/fileio.c (barf_or_query_if_file_exists) (Finsert_file_contents, auto_save_error, Fdo_auto_save) (syms_of_fileio): * src/filelock.c (lock_file_1, syms_of_filelock): * src/fontset.c (fontset_from_font, syms_of_fontset): * src/frame.c (make_frame_without_minibuffer, syms_of_frame): * src/gnutls.c (emacs_gnutls_certificate_details) (Fgnutls_peer_status_warning_describe, Fgnutls_peer_status) (gnutls_verify_boot, syms_of_gnutls): * src/gtkutil.c (style_changed_cb, find_rtl_image): * src/image.c (imagemagick_filename_hint, gs_load) (syms_of_image): * src/keyboard.c (command_loop_1, read_char, timer_start_idle) (read_char_minibuf_menu_prompt, Fsuspend_emacs) (syms_of_keyboard): * src/keymap.c (Fmap_keymap, Flookup_key, Fdescribe_vector) (describe_vector, syms_of_keymap): * src/lread.c (Fread, Fread_positioning_symbols, syms_of_lread): * src/minibuf.c (Fabort_minibuffers, Fread_buffer) (Fcompleting_read, syms_of_minibuf): * src/msdos.c (XMenuActivate, run_msdos_command, syms_of_msdos): * src/nsfns.m (Fx_display_backing_store, Fx_display_visual_class) (Fns_hide_emacs, Fsystem_move_file_to_trash, ns_create_tip_frame) (x_hide_tip, Fx_show_tip, syms_of_nsfns): * src/nsfont.m (ns_spec_to_descriptor, ns_descriptor_to_entity) (syms_of_nsfont): * src/pdumper.c (Fdump_emacs_portable): * src/pgtkfns.c (Fx_display_visual_class, x_create_tip_frame) (Fx_show_tip, syms_of_pgtkfns): * src/pgtkterm.c (syms_of_pgtkterm, pgtk_cr_export_frames): * src/term.c (term_get_fkeys_1, set_tty_color_mode, Fsuspend_tty) (Fresume_tty, tty_menu_activate, syms_of_term): * src/terminal.c (create_terminal, syms_of_terminal): * src/w32fns.c (Fx_display_backing_store) (Fx_display_visual_class, Fset_message_beep, Fx_open_connection) (Fx_show_tip, Fx_file_dialog, Fsystem_move_file_to_trash) (Fw32_toggle_lock_key, syms_of_w32fns): * src/w32font.c (w32_enumfont_pattern_entity, syms_of_w32font): * src/w32term.c (w32_bitmap_icon, syms_of_w32term): * src/xdisp.c (message_dolog, define_frame_cursor1) (syms_of_xdisp): * src/xfaces.c (tty_lookup_color, syms_of_xfaces): * src/xml.c (make_dom, syms_of_xml): * src/xterm.c (syms_of_xterm): * src/xwidget.c (store_xwidget_download_callback_event) (store_xwidget_js_callback_event, syms_of_xwidget): Define symbols for symbols interned with `intern' from a constant string, delete duplicate DEFSYM directives, and substitute them for such calls to intern. This excludes only those symbols which are interned and referenced only once during Emacs's initialization, the timing of whose interning is inconsequential, and symbols in w32.c, which would need to be transferred to a new syms_of_w32 function that I cannot test.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/keymap.c b/src/keymap.c
index b9d8d18931d..0f50d804dff 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -642,7 +642,7 @@ usage: (map-keymap FUNCTION KEYMAP) */)
642 (Lisp_Object function, Lisp_Object keymap, Lisp_Object sort_first) 642 (Lisp_Object function, Lisp_Object keymap, Lisp_Object sort_first)
643{ 643{
644 if (! NILP (sort_first)) 644 if (! NILP (sort_first))
645 return call2 (intern ("map-keymap-sorted"), function, keymap); 645 return call2 (Qmap_keymap_sorted, function, keymap);
646 646
647 map_keymap (keymap, map_keymap_call, function, NULL, 1); 647 map_keymap (keymap, map_keymap_call, function, NULL, 1);
648 return Qnil; 648 return Qnil;
@@ -1334,7 +1334,7 @@ recognize the default bindings, just as `read-key-sequence' does. */)
1334 /* Initialize the unicode case table, if it wasn't already. */ 1334 /* Initialize the unicode case table, if it wasn't already. */
1335 if (NILP (unicode_case_table)) 1335 if (NILP (unicode_case_table))
1336 { 1336 {
1337 unicode_case_table = uniprop_table (intern ("lowercase")); 1337 unicode_case_table = uniprop_table (Qlowercase);
1338 /* uni-lowercase.el might be unavailable during bootstrap. */ 1338 /* uni-lowercase.el might be unavailable during bootstrap. */
1339 if (NILP (unicode_case_table)) 1339 if (NILP (unicode_case_table))
1340 return found; 1340 return found;
@@ -3053,7 +3053,7 @@ DESCRIBER is the output function used; nil means use `princ'. */)
3053{ 3053{
3054 specpdl_ref count = SPECPDL_INDEX (); 3054 specpdl_ref count = SPECPDL_INDEX ();
3055 if (NILP (describer)) 3055 if (NILP (describer))
3056 describer = intern ("princ"); 3056 describer = Qprinc;
3057 specbind (Qstandard_output, Fcurrent_buffer ()); 3057 specbind (Qstandard_output, Fcurrent_buffer ());
3058 CHECK_VECTOR_OR_CHAR_TABLE (vector); 3058 CHECK_VECTOR_OR_CHAR_TABLE (vector);
3059 describe_vector (vector, Qnil, describer, describe_vector_princ, 0, 3059 describe_vector (vector, Qnil, describer, describe_vector_princ, 0,
@@ -3169,7 +3169,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
3169 Lisp_Object kludge = make_nil_vector (1); 3169 Lisp_Object kludge = make_nil_vector (1);
3170 3170
3171 if (partial) 3171 if (partial)
3172 suppress = intern ("suppress-keymap"); 3172 suppress = Qsuppress_keymap;
3173 3173
3174 /* STOP is a boundary between normal characters (-#x3FFF7F) and 3174 /* STOP is a boundary between normal characters (-#x3FFF7F) and
3175 8-bit characters (#x3FFF80-), used below when VECTOR is a 3175 8-bit characters (#x3FFF80-), used below when VECTOR is a
@@ -3342,6 +3342,7 @@ syms_of_keymap (void)
3342{ 3342{
3343 DEFSYM (Qkeymap, "keymap"); 3343 DEFSYM (Qkeymap, "keymap");
3344 DEFSYM (Qhelp__describe_map_tree, "help--describe-map-tree"); 3344 DEFSYM (Qhelp__describe_map_tree, "help--describe-map-tree");
3345 DEFSYM (Qmap_keymap_sorted, "map-keymap-sorted");
3345 3346
3346 DEFSYM (Qkeymap_canonicalize, "keymap-canonicalize"); 3347 DEFSYM (Qkeymap_canonicalize, "keymap-canonicalize");
3347 3348
@@ -3485,6 +3486,7 @@ that describe key bindings. That is why the default is nil. */);
3485 3486
3486 DEFSYM (Qkey_parse, "key-parse"); 3487 DEFSYM (Qkey_parse, "key-parse");
3487 DEFSYM (Qkey_valid_p, "key-valid-p"); 3488 DEFSYM (Qkey_valid_p, "key-valid-p");
3488
3489 DEFSYM (Qnon_key_event, "non-key-event"); 3489 DEFSYM (Qnon_key_event, "non-key-event");
3490 DEFSYM (Qprinc, "princ");
3491 DEFSYM (Qsuppress_keymap, "suppress-keymap");
3490} 3492}