]> git.eshelyaron.com Git - emacs.git/commitdiff
Deprecate 'read-no-blanks-input'
authorEshel Yaron <me@eshelyaron.com>
Thu, 15 Feb 2024 17:37:18 +0000 (18:37 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 15 Feb 2024 17:54:38 +0000 (18:54 +0100)
This function is unused in the Emacs tree, and it probably
shouldn't be used anywhere else, either.

* lisp/minibuffer.el (read-no-blanks-input): Turn it into an
obsolete alias of 'read-string'.
(self-insert-and-exit, minibuffer-local-ns-map): Deprecate.

* doc/emacs/custom.texi (Minibuffer Maps):
* doc/lispref/minibuf.texi (Text from Minibuffer)
(Minibuffer Commands): Update.

* lisp/calc/calc-store.el (calcVar-digit, calcVar-oper):
Avoid 'self-insert-and-exit'.

* test/src/minibuf-tests.el (test-inhibit-interaction):
Adjust.

doc/emacs/custom.texi
doc/lispref/minibuf.texi
lisp/calc/calc-store.el
lisp/minibuffer.el
test/src/minibuf-tests.el

index e047782e1500442fd70c0d9951fe46347b87b364..2bf53df2ed20ce0b3a40284ed1df7eefb5b17185 100644 (file)
@@ -1791,7 +1791,6 @@ circumstances.
 
 @cindex minibuffer keymaps
 @vindex minibuffer-local-map
-@vindex minibuffer-local-ns-map
 @vindex minibuffer-local-completion-map
 @vindex minibuffer-local-must-match-map
   The minibuffer has its own set of local keymaps; they contain various
@@ -1801,9 +1800,6 @@ completion and exit commands.
 @item
 @code{minibuffer-local-map} is used for ordinary input (no completion).
 @item
-@code{minibuffer-local-ns-map} is similar, except that @key{SPC} exits
-just like @key{RET}.
-@item
 @code{minibuffer-local-completion-map} is for permissive completion.
 @item
 @code{minibuffer-local-must-match-map} is for strict completion and
index e79ce280936b8f362107bf2afb4cb7fee1d82ac3..2d8d2650cbcebb0c306f8cc49c8196bc946ad601 100644 (file)
@@ -350,18 +350,11 @@ See @code{read-regexp} above for details of how these values are used.
 @end defopt
 
 @defvar minibuffer-allow-text-properties
-If this variable is @code{nil}, then @code{read-from-minibuffer}
-and @code{read-string} strip all text properties from the minibuffer
-input before returning it.  However,
-@code{read-no-blanks-input} (see below), as well as
-@code{read-minibuffer} and related functions (@pxref{Object from
-Minibuffer,, Reading Lisp Objects With the Minibuffer}), and all
-functions that do minibuffer input with completion, remove the @code{face}
-property unconditionally, regardless of the value of this variable.
-
-If this variable is non-@code{nil}, most text properties on strings
-from the completion table are preserved---but only on the part of the
-strings that were completed.
+If this variable is @code{nil}, then @code{read-from-minibuffer} strip
+all text properties from the minibuffer input before returning it.
+Otherwise, the minibuffer input is returned as is, along with its text
+properties.  Moreover, if this variable is non-@code{nil}, most text
+properties on strings from the completion table are preserved as well.
 
 @lisp
 (let ((minibuffer-allow-text-properties t))
@@ -420,53 +413,6 @@ default, it makes the following bindings:
 The variable @code{minibuffer-mode-map} is an alias for this variable.
 @end defvar
 
-@defun read-no-blanks-input prompt &optional initial inherit-input-method
-This function reads a string from the minibuffer, but does not allow
-whitespace characters as part of the input: instead, those characters
-terminate the input.  The arguments @var{prompt}, @var{initial}, and
-@var{inherit-input-method} are used as in @code{read-from-minibuffer}.
-
-This is a simplified interface to the @code{read-from-minibuffer}
-function, and passes the value of the @code{minibuffer-local-ns-map}
-keymap as the @var{keymap} argument for that function.  Since the keymap
-@code{minibuffer-local-ns-map} does not rebind @kbd{C-q}, it @emph{is}
-possible to put a space into the string, by quoting it.
-
-This function discards text properties, regardless of the value of
-@code{minibuffer-allow-text-properties}.
-
-@smallexample
-@group
-(read-no-blanks-input @var{prompt} @var{initial})
-@equiv{}
-(let (minibuffer-allow-text-properties)
-  (read-from-minibuffer @var{prompt} @var{initial} minibuffer-local-ns-map))
-@end group
-@end smallexample
-@end defun
-
-@c Slightly unfortunate name, suggesting it might be related to the
-@c Nextstep port...
-@defvar minibuffer-local-ns-map
-This built-in variable is the keymap used as the minibuffer local keymap
-in the function @code{read-no-blanks-input}.  By default, it makes the
-following bindings, in addition to those of @code{minibuffer-local-map}:
-
-@table @asis
-@item @key{SPC}
-@cindex @key{SPC} in minibuffer
-@code{exit-minibuffer}
-
-@item @key{TAB}
-@cindex @key{TAB} in minibuffer
-@code{exit-minibuffer}
-
-@item @kbd{?}
-@cindex @kbd{?} in minibuffer
-@code{self-insert-and-exit}
-@end table
-@end defvar
-
 @vindex minibuffer-default-prompt-format
 @defun format-prompt prompt default &rest format-args
 Format @var{prompt} with default value @var{default} according to the
@@ -2716,12 +2662,6 @@ keys in minibuffer local keymaps.  The command throws an error if the
 current buffer is a minibuffer, but not the active minibuffer.
 @end deffn
 
-@deffn Command self-insert-and-exit
-This command exits the active minibuffer after inserting the last
-character typed on the keyboard (found in @code{last-command-event};
-@pxref{Command Loop Info}).
-@end deffn
-
 @deffn Command previous-history-element n
 This command replaces the minibuffer contents with the value of the
 @var{n}th previous (older) history element.
index df58476060602b683a2ee9787de1a556c09f8982..dec331a0c9900324c610b47fb37ee1cb6d953139 100644 (file)
       (if (eq calc-store-opers 0)
          (beep)
        (insert "q")
-       (self-insert-and-exit))
-    (self-insert-command 1)))
+        (call-interactively 'self-insert-command)
+        (exit-minibuffer))
+    (call-interactively 'self-insert-command)))
 
 (defun calcVar-oper ()
   (interactive)
           (calc-minibuffer-contains "\\'"))
       (progn
        (erase-buffer)
-       (self-insert-and-exit))
-    (self-insert-command 1)))
+        (call-interactively 'self-insert-command)
+        (exit-minibuffer))
+    (call-interactively 'self-insert-command)))
 
 (defun calc-store-map (&optional oper var)
   (interactive)
index ca981a1e7d228943e734a11dc54e09185bdd6691..911412e2b8cf970da671e5f77fc93da8110b3de0 100644 (file)
@@ -3085,6 +3085,7 @@ If nil, it defaults to 1."
 
 (defun self-insert-and-exit ()
   "Terminate minibuffer input."
+  (declare (obsolete nil "30.1"))
   (interactive)
   (if (characterp last-command-event)
       (call-interactively 'self-insert-command)
@@ -3396,13 +3397,6 @@ The completion method is determined by `completion-at-point-functions'."
 (make-obsolete-variable 'minibuffer-local-filename-completion-map
                         nil "30.1")
 
-(defvar-keymap minibuffer-local-ns-map
-  :doc "Local keymap for the minibuffer when spaces are not allowed."
-  :parent minibuffer-local-map
-  "SPC" #'exit-minibuffer
-  "TAB" #'exit-minibuffer
-  "?"   #'self-insert-and-exit)
-
 (defvar-keymap minibuffer-narrow-completions-map
   :doc "Keymap for completions narrowing commands."
   "n" #'minibuffer-narrow-completions-to-current
@@ -3413,22 +3407,12 @@ The completion method is determined by `completion-at-point-functions'."
 (defalias 'minibuffer-narrow-completions-map
   minibuffer-narrow-completions-map)
 
-(defun read-no-blanks-input (prompt &optional initial inherit-input-method)
-  "Read a string from the terminal, not allowing blanks.
-Prompt with PROMPT.  Whitespace terminates the input.  If INITIAL is
-non-nil, it should be a string, which is used as initial input, with
-point positioned at the end, so that SPACE will accept the input.
-\(Actually, INITIAL can also be a cons of a string and an integer.
-Such values are treated as in `read-from-minibuffer', but are normally
-not useful in this function.)
-
-Third arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits
-the current input method and the setting of `enable-multibyte-characters'.
-
-If `inhibit-interaction' is non-nil, this function will signal an
-`inhibited-interaction' error."
-  (read-from-minibuffer prompt initial minibuffer-local-ns-map
-                       nil 'minibuffer-history nil inherit-input-method))
+(defvar-keymap minibuffer-local-ns-map
+  :doc "This variable is obsolete and no longer used.")
+
+(make-obsolete-variable 'minibuffer-local-ns-map nil "30.1")
+
+(define-obsolete-function-alias 'read-no-blanks-input 'read-string "30.1")
 
 ;;; Major modes for the minibuffer
 
index cb305ca0e55196adbd2c39a4044bac1af36e1aa6..96a7c052fb7d6d4121b364cd3f239fd6a1842b88 100644 (file)
 
     (should-error (y-or-n-p "Foo?") :type 'inhibited-interaction)
     (should-error (yes-or-no-p "Foo?") :type 'inhibited-interaction)
-    (should-error (read-no-blanks-input "foo: ") :type 'inhibited-interaction)
 
     ;; See that we get the expected error.
     (should (eq (condition-case nil