[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 8290a1bacb0 1/2: Replace a few calls to intern with constant stri
From: |
Po Lu |
Subject: |
master 8290a1bacb0 1/2: Replace a few calls to intern with constant strings |
Date: |
Thu, 8 Feb 2024 21:50:46 -0500 (EST) |
branch: master
commit 8290a1bacb019f5026caa08334a7087802ebc6f9
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Replace a few calls to intern with constant strings
* 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.
---
src/fns.c | 6 ++++--
src/lread.c | 7 ++++++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/fns.c b/src/fns.c
index 7de2616b359..61d87752777 100644
--- 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");
}
diff --git a/src/lread.c b/src/lread.c
index b5eeb55bb70..5aa7466cc12 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -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");
}