diff options
| -rw-r--r-- | lisp/simple.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 4c93824687b..e414c4607db 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2986,6 +2986,11 @@ it were the arg to `interactive' (which see) to interactively read the value." | |||
| 2986 | This is a local variable in the completion list buffer. | 2986 | This is a local variable in the completion list buffer. |
| 2987 | Initial value is nil to avoid some compiler warnings.") | 2987 | Initial value is nil to avoid some compiler warnings.") |
| 2988 | 2988 | ||
| 2989 | (defvar completion-no-auto-exit nil | ||
| 2990 | "Non-nil means `choose-completion-string' should never exit the minibuffer. | ||
| 2991 | This also applies to other functions such as `choose-completion' | ||
| 2992 | and `mouse-choose-completion'.") | ||
| 2993 | |||
| 2989 | (defvar completion-base-size nil | 2994 | (defvar completion-base-size nil |
| 2990 | "Number of chars at beginning of minibuffer not involved in completion. | 2995 | "Number of chars at beginning of minibuffer not involved in completion. |
| 2991 | This is a local variable in the completion list buffer | 2996 | This is a local variable in the completion list buffer |
| @@ -3084,7 +3089,8 @@ With prefix argument N, move N items (negative N means move backward)." | |||
| 3084 | ;; to keep. If it is nil, use choose-completion-delete-max-match instead. | 3089 | ;; to keep. If it is nil, use choose-completion-delete-max-match instead. |
| 3085 | 3090 | ||
| 3086 | ;; If BUFFER is the minibuffer, exit the minibuffer | 3091 | ;; If BUFFER is the minibuffer, exit the minibuffer |
| 3087 | ;; unless it is reading a file name and CHOICE is a directory. | 3092 | ;; unless it is reading a file name and CHOICE is a directory, |
| 3093 | ;; or completion-no-auto-exit is non-nil. | ||
| 3088 | (defun choose-completion-string (choice &optional buffer base-size) | 3094 | (defun choose-completion-string (choice &optional buffer base-size) |
| 3089 | (let ((buffer (or buffer completion-reference-buffer))) | 3095 | (let ((buffer (or buffer completion-reference-buffer))) |
| 3090 | ;; If BUFFER is a minibuffer, barf unless it's the currently | 3096 | ;; If BUFFER is a minibuffer, barf unless it's the currently |
| @@ -3106,7 +3112,8 @@ With prefix argument N, move N items (negative N means move backward)." | |||
| 3106 | (let ((window (get-buffer-window buffer t))) | 3112 | (let ((window (get-buffer-window buffer t))) |
| 3107 | (set-window-point window (point))) | 3113 | (set-window-point window (point))) |
| 3108 | ;; If completing for the minibuffer, exit it with this choice. | 3114 | ;; If completing for the minibuffer, exit it with this choice. |
| 3109 | (and (equal buffer (window-buffer (minibuffer-window))) | 3115 | (and (not completion-no-auto-exit) |
| 3116 | (equal buffer (window-buffer (minibuffer-window))) | ||
| 3110 | minibuffer-completion-table | 3117 | minibuffer-completion-table |
| 3111 | ;; If this is reading a file name, and the file name chosen | 3118 | ;; If this is reading a file name, and the file name chosen |
| 3112 | ;; is a directory, don't exit the minibuffer. | 3119 | ;; is a directory, don't exit the minibuffer. |