]> git.eshelyaron.com Git - emacs.git/commitdiff
Unintern Qget_file_char and Qget_emacs_mule_file_char
authorMattias EngdegÄrd <mattiase@acm.org>
Thu, 10 Jul 2025 11:32:55 +0000 (13:32 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 08:00:48 +0000 (10:00 +0200)
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)

src/lread.c

index 45ce3625a64de89e45b4f26bc3d9cfd35d94cf4d..5b7848c31187cc1ae8b836d0ff9bddece164d890 100644 (file)
@@ -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, "`");