From: Eshel Yaron Date: Wed, 10 Jul 2024 20:38:29 +0000 (+0200) Subject: Remove 'enable-recursive-minibuffers' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b7b81fe9a4255620ac79361d01a959cc4e19974e;p=emacs.git Remove 'enable-recursive-minibuffers' Thus fixing the very first change in the Emacs ChangeLog: 1985-05-11 Richard M. Stallman (rms@mit-prep) ... * minibuf.c: Don't allow entry to minibuffer while minibuffer is selected. --- diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index f71402f0de3..bbf5d3da842 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi @@ -244,14 +244,10 @@ can also scroll the help text with @kbd{M-@key{PageUp}} and @kbd{M-@key{next}}). This is especially useful with long lists of possible completions. @xref{Other Window}. -@vindex enable-recursive-minibuffers @findex minibuffer-depth-indicate-mode - Emacs normally disallows most commands that use the minibuffer while -the minibuffer is active. To allow such commands in the minibuffer, -set the variable @code{enable-recursive-minibuffers} to @code{t}. -You might need also to enable @code{minibuffer-depth-indicate-mode} -to show the current recursion depth in the minibuffer prompt -on recursive use of the minibuffer. + The global minor mode @code{minibuffer-depth-indicate-mode} shows the +current recursion depth in the minibuffer prompt on recursive use of the +minibuffer. When active, the minibuffer is usually in @code{minibuffer-mode}. This is an internal Emacs mode without any special features. diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index bd8538ced82..082d7037eb1 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -85,10 +85,7 @@ a space so that they won't show up in normal buffer lists.) Of several recursive minibuffers, the innermost (or most recently entered) is the @dfn{active minibuffer}--it is the one you can terminate by typing @key{RET} (@code{exit-minibuffer}) in. We usually -call this @emph{the} minibuffer. You can permit or forbid recursive -minibuffers by setting the variable -@code{enable-recursive-minibuffers}, or by putting properties of that -name on command symbols (@xref{Recursive Mini}.) +call this @emph{the} minibuffer. Like other buffers, a minibuffer uses a local keymap (@pxref{Keymaps}) to specify special key bindings. The function that @@ -2785,29 +2782,6 @@ minibuffer, a nonnegative integer. If no minibuffers are active, it returns zero. @end defun -@defopt enable-recursive-minibuffers -If this variable is non-@code{nil}, you can invoke commands (such as -@code{find-file}) that use minibuffers even while the minibuffer is -active. Such invocation produces a recursive editing level for a new -minibuffer. By default, the outer-level minibuffer is invisible while -you are editing the inner one. If you have -@code{minibuffer-follows-selected-frame} set to @code{nil}, you can -have minibuffers visible on several frames at the same time. -@xref{Basic Minibuffer,,, emacs}. - -If this variable is @code{nil}, you cannot invoke minibuffer commands -when the minibuffer is active, not even if you switch to another window -to do it. -@end defopt - -If a command name has a property @code{enable-recursive-minibuffers} -that is non-@code{nil}, then the command can use the minibuffer to read -arguments even if it is invoked from the minibuffer. A command can -also achieve this by binding @code{enable-recursive-minibuffers} -to @code{t} in the interactive declaration (@pxref{Using Interactive}). -The minibuffer command @code{next-matching-history-element} (normally -@kbd{M-s} in the minibuffer) does the latter. - @node Inhibiting Interaction @section Inhibiting Interaction diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 90b58f560c0..a0dc0fea766 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -2599,8 +2599,7 @@ by doing (clear-string STRING)." (read-passwd-mode 1) (add-hook 'post-command-hook #'read-passwd--hide-password nil t)) (unwind-protect - (let ((enable-recursive-minibuffers t) - (read-hide-char (or read-hide-char ?*)) + (let ((read-hide-char (or read-hide-char ?*)) (overriding-text-conversion-style 'password)) (read-string prompt nil t default)) ; t = "no history" (when (buffer-live-p minibuf) diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 0bc222d9a03..be088dc7597 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -63,7 +63,6 @@ (let* ((calc-command-flags nil) (calc-dollar-values calc-quick-prev-results) (calc-dollar-used 0) - (enable-recursive-minibuffers t) (calc-language (if (memq calc-language '(nil big)) 'flat calc-language)) (entry (calc-do-alg-entry "" "Quick calc: " t 'calc-quick-calc-history)) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index fbca1f86e04..6de308ea639 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -482,7 +482,6 @@ IF REGEXP is not a string, return it unchanged." Return a list suitable for use in `interactive'." (let* ((v (variable-at-point)) (default (and (symbolp v) (custom-variable-p v) (symbol-name v))) - (enable-recursive-minibuffers t) val) (setq val (completing-read (format-prompt "Customize variable" default) obarray 'custom-variable-p t nil diff --git a/lisp/cus-start.el b/lisp/cus-start.el index a0034b3a2c0..fadb5b9c683 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -408,7 +408,6 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of (const :tag "When used" hybrid) (const :tag "Never" nil)) "28.1") - (enable-recursive-minibuffers minibuffer boolean) (history-length minibuffer (choice (const :tag "Infinite" t) integer) "24.5") ; 30 -> 100 diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el index af87e881f14..251a92074a5 100644 --- a/lisp/emacs-lisp/crm.el +++ b/lisp/emacs-lisp/crm.el @@ -183,8 +183,7 @@ old `crm-separator' in the current minibuffer contents with REP. Interactively, prompt for SEP. With a prefix argument, prompt for REP as well." (interactive - (let* ((enable-recursive-minibuffers t) - (sep (read-regexp + (let* ((sep (read-regexp (format-prompt "New separator" crm-current-separator) crm-current-separator))) (list sep @@ -214,8 +213,7 @@ the list of common separators in `crm-common-separators', and if that fails this command prompts you for the separator to use." (interactive "" minibuffer-mode) (let ((bob (minibuffer--completion-prompt-end)) - (all-complete t) - (enable-recursive-minibuffers t)) + (all-complete t)) ;; Establish a canonical separator string, so we can insert it. (setq crm-canonical-separator (or diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index ec947c1215d..1b141e58961 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -237,10 +237,6 @@ the debugger will not be entered." last-event-frame overriding-local-map (load-read-function #'read) - ;; If we are inside a minibuffer, allow nesting - ;; so that we don't get an error from the `e' command. - (enable-recursive-minibuffers - (or enable-recursive-minibuffers (> (minibuffer-depth) 0))) (standard-input t) (standard-output t) inhibit-redisplay (cursor-in-echo-area nil) diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 4753f8362e6..06792016d3f 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -677,8 +677,7 @@ otherwise uses `variable-at-point'." (prompt-type (cdr (assq type '((nil . "function") (defvar . "variable") (defface . "face"))))) - (action this-command) - (enable-recursive-minibuffers t)) + (action this-command)) (list (intern (minibuffer-with-setup-hook (lambda () (setq minibuffer-action diff --git a/lisp/files.el b/lisp/files.el index 33216018194..a87731ea711 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6172,11 +6172,8 @@ Before and after saving the buffer, this function runs (defvar save-some-buffers-action-alist `((?\C-r ,(lambda (buf) - (if (not enable-recursive-minibuffers) - (progn (display-buffer buf) - (setq other-window-scroll-buffer buf)) - (view-buffer buf (lambda (_) (exit-recursive-edit))) - (recursive-edit)) + (view-buffer buf (lambda (_) (exit-recursive-edit))) + (recursive-edit) ;; Return nil to ask about BUF again. nil) ,(purecopy "view this buffer")) @@ -6191,11 +6188,8 @@ Before and after saving the buffer, this function runs (require 'diff) ;for diff-no-select. (let ((diffbuf (diff-no-select (buffer-file-name buf) buf nil 'noasync))) - (if (not enable-recursive-minibuffers) - (progn (display-buffer diffbuf) - (setq other-window-scroll-buffer diffbuf)) - (view-buffer diffbuf (lambda (_) (exit-recursive-edit))) - (recursive-edit)))) + (view-buffer diffbuf (lambda (_) (exit-recursive-edit))) + (recursive-edit))) ;; Return nil to ask about BUF again. nil) ,(purecopy "view changes in this buffer"))) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 9469d73b7d5..b31d2c34ffd 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -276,7 +276,6 @@ interactive command." "Describe command" "Describe function") fn)) - (enable-recursive-minibuffers t) (val (completing-read prompt #'help--symbol-completion-table @@ -1324,7 +1323,6 @@ If VARIABLE has a buffer-local value in BUFFER or FRAME it is displayed along with the global value." (interactive (let ((v (variable-at-point)) - (enable-recursive-minibuffers t) (orig-buffer (current-buffer)) val) (setq val (completing-read @@ -1933,7 +1931,6 @@ current buffer and the selected frame, respectively." describe-symbol-backends))) (v-or-f (if found v-or-f (function-called-at-point))) (found (or found v-or-f)) - (enable-recursive-minibuffers t) (val (completing-read (format-prompt "Describe symbol" (and found v-or-f)) #'help--symbol-completion-table diff --git a/lisp/help.el b/lisp/help.el index 94926555c0f..2985122b6ce 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -947,7 +947,6 @@ Argument is a command definition, usually a symbol with a function definition. If INSERT (the prefix arg) is non-nil, insert the message in the buffer." (interactive (let ((fn (function-called-at-point)) - (enable-recursive-minibuffers t) val) (setq val (completing-read (format-prompt "Where is command" fn) obarray #'commandp t nil nil diff --git a/lisp/icomplete.el b/lisp/icomplete.el index ddb9841a2a9..ff55bb3d207 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -344,7 +344,6 @@ require user confirmation." (error "Sorry, don't know how to kill things for `%s'" cat))))) (let (;; Allow `yes-or-no-p' to work and don't let it ;; `icomplete-exhibit' anything. - (enable-recursive-minibuffers t) (icomplete-mode nil)) (funcall action)) (message nil))))) diff --git a/lisp/ido.el b/lisp/ido.el index 8155bbc0b20..100d7aa8004 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -2920,11 +2920,10 @@ The optional FALLBACK-COMMAND argument indicates which command to run." "Prompt for FILE to search for using `find', starting from current directory." (interactive) (unless file - (let ((enable-recursive-minibuffers t)) - (setq file - (condition-case nil - (read-string (concat "Wide find file: " ido-current-directory) ido-text) - (quit ""))))) + (setq file + (condition-case nil + (read-string (concat "Wide find file: " ido-current-directory) ido-text) + (quit "")))) (when (> (length file) 0) (setq ido-use-merged-list t ido-try-merged-list 'wide) (setq ido-exit 'refresh) @@ -2936,11 +2935,10 @@ The optional FALLBACK-COMMAND argument indicates which command to run." "Prompt for DIR to search for using `find', starting from current directory." (interactive) (unless dir - (let ((enable-recursive-minibuffers t)) - (setq dir - (condition-case nil - (read-string (concat "Wide find directory: " ido-current-directory) ido-text) - (quit ""))))) + (setq dir + (condition-case nil + (read-string (concat "Wide find directory: " ido-current-directory) ido-text) + (quit "")))) (when (> (length dir) 0) (setq ido-use-merged-list t ido-try-merged-list 'wide) (setq ido-exit 'refresh) @@ -2996,9 +2994,8 @@ With \\[universal-argument], pop all elements." "Prompt for DIR to create in current directory." (interactive) (unless dir - (let ((enable-recursive-minibuffers t)) - (setq dir - (read-string (concat "Make directory: " ido-current-directory) ido-text)))) + (setq dir + (read-string (concat "Make directory: " ido-current-directory) ido-text))) (when (> (length dir) 0) (setq dir (concat ido-current-directory dir)) (unless (file-exists-p dir) @@ -4023,8 +4020,7 @@ If cursor is not at the end of the user input, delete to end of input." (interactive) (if (not (eobp)) (delete-region (point) (line-end-position)) - (let ((enable-recursive-minibuffers t) - (buf (ido-name (car ido-matches))) + (let ((buf (ido-name (car ido-matches))) (nextbuf (cadr ido-matches))) (cond ((get-buffer buf) @@ -4055,8 +4051,7 @@ If cursor is not at the end of the user input, delete to end of input." (defun ido-bury-buffer-at-head () "Bury the buffer at the head of `ido-matches'." (interactive) - (let ((enable-recursive-minibuffers t) - (buf (ido-name (car ido-matches))) + (let ((buf (ido-name (car ido-matches))) (nextbuf (cadr ido-matches))) (when (get-buffer buf) (bury-buffer buf) @@ -4073,8 +4068,7 @@ If cursor is not at the end of the user input, delete to end of input." (interactive) (if (not (eobp)) (delete-region (point) (line-end-position)) - (let ((enable-recursive-minibuffers t) - (file (ido-name (car ido-matches)))) + (let ((file (ido-name (car ido-matches)))) (if file (setq file (concat ido-current-directory file))) (when (and file diff --git a/lisp/info-look.el b/lisp/info-look.el index 2598e73eab4..cb124297d50 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -336,7 +336,6 @@ If optional argument QUERY is non-nil, query for the help mode." (completions (info-lookup->completions topic mode)) (default (info-lookup-guess-default topic mode)) (completion-ignore-case (info-lookup->ignore-case topic mode)) - (enable-recursive-minibuffers t) (value (completing-read (format-prompt "Describe %s" default topic) completions nil nil nil 'info-lookup-history default))) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index f38045f968d..363e99c20a7 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -1463,10 +1463,6 @@ The return value is a string." (if default (setq prompt (format prompt default))) (let* ((completion-ignore-case t) - ;; As it is quite normal to change input method in the - ;; minibuffer, we must enable it even if - ;; enable-recursive-minibuffers is currently nil. - (enable-recursive-minibuffers t) ;; This binding is necessary because input-method-history is ;; buffer local. (input-method (completing-read prompt input-method-alist @@ -3217,7 +3213,6 @@ returns excludes categories that you specify instead." (when-let ((char (gethash name ucs-names))) (get-char-code-property char 'general-category))) names))) - (enable-recursive-minibuffers t) (exclude-p (< (prefix-numeric-value current-prefix-arg) 0)) (cat-names (or (completing-read-multiple @@ -3309,8 +3304,7 @@ as names, not numbers. Optional arg ALLOW-SINGLE non-nil means to additionally allow single characters to be treated as standing for themselves." - (let* ((enable-recursive-minibuffers t) - (completion-ignore-case t) + (let* ((completion-ignore-case t) (completion-tab-width 4) (sort-fun (when (eq read-char-by-name-sort 'code) #'mule--ucs-names-sort-by-code)) diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index e7f1e55ea9e..d537db2b15e 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -20148,8 +20148,7 @@ Toggle Minibuffer Depth Indication mode. Minibuffer Depth Indication mode is a global minor mode. When enabled, any recursive use of the minibuffer will show the -recursion depth in the minibuffer prompt. This is only useful if -`enable-recursive-minibuffers' is non-nil. +recursion depth in the minibuffer prompt. This is a global minor mode. If called interactively, toggle the `Minibuffer-Depth-Indicate mode' mode. If the prefix argument is diff --git a/lisp/mb-depth.el b/lisp/mb-depth.el index d8cef7999ea..9b7254c9999 100644 --- a/lisp/mb-depth.el +++ b/lisp/mb-depth.el @@ -25,8 +25,7 @@ ;; Defines the minor mode `minibuffer-depth-indicate-mode'. ;; ;; When active, any recursive use of the minibuffer will show -;; the recursion depth in the minibuffer prompt. This is only -;; useful if `enable-recursive-minibuffers' is non-nil. +;; the recursion depth in the minibuffer prompt. ;;; Code: @@ -76,8 +75,7 @@ The prompt should already have been inserted." Minibuffer Depth Indication mode is a global minor mode. When enabled, any recursive use of the minibuffer will show the -recursion depth in the minibuffer prompt. This is only useful if -`enable-recursive-minibuffers' is non-nil." +recursion depth in the minibuffer prompt." :global t :group 'minibuffer (if minibuffer-depth-indicate-mode diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 55ba323b593..c8db1a85c65 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1265,9 +1265,7 @@ styles that the completion category may prescribe.") (or completion-local-styles (let* ((cat (completion-metadata-get metadata 'category)) (over (completion--category-override cat 'styles))) - (if over - (delete-dups (append (cdr over) (copy-sequence completion-styles))) - completion-styles)))) + (if over (cdr over) completion-styles)))) (defcustom completions-exclude-exceptional-candidates t "Whether to exclude exceptional minibuffer completion candidates." @@ -2820,10 +2818,9 @@ current order instead." (local 'minibuffer-completions-sort-function) #'reverse)) (setq-local minibuffer-completions-sort-function - (nth 3 (let ((enable-recursive-minibuffers t)) - (read-multiple-choice - "Sort order" minibuffer-completions-sort-orders - nil nil minibuffer-read-sort-order-with-completion))))) + (nth 3 (read-multiple-choice + "Sort order" minibuffer-completions-sort-orders + nil nil minibuffer-read-sort-order-with-completion)))) (when completion-auto-help (minibuffer-completion-help))) (defun completion-styles-affixation (names) @@ -2867,8 +2864,7 @@ completions list." (list (let ((styles (completion--styles (completion--field-metadata (minibuffer-prompt-end)))) (current (when-let ((buf (get-buffer completions-buffer-name))) - (buffer-local-value 'completions-style buf))) - (enable-recursive-minibuffers t)) + (buffer-local-value 'completions-style buf)))) (pcase current-prefix-arg (`(,_ . ,_) nil) ; \\[universal-argument] (0 (unless current @@ -4476,12 +4472,11 @@ possible completions." (defun minibuffer-set-action (action-fn) "Set minibuffer action function of current minibuffer to ACTION-FN." (interactive - (let ((enable-recursive-minibuffers t)) - (list (completing-read "Action function: " - (completion-table-with-metadata - obarray '((category . function))) - #'fboundp - nil nil 'minibuffer-action-history))) + (list (completing-read "Action function: " + (completion-table-with-metadata + obarray '((category . function))) + #'fboundp + nil nil 'minibuffer-action-history)) minibuffer-mode) (when (stringp action-fn) (setq action-fn (read action-fn))) (setq-local minibuffer-action @@ -5875,8 +5870,7 @@ predicates together." (defun minibuffer-narrow-completions () "Restrict completion candidates for current minibuffer interaction." (interactive "" minibuffer-mode) - (let* ((enable-recursive-minibuffers t) - (filter-desc + (let* ((filter-desc (funcall (or (when-let ((fun (completion-metadata-get (completion--field-metadata @@ -5890,21 +5884,19 @@ predicates together." (defun minibuffer-narrow-completions-by-regexp () "Restrict completion candidates by matching a given regular expression." (interactive "" minibuffer-mode) - (let* ((enable-recursive-minibuffers t) - (filter-desc (minibuffer-completions-regexp-predicate))) + (let* ((filter-desc (minibuffer-completions-regexp-predicate))) (minibuffer--add-completions-predicate (car filter-desc) (cdr filter-desc)))) (defun minibuffer-add-completion-predicate (pred) "Restrict completion candidates to those satisfying PRED." (interactive (list - (let ((enable-recursive-minibuffers t)) - (completing-read "Predicate: " - (completion-table-with-metadata - obarray '((category . function))) - #'fboundp - nil nil 'minibuffer-completions-predicate-history - "minibuffer-collect"))) + (completing-read "Predicate: " + (completion-table-with-metadata + obarray '((category . function))) + #'fboundp + nil nil 'minibuffer-completions-predicate-history + "minibuffer-collect")) minibuffer-mode) (when (stringp pred) (setq pred (read pred))) (minibuffer--add-completions-predicate pred (prin1-to-string pred))) @@ -6321,6 +6313,9 @@ interactions is customizable via `minibuffer-regexp-prompts'." (defvar read-minibuffer-restore-windows nil "Unused obsolete variable.") (make-obsolete-variable 'read-minibuffer-restore-windows nil "30.1") +(defvar enable-recursive-minibuffers nil "Unused obsolete variable.") +(make-obsolete-variable 'enable-recursive-minibuffers nil "31.1") + (defcustom minibuffer-auto-completion-idle-time 0.4 "Number for seconds to wait before auto-completion in the minibuffer." :type 'float @@ -6460,8 +6455,7 @@ interactions is customizable via `minibuffer-regexp-prompts'." (defun minibuffer-alternate-history (hist-var) "Set history variable of current minibuffer to HIST-VAR." - (interactive (let ((enable-recursive-minibuffers t)) - (list (read-history-variable "Use history variable: "))) + (interactive (list (read-history-variable "Use history variable: ")) minibuffer-mode) ;; TODO: Make `minibuffer-history-variable' (mini)buffer-local. (setq minibuffer-history-variable (if (stringp hist-var) @@ -6474,28 +6468,27 @@ interactions is customizable via `minibuffer-regexp-prompts'." (if (eq minibuffer-history-variable t) (user-error "No history available") (list - (let ((enable-recursive-minibuffers t)) - (minibuffer-with-setup-hook - (lambda () - (setq-local history-add-new-input nil - ;; All candidates are previous inputs by - ;; definition, so no need to highlight them. - completions-highlight-previous-inputs nil)) - (completing-read - "Delete from history: " - (completion-table-dynamic - (lambda (&rest _) - (mapcar - (lambda (cand) - (if (and (stringp cand) (not (string-empty-p cand))) - (propertize cand 'completion-identity cand) - cand)) - (symbol-value minibuffer-history-variable)))) - nil t nil - ;; HACK: Use the history variable of the original minibuffer - ;; also in the recursive minibuffer s.t. `minibuffer-apply' in - ;; the recursive minibuffer deletes from the original history. - minibuffer-history-variable))))) + (minibuffer-with-setup-hook + (lambda () + (setq-local history-add-new-input nil + ;; All candidates are previous inputs by + ;; definition, so no need to highlight them. + completions-highlight-previous-inputs nil)) + (completing-read + "Delete from history: " + (completion-table-dynamic + (lambda (&rest _) + (mapcar + (lambda (cand) + (if (and (stringp cand) (not (string-empty-p cand))) + (propertize cand 'completion-identity cand) + cand)) + (symbol-value minibuffer-history-variable)))) + nil t nil + ;; HACK: Use the history variable of the original minibuffer + ;; also in the recursive minibuffer s.t. `minibuffer-apply' in + ;; the recursive minibuffer deletes from the original history. + minibuffer-history-variable)))) minibuffer-mode) (if (eq minibuffer-history-variable t) (error "No history available") (let* ((hist (cons nil (symbol-value minibuffer-history-variable))) @@ -6662,8 +6655,7 @@ that is the value of `minibuffer-export-minibuffer'. Interactively, TOP-LEVEL-P is non-nil." (interactive (list (when current-prefix-arg - (let ((enable-recursive-minibuffers t) - (minibuffer-export-minibuffer (current-buffer))) + (let ((minibuffer-export-minibuffer (current-buffer))) (completing-read (format-prompt "Export function" "minibuffer-collect") (completion-table-with-metadata diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 4ea57ee6572..da8ccdbcdfa 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1135,9 +1135,8 @@ only return the directory part of FILE." ange-ftp-default-user) (ange-ftp-default-user ;; Ask the user. - (let ((enable-recursive-minibuffers t)) - (read-string (format "User for %s: " host) - (user-login-name)))) + (read-string (format "User for %s: " host) + (user-login-name))) (ange-ftp-netrc-default-user) ;; Default to the user's login name. (t @@ -1219,8 +1218,7 @@ only return the directory part of FILE." ;; see if same user has logged in to other hosts; if so then prompt ;; with the password that was used there. (t - (let* ((enable-recursive-minibuffers t) - (other (ange-ftp-get-host-with-passwd user)) + (let* ((other (ange-ftp-get-host-with-passwd user)) (passwd (if other ;; found another machine with the same user. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index b1820b3e2fe..83803fd8613 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1826,8 +1826,7 @@ a downcased host name only." (defun tramp-gvfs-handler-askquestion (message choices) "Implementation for the \"org.gtk.vfs.MountOperation.askQuestion\" method." (save-window-excursion - (let ((enable-recursive-minibuffers t) - (use-dialog-box (and use-dialog-box (null noninteractive))) + (let ((use-dialog-box (and use-dialog-box (null noninteractive))) result) (with-parsed-tramp-file-name diff --git a/lisp/net/tramp-message.el b/lisp/net/tramp-message.el index 36079c8844c..a0740e03723 100644 --- a/lisp/net/tramp-message.el +++ b/lisp/net/tramp-message.el @@ -414,8 +414,7 @@ an input event arrives. The other arguments are passed to `tramp-error'." (not non-essential) ;; Show only when Emacs has started already. (current-message)) - (let ((enable-recursive-minibuffers t) - inhibit-message) + (let (inhibit-message) ;; `tramp-error' does not show messages. So we must do it ;; ourselves. (apply #'message fmt-string arguments) @@ -439,8 +438,7 @@ an input event arrives. The other arguments are passed to `tramp-error'." (not non-essential) ;; Show only when Emacs has started already. (current-message)) - (let ((enable-recursive-minibuffers t) - inhibit-message) + (let (inhibit-message) ;; `tramp-error' does not show messages. So we must do it ourselves. (apply #'message fmt-string arguments) (discard-input) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 6e345ce52fd..69a8361e6e5 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -5841,8 +5841,7 @@ performed successfully. Any other value means an error." (save-restriction (with-tramp-progress-reporter proc 3 "Waiting for prompts from remote shell" - (let ((enable-recursive-minibuffers t) - exit) + (let (exit) (with-tramp-timeout (timeout (setq exit 'timeout)) (while (not exit) (setq exit (catch 'tramp-action diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index a6ff0e54512..d204744fafe 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -453,8 +453,7 @@ error when the user input is empty." (defun org-completing-read (&rest args) "Completing-read with SPACE being a normal character." - (let ((enable-recursive-minibuffers t) - (minibuffer-local-completion-map + (let ((minibuffer-local-completion-map (copy-keymap minibuffer-local-completion-map))) (define-key minibuffer-local-completion-map " " #'self-insert-command) (define-key minibuffer-local-completion-map "?" #'self-insert-command) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 217125e1599..cd5669ad0ce 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -7952,8 +7952,7 @@ than a line. Your contribution to update/shorten it is appreciated." (defun cperl-describe-perl-symbol (val) "Display the documentation of symbol at point, a Perl operator." - (let ((enable-recursive-minibuffers t) - regexp) + (let (regexp) (cond ((string-match "^[&*][a-zA-Z_]" val) (setq val (concat (substring val 0 1) "NAME"))) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 575418703ce..573e5ef85a9 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -810,9 +810,7 @@ tags table for BUF and its (recursively) included tags tables." (lambda (string pred action) (with-current-buffer buf (save-excursion - ;; If we need to ask for the tag table, allow that. - (let ((enable-recursive-minibuffers t)) - (visit-tags-table-buffer)) + (visit-tags-table-buffer) (complete-with-action action (tags-completion-table buf) string pred)))))) @@ -1881,9 +1879,7 @@ This function serves as COLLECTION argument to `completing-read', see the Info node `(elisp) Programmed Completion' for more detailed description of the arguments." (save-excursion - ;; If we need to ask for the tag table, allow that. - (let ((enable-recursive-minibuffers t)) - (visit-tags-table-buffer)) + (visit-tags-table-buffer) (if (eq what t) (all-completions string (tags-table-files) predicate) (try-completion string (tags-table-files) predicate)))) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index a00289d6de9..31152ce11b0 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5702,8 +5702,7 @@ fetching." "Get help on SYMBOL using `help'. Interactively, prompt for symbol." (interactive - (let ((symbol (python-eldoc--get-symbol-at-point)) - (enable-recursive-minibuffers t)) + (let ((symbol (python-eldoc--get-symbol-at-point))) (list (read-string ;; `format-prompt' is new in Emacs 28.1. (if (fboundp 'format-prompt) diff --git a/lisp/simple.el b/lisp/simple.el index 6d776e6e4dd..cf2064b963f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2798,7 +2798,6 @@ makes the search case-sensitive. See also `minibuffer-history-case-insensitive-variables'." (interactive (let* ((n (prefix-numeric-value current-prefix-arg)) - (enable-recursive-minibuffers t) (regexp (read-from-minibuffer (format-prompt "%s element matching regexp" (and minibuffer-history-search-history @@ -2872,7 +2871,6 @@ Normally, history elements are matched case-insensitively if makes the search case-sensitive." (interactive (let* ((n (prefix-numeric-value current-prefix-arg)) - (enable-recursive-minibuffers t) (regexp (read-from-minibuffer (format-prompt "%s element matching regexp" (and minibuffer-history-search-history diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index f5a20e0ca0e..af2accb8734 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -2090,7 +2090,6 @@ on what is seen near point." (interactive (list (let* ((sym (css--mdn-find-symbol)) - (enable-recursive-minibuffers t) (value (completing-read (format-prompt "Describe CSS symbol" sym) css--mdn-completion-list nil nil nil 'css--mdn-lookup-history sym))) diff --git a/lisp/transient.el b/lisp/transient.el index 312ed540f73..b6bedda7764 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -3274,8 +3274,7 @@ it\", in which case it is pointless to preserve history.)" (not always-read) transient--prefix) (oset obj value nil) - (let* ((enable-recursive-minibuffers t) - (reader (oref obj reader)) + (let* ((reader (oref obj reader)) (choices (if (functionp choices) (funcall choices) choices)) (prompt (transient-prompt obj)) (value (if multi-value (string-join value ",") value)) diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index 8f4df780a54..8c8a33f09ac 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el @@ -70,7 +70,6 @@ instead of the filename inheritance method." (file (url-filename href)) (user (url-user href)) (pass (url-password href)) - (enable-recursive-minibuffers t) ; for url-handler-mode (bug#10298) byserv retval data) (setq server (format "%s:%d" server port) file (cond @@ -441,7 +440,6 @@ Alist ATTRS contains additional attributes for the authentication challenge such as nonce and opaque." (if attrs (let* ((href (if (stringp url) (url-generic-parse-url url) url)) - (enable-recursive-minibuffers t) (key (url-digest-cached-key href realm))) (if (or (null key) overwrite) diff --git a/src/callint.c b/src/callint.c index 99e46130977..c3f95ed2143 100644 --- a/src/callint.c +++ b/src/callint.c @@ -291,10 +291,6 @@ invoke it (via an `interactive' spec that contains, for instance, an /* Save this now, since use of minibuffer will clobber it. */ Lisp_Object prefix_arg = Vcurrent_prefix_arg; - Lisp_Object enable = (SYMBOLP (function) - ? Fget (function, Qenable_recursive_minibuffers) - : Qnil); - /* If k or K discard an up-event, save it here so it can be retrieved with U. */ Lisp_Object up_event = Qnil; @@ -439,9 +435,6 @@ invoke it (via an `interactive' spec that contains, for instance, an memclear (args, nargs * (2 * word_size + 1)); - if (!NILP (enable)) - specbind (Qenable_recursive_minibuffers, Qt); - char const *tem = string; for (ptrdiff_t i = 2; tem < string_end; i++) { @@ -836,7 +829,6 @@ syms_of_callint (void) DEFSYM (Qread_number, "read-number"); DEFSYM (Qfuncall_interactively, "funcall-interactively"); DEFSYM (Qcommand_debug_status, "command-debug-status"); - DEFSYM (Qenable_recursive_minibuffers, "enable-recursive-minibuffers"); DEFSYM (Qmouse_leave_buffer_hook, "mouse-leave-buffer-hook"); DEFVAR_KBOARD ("prefix-arg", Vprefix_arg, diff --git a/src/fns.c b/src/fns.c index 22947b2649f..0f4d8e90789 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3582,7 +3582,6 @@ by a mouse, or by some window-system gesture, or via a menu. */) prompt = CALLN (Fconcat, prompt, Vyes_or_no_prompt); specpdl_ref count = SPECPDL_INDEX (); - specbind (Qenable_recursive_minibuffers, Qt); /* Preserve the actual command that eventually called `yes-or-no-p' (otherwise `repeat' will be repeating `exit-minibuffer'). */ specbind (Qreal_this_command, Vreal_this_command); diff --git a/src/minibuf.c b/src/minibuf.c index 7fac3ce05fa..d4a05e55bba 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -613,18 +613,6 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, if (!STRINGP (prompt)) prompt = empty_unibyte_string; - if (!enable_recursive_minibuffers - && minibuf_level > 0) - { - Lisp_Object str - = build_string ("Command attempted to use minibuffer while in minibuffer"); - if (EQ (selected_window, minibuf_window)) - Fsignal (Quser_error, (list1 (str))); - else - /* If we're in another window, cancel the minibuffer that's active. */ - Fthrow (Qexit, str); - } - if ((noninteractive /* In case we are running as a daemon, only do this before detaching from the terminal. */ @@ -2219,13 +2207,6 @@ For buffer name completion, `read-buffer-completion-ignore-case' controls the behavior, rather than this variable. */); completion_ignore_case = 0; - DEFVAR_BOOL ("enable-recursive-minibuffers", enable_recursive_minibuffers, - doc: /* Non-nil means to allow minibuffer commands while in the minibuffer. -This variable makes a difference whenever the minibuffer window is active. -Also see `minibuffer-depth-indicate-mode', which may be handy if this -variable is non-nil. */); - enable_recursive_minibuffers = 0; - DEFVAR_LISP ("minibuffer-completion-table", Vminibuffer_completion_table, doc: /* Alist or obarray used for completion in the minibuffer. This becomes the ALIST argument to `try-completion' and `all-completions'. diff --git a/test/lisp/international/mule-tests.el b/test/lisp/international/mule-tests.el index 9c869cc8e6f..a81e1baff11 100644 --- a/test/lisp/international/mule-tests.el +++ b/test/lisp/international/mule-tests.el @@ -46,10 +46,9 @@ (ert-deftest mule-cmds--test-universal-coding-system-argument () (should (equal "ccccccccccccccccab" - (let ((enable-recursive-minibuffers t)) - (ert-simulate-keys - (kbd "C-x RET c u t f - 8 RET C-u C-u c a b RET") - (read-string "prompt:")))))) + (ert-simulate-keys + (kbd "C-x RET c u t f - 8 RET C-u C-u c a b RET") + (read-string "prompt:"))))) ;;Bug#65997, ensure that old-names haven't overridden new names. (ert-deftest mule-cmds-tests--ucs-names-old-name-override ()