From: Mattias EngdegÄrd Date: Thu, 10 Jul 2025 11:32:55 +0000 (+0200) Subject: Unintern Qget_file_char and Qget_emacs_mule_file_char X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=eb40864082d07362591393ef690497db03cffcbf;p=emacs.git Unintern Qget_file_char and Qget_emacs_mule_file_char These symbols are used in the reader as special constants and can't be passed from Lisp (Emacs would crash). * src/lread.c (syms_of_lread): Unintern. (init_source): Use BASE_EQ. (cherry picked from commit b83f2d16fbd327e04186c5ae94f90bb907294573) --- diff --git a/src/lread.c b/src/lread.c index 45ce3625a64..5b7848c3118 100644 --- a/src/lread.c +++ b/src/lread.c @@ -310,13 +310,14 @@ init_source (source_t *src, Lisp_Object readcharfun) src->unget = source_string_unget; src->multibyte = STRING_MULTIBYTE (readcharfun); } - else if (EQ (readcharfun, Qget_file_char) - || EQ (readcharfun, Qget_emacs_mule_file_char)) + else if (BASE_EQ (readcharfun, Qget_file_char) + || BASE_EQ (readcharfun, Qget_emacs_mule_file_char)) { src->get = source_file_get; src->unget = source_file_unget; src->multibyte = true; - src->emacs_mule_encoding = EQ (readcharfun, Qget_emacs_mule_file_char); + src->emacs_mule_encoding = BASE_EQ (readcharfun, + Qget_emacs_mule_file_char); eassert (infile != NULL); } else @@ -6169,12 +6170,18 @@ will use instead of `load-path' to look for the file to load. */); DEFSYM (Qcurrent_load_list, "current-load-list"); DEFSYM (Qstandard_input, "standard-input"); DEFSYM (Qread_char, "read-char"); + DEFSYM (Qget_file_char, "get-file-char"); /* Used instead of Qget_file_char while loading *.elc files compiled by Emacs 21 or older. */ DEFSYM (Qget_emacs_mule_file_char, "get-emacs-mule-file-char"); + /* These are only used as internal READCHARFUN in the C code and + cannot be used from Lisp. */ + Funintern (Qget_file_char, Qnil); + Funintern (Qget_emacs_mule_file_char, Qnil); + DEFSYM (Qload_force_doc_strings, "load-force-doc-strings"); DEFSYM (Qbackquote, "`");