diff options
| author | Stefan Monnier | 2021-04-20 10:36:48 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2021-04-20 10:36:48 -0400 |
| commit | 3e93c2e5ae48e8595e80b1fb69955c2e051ca004 (patch) | |
| tree | 609ae7a779df8d27d8d27e5defaf3fc7e758faf3 | |
| parent | 298f25ee1da1f3ac3057444137273b6380b1c8f8 (diff) | |
| download | emacs-3e93c2e5ae48e8595e80b1fb69955c2e051ca004.tar.gz emacs-3e93c2e5ae48e8595e80b1fb69955c2e051ca004.zip | |
* src/minibuf.c (Fread_no_blanks_input): Move to `minibuffer.el`
* src/keymap.c (syms_of_keymap):
* lisp/minibuffer.el (minibuffer-local-ns-map): Move declaration
to initialization.
(read-no-blanks-input): Move from `minibuf.c`.
| -rw-r--r-- | lisp/minibuffer.el | 31 | ||||
| -rw-r--r-- | src/keymap.c | 6 | ||||
| -rw-r--r-- | src/minibuf.c | 25 |
3 files changed, 27 insertions, 35 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 55af95a9604..7da3c39e6b9 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -2469,10 +2469,33 @@ with `minibuffer-local-must-match-map'.") | |||
| 2469 | (defvar minibuffer-local-filename-must-match-map (make-sparse-keymap)) | 2469 | (defvar minibuffer-local-filename-must-match-map (make-sparse-keymap)) |
| 2470 | (make-obsolete-variable 'minibuffer-local-filename-must-match-map nil "24.1") | 2470 | (make-obsolete-variable 'minibuffer-local-filename-must-match-map nil "24.1") |
| 2471 | 2471 | ||
| 2472 | (let ((map minibuffer-local-ns-map)) | 2472 | (defvar minibuffer-local-ns-map |
| 2473 | (define-key map " " 'exit-minibuffer) | 2473 | (let ((map (make-sparse-keymap))) |
| 2474 | (define-key map "\t" 'exit-minibuffer) | 2474 | (set-keymap-parent map minibuffer-local-map) |
| 2475 | (define-key map "?" 'self-insert-and-exit)) | 2475 | (define-key map " " #'exit-minibuffer) |
| 2476 | (define-key map "\t" #'exit-minibuffer) | ||
| 2477 | (define-key map "?" #'self-insert-and-exit) | ||
| 2478 | map) | ||
| 2479 | "Local keymap for the minibuffer when spaces are not allowed.") | ||
| 2480 | |||
| 2481 | (defun read-no-blanks-input (prompt &optional initial inherit-input-method) | ||
| 2482 | "Read a string from the terminal, not allowing blanks. | ||
| 2483 | Prompt with PROMPT. Whitespace terminates the input. If INITIAL is | ||
| 2484 | non-nil, it should be a string, which is used as initial input, with | ||
| 2485 | point positioned at the end, so that SPACE will accept the input. | ||
| 2486 | \(Actually, INITIAL can also be a cons of a string and an integer. | ||
| 2487 | Such values are treated as in `read-from-minibuffer', but are normally | ||
| 2488 | not useful in this function.) | ||
| 2489 | |||
| 2490 | Third arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits | ||
| 2491 | the current input method and the setting of`enable-multibyte-characters'. | ||
| 2492 | |||
| 2493 | If `inhibit-interaction' is non-nil, this function will signal an | ||
| 2494 | `inhibited-interaction' error." | ||
| 2495 | (read-from-minibuffer prompt initial minibuffer-local-ns-map | ||
| 2496 | nil minibuffer-history nil inherit-input-method)) | ||
| 2497 | |||
| 2498 | ;;; Major modes for the minibuffer | ||
| 2476 | 2499 | ||
| 2477 | (defvar minibuffer-inactive-mode-map | 2500 | (defvar minibuffer-inactive-mode-map |
| 2478 | (let ((map (make-keymap))) | 2501 | (let ((map (make-keymap))) |
diff --git a/src/keymap.c b/src/keymap.c index bb26b6389d4..fb8eceaec18 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -3148,12 +3148,6 @@ syms_of_keymap (void) | |||
| 3148 | doc: /* Default keymap to use when reading from the minibuffer. */); | 3148 | doc: /* Default keymap to use when reading from the minibuffer. */); |
| 3149 | Vminibuffer_local_map = Fmake_sparse_keymap (Qnil); | 3149 | Vminibuffer_local_map = Fmake_sparse_keymap (Qnil); |
| 3150 | 3150 | ||
| 3151 | DEFVAR_LISP ("minibuffer-local-ns-map", Vminibuffer_local_ns_map, | ||
| 3152 | doc: /* Local keymap for the minibuffer when spaces are not allowed. */); | ||
| 3153 | Vminibuffer_local_ns_map = Fmake_sparse_keymap (Qnil); | ||
| 3154 | Fset_keymap_parent (Vminibuffer_local_ns_map, Vminibuffer_local_map); | ||
| 3155 | |||
| 3156 | |||
| 3157 | DEFVAR_LISP ("minor-mode-map-alist", Vminor_mode_map_alist, | 3151 | DEFVAR_LISP ("minor-mode-map-alist", Vminor_mode_map_alist, |
| 3158 | doc: /* Alist of keymaps to use for minor modes. | 3152 | doc: /* Alist of keymaps to use for minor modes. |
| 3159 | Each element looks like (VARIABLE . KEYMAP); KEYMAP is used to read | 3153 | Each element looks like (VARIABLE . KEYMAP); KEYMAP is used to read |
diff --git a/src/minibuf.c b/src/minibuf.c index 89d9357b4ed..1a637c86ade 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -1360,30 +1360,6 @@ Fifth arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits | |||
| 1360 | return unbind_to (count, val); | 1360 | return unbind_to (count, val); |
| 1361 | } | 1361 | } |
| 1362 | 1362 | ||
| 1363 | DEFUN ("read-no-blanks-input", Fread_no_blanks_input, Sread_no_blanks_input, 1, 3, 0, | ||
| 1364 | doc: /* Read a string from the terminal, not allowing blanks. | ||
| 1365 | Prompt with PROMPT. Whitespace terminates the input. If INITIAL is | ||
| 1366 | non-nil, it should be a string, which is used as initial input, with | ||
| 1367 | point positioned at the end, so that SPACE will accept the input. | ||
| 1368 | \(Actually, INITIAL can also be a cons of a string and an integer. | ||
| 1369 | Such values are treated as in `read-from-minibuffer', but are normally | ||
| 1370 | not useful in this function.) | ||
| 1371 | |||
| 1372 | Third arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits | ||
| 1373 | the current input method and the setting of`enable-multibyte-characters'. | ||
| 1374 | |||
| 1375 | If `inhibit-interaction' is non-nil, this function will signal an | ||
| 1376 | `inhibited-interaction' error. */) | ||
| 1377 | (Lisp_Object prompt, Lisp_Object initial, Lisp_Object inherit_input_method) | ||
| 1378 | { | ||
| 1379 | CHECK_STRING (prompt); | ||
| 1380 | barf_if_interaction_inhibited (); | ||
| 1381 | |||
| 1382 | return read_minibuf (Vminibuffer_local_ns_map, initial, prompt, | ||
| 1383 | 0, Qminibuffer_history, make_fixnum (0), Qnil, 0, | ||
| 1384 | !NILP (inherit_input_method)); | ||
| 1385 | } | ||
| 1386 | |||
| 1387 | DEFUN ("read-command", Fread_command, Sread_command, 1, 2, 0, | 1363 | DEFUN ("read-command", Fread_command, Sread_command, 1, 2, 0, |
| 1388 | doc: /* Read the name of a command and return as a symbol. | 1364 | doc: /* Read the name of a command and return as a symbol. |
| 1389 | Prompt with PROMPT. By default, return DEFAULT-VALUE or its first element | 1365 | Prompt with PROMPT. By default, return DEFAULT-VALUE or its first element |
| @@ -2517,7 +2493,6 @@ instead. */); | |||
| 2517 | defsubr (&Sread_variable); | 2493 | defsubr (&Sread_variable); |
| 2518 | defsubr (&Sinternal_complete_buffer); | 2494 | defsubr (&Sinternal_complete_buffer); |
| 2519 | defsubr (&Sread_buffer); | 2495 | defsubr (&Sread_buffer); |
| 2520 | defsubr (&Sread_no_blanks_input); | ||
| 2521 | defsubr (&Sminibuffer_depth); | 2496 | defsubr (&Sminibuffer_depth); |
| 2522 | defsubr (&Sminibuffer_prompt); | 2497 | defsubr (&Sminibuffer_prompt); |
| 2523 | 2498 | ||