# HG changeset patch # User Richard M. Stallman # Date 946612958 0 # Node ID 5c0c5089979c4b1017c32b62a8206cae41e459a6 # Parent 53146c13106f63befdde30f4b1dd58833db0a8c5 (choose-completion-string): In minibuffer, do not delete the prompt string. diff -r 53146c13106f -r 5c0c5089979c lisp/simple.el --- a/lisp/simple.el Thu Dec 30 17:49:14 1999 +0000 +++ b/lisp/simple.el Fri Dec 31 04:02:38 1999 +0000 @@ -3820,10 +3820,11 @@ ;; unless it is reading a file name and CHOICE is a directory, ;; or completion-no-auto-exit is non-nil. (defun choose-completion-string (choice &optional buffer base-size) - (let ((buffer (or buffer completion-reference-buffer))) + (let ((buffer (or buffer completion-reference-buffer)) + (mini-p (string-match "\\` \\*Minibuf-[0-9]+\\*\\'" (buffer-name buffer)))) ;; If BUFFER is a minibuffer, barf unless it's the currently ;; active minibuffer. - (if (and (string-match "\\` \\*Minibuf-[0-9]+\\*\\'" (buffer-name buffer)) + (if (and mini-p (or (not (active-minibuffer-window)) (not (equal buffer (window-buffer (active-minibuffer-window)))))) @@ -3831,7 +3832,10 @@ ;; Insert the completion into the buffer where completion was requested. (set-buffer buffer) (if base-size - (delete-region (+ base-size (point-min)) (point)) + (delete-region (+ base-size (if mini-p + (minibuffer-prompt-end) + (point-min))) + (point)) (choose-completion-delete-max-match choice)) (insert choice) (remove-text-properties (- (point) (length choice)) (point)