summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2021-04-20 10:14:40 +0000
committerAlan Mackenzie <acm@muc.de>2021-04-20 10:14:40 +0000
commit55db25b2579e5d84dfcf3a15957fc7a827abf25f (patch)
treefb6e10d4f8cc64ded0af807b8c6384a99b4392fc /src
parent296ef2e99b7cd83ad236230ddc941c7dbc8766e6 (diff)
Introduce and use minibuffer-mode. This fixes bug #47150
* lisp/minibuffer.el (minibuffer-mode): New derived mode. * src/minibuf.c (syms_of_minibuf): New DEFSYMs Qminibuffer_mode, Qminibuffer_inactive_mode, Qminibuffer_completing_file_name, Qselect_frame_set_input_focus, Qadd_to_history. (read_minibuf, set_minibuffer_mode, read_minibuf_unwind): Use the new DEFSYMs in place of continual interning. (set_minibuffer_mode): Put an active minibuffer into minibuffer-mode rather than fundamental-mode. * doc/emacs/mini.texi (Minibuffer Edit): Mention minibuffer-mode. * doc/lispref/minibuf.texi (Intro to Minibuffers): Add a paragraph about minibuffer-mode. * etc/NEWS (Incompatible Lisp Changes in Emacs 28.1): Add an entry.
Diffstat (limited to 'src')
-rw-r--r--src/minibuf.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index f0258172766..b823224a5f2 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -567,7 +567,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
in previous recursive minibuffer, but was not set explicitly
to t for this invocation, so set it to nil in this minibuffer.
Save the old value now, before we change it. */
- specbind (intern ("minibuffer-completing-file-name"),
+ specbind (Qminibuffer_completing_file_name,
Vminibuffer_completing_file_name);
if (EQ (Vminibuffer_completing_file_name, Qlambda))
Vminibuffer_completing_file_name = Qnil;
@@ -920,13 +920,13 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
&& !EQ (XWINDOW (XFRAME (calling_frame)->minibuffer_window)
->frame,
calling_frame))))
- call2 (intern ("select-frame-set-input-focus"), calling_frame, Qnil);
+ call2 (Qselect_frame_set_input_focus, calling_frame, Qnil);
/* Add the value to the appropriate history list, if any. This is
done after the previous buffer has been made current again, in
case the history variable is buffer-local. */
if (! (NILP (Vhistory_add_new_input) || NILP (histstring)))
- call2 (intern ("add-to-history"), histvar, histstring);
+ call2 (Qadd_to_history, histvar, histstring);
/* If Lisp form desired instead of string, parse it. */
if (expflag)
@@ -965,13 +965,13 @@ set_minibuffer_mode (Lisp_Object buf, EMACS_INT depth)
Fset_buffer (buf);
if (depth > 0)
{
- if (!NILP (Ffboundp (intern ("fundamental-mode"))))
- call0 (intern ("fundamental-mode"));
+ if (!NILP (Ffboundp (Qminibuffer_mode)))
+ call0 (Qminibuffer_mode);
}
else
{
- if (!NILP (Ffboundp (intern ("minibuffer-inactive-mode"))))
- call0 (intern ("minibuffer-inactive-mode"));
+ if (!NILP (Ffboundp (Qminibuffer_inactive_mode)))
+ call0 (Qminibuffer_inactive_mode);
else
Fkill_all_local_variables ();
}
@@ -1163,7 +1163,7 @@ read_minibuf_unwind (void)
dead, we may keep displaying this buffer (tho it's inactive), so reset it,
to make sure we don't leave around bindings and stuff which only
made sense during the read_minibuf invocation. */
- call0 (intern ("minibuffer-inactive-mode"));
+ call0 (Qminibuffer_inactive_mode);
/* We've exited the recursive edit, so switch the current windows
away from the expired minibuffer window, both in the current
@@ -2333,6 +2333,12 @@ syms_of_minibuf (void)
/* A frame parameter. */
DEFSYM (Qminibuffer_exit, "minibuffer-exit");
+ DEFSYM (Qminibuffer_mode, "minibuffer-mode");
+ DEFSYM (Qminibuffer_inactive_mode, "minibuffer-inactive-mode");
+ DEFSYM (Qminibuffer_completing_file_name, "minibuffer-completing-file-name");
+ DEFSYM (Qselect_frame_set_input_focus, "select-frame-set-input-focus");
+ DEFSYM (Qadd_to_history, "add-to-history");
+
DEFVAR_LISP ("read-expression-history", Vread_expression_history,
doc: /* A history list for arguments that are Lisp expressions to evaluate.
For example, `eval-expression' uses this. */);