]> git.eshelyaron.com Git - emacs.git/commitdiff
Replace a few calls to intern with constant strings
authorPo Lu <luangruo@yahoo.com>
Fri, 9 Feb 2024 01:53:33 +0000 (09:53 +0800)
committerEshel Yaron <me@eshelyaron.com>
Fri, 9 Feb 2024 10:44:58 +0000 (11:44 +0100)
* src/fns.c (do_yes_or_no_p, Fyes_or_no_p): Use symbol globals
rather than intern.
(syms_of_fns) <Qyes_or_no_p, Qy_or_n_p>: New symbols.

* src/lread.c (readevalloop): Use symbol global.
(syms_of_lread) <Qinternal_macroexpand_for_load>: New symbol.

(cherry picked from commit 8290a1bacb019f5026caa08334a7087802ebc6f9)

src/fns.c
src/lread.c

index 7de2616b359b92b688266b50acf250812f0ce15d..61d87752777f3c2240fd8947a313d6424aa8e6a6 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -3211,7 +3211,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
 Lisp_Object
 do_yes_or_no_p (Lisp_Object prompt)
 {
-  return call1 (intern ("yes-or-no-p"), prompt);
+  return call1 (Qyes_or_no_p, prompt);
 }
 
 DEFUN ("yes-or-no-p", Fyes_or_no_p, Syes_or_no_p, 1, 1, 0,
@@ -3256,7 +3256,7 @@ by a mouse, or by some window-system gesture, or via a menu.  */)
     }
 
   if (use_short_answers)
-    return call1 (intern ("y-or-n-p"), prompt);
+    return call1 (Qy_or_n_p, prompt);
 
   {
     char *s = SSDATA (prompt);
@@ -6618,4 +6618,6 @@ For best results this should end in a space.  */);
 
   DEFSYM (Qreal_this_command, "real-this-command");
   DEFSYM (Qfrom__tty_menu_p, "from--tty-menu-p");
+  DEFSYM (Qyes_or_no_p, "yes-or-no-p");
+  DEFSYM (Qy_or_n_p, "y-or-n-p");
 }
index b5eeb55bb705d36aad274464aefb7fbfc8b2a8aa..5aa7466cc123b81cb188b91be86f581dd0968c2c 100644 (file)
@@ -2443,11 +2443,13 @@ readevalloop (Lisp_Object readcharfun,
   bool whole_buffer = 0;
   /* True on the first time around.  */
   bool first_sexp = 1;
-  Lisp_Object macroexpand = intern ("internal-macroexpand-for-load");
+  Lisp_Object macroexpand;
 
   if (!NILP (sourcename))
     CHECK_STRING (sourcename);
 
+  macroexpand = Qinternal_macroexpand_for_load;
+
   if (NILP (Ffboundp (macroexpand))
       || (STRINGP (sourcename) && suffix_p (sourcename, ".elc")))
     /* Don't macroexpand before the corresponding function is defined
@@ -6016,4 +6018,7 @@ See Info node `(elisp)Shorthands' for more details.  */);
         doc:   /* List of variables declared dynamic in the current scope.
 Only valid during macro-expansion.  Internal use only. */);
   Vmacroexp__dynvars = Qnil;
+
+  DEFSYM (Qinternal_macroexpand_for_load,
+         "internal-macroexpand-for-load");
 }