aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1999-12-31 04:02:38 +0000
committerRichard M. Stallman1999-12-31 04:02:38 +0000
commitf436a90ae2a6ab5abb932cc9adde1ef98166a199 (patch)
tree4b00dfa30b729d9e18d73a3b8feee5104b579aa5 /lisp
parentcc8fdbd3c2e912340269367acc1b3d77e08131d3 (diff)
downloademacs-f436a90ae2a6ab5abb932cc9adde1ef98166a199.tar.gz
emacs-f436a90ae2a6ab5abb932cc9adde1ef98166a199.zip
(choose-completion-string): In minibuffer,
do not delete the prompt string.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/simple.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 84d7e6e4afa..ec8b0f73097 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3820,10 +3820,11 @@ With prefix argument N, move N items (negative N means move backward)."
3820;; unless it is reading a file name and CHOICE is a directory, 3820;; unless it is reading a file name and CHOICE is a directory,
3821;; or completion-no-auto-exit is non-nil. 3821;; or completion-no-auto-exit is non-nil.
3822(defun choose-completion-string (choice &optional buffer base-size) 3822(defun choose-completion-string (choice &optional buffer base-size)
3823 (let ((buffer (or buffer completion-reference-buffer))) 3823 (let ((buffer (or buffer completion-reference-buffer))
3824 (mini-p (string-match "\\` \\*Minibuf-[0-9]+\\*\\'" (buffer-name buffer))))
3824 ;; If BUFFER is a minibuffer, barf unless it's the currently 3825 ;; If BUFFER is a minibuffer, barf unless it's the currently
3825 ;; active minibuffer. 3826 ;; active minibuffer.
3826 (if (and (string-match "\\` \\*Minibuf-[0-9]+\\*\\'" (buffer-name buffer)) 3827 (if (and mini-p
3827 (or (not (active-minibuffer-window)) 3828 (or (not (active-minibuffer-window))
3828 (not (equal buffer 3829 (not (equal buffer
3829 (window-buffer (active-minibuffer-window)))))) 3830 (window-buffer (active-minibuffer-window))))))
@@ -3831,7 +3832,10 @@ With prefix argument N, move N items (negative N means move backward)."
3831 ;; Insert the completion into the buffer where completion was requested. 3832 ;; Insert the completion into the buffer where completion was requested.
3832 (set-buffer buffer) 3833 (set-buffer buffer)
3833 (if base-size 3834 (if base-size
3834 (delete-region (+ base-size (point-min)) (point)) 3835 (delete-region (+ base-size (if mini-p
3836 (minibuffer-prompt-end)
3837 (point-min)))
3838 (point))
3835 (choose-completion-delete-max-match choice)) 3839 (choose-completion-delete-max-match choice))
3836 (insert choice) 3840 (insert choice)
3837 (remove-text-properties (- (point) (length choice)) (point) 3841 (remove-text-properties (- (point) (length choice)) (point)