X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/16adf2e6eb1ddf0b32ebea2d5ce8fa1e4c226614..2c4e2e6fd3096eb615504e3cfc89c588ec620f78:/lisp/comint.el diff --git a/lisp/comint.el b/lisp/comint.el index ec11d5b162..da3782717c 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1769,6 +1769,12 @@ If the Comint is Lucid Common Lisp, Similarly for Soar, Scheme, etc." (interactive) + ;; If we're currently completing, stop. We're definitely done + ;; completing, and by sending the input, we might cause side effects + ;; that will confuse the code running in the completion + ;; post-command-hook. + (when completion-in-region-mode + (completion-in-region-mode -1)) ;; Note that the input string does not include its terminal newline. (let ((proc (get-buffer-process (current-buffer)))) (if (not proc) (user-error "Current buffer has no process") @@ -3326,8 +3332,9 @@ the completions." (and (consp first) (consp (event-start first)) (eq (window-buffer (posn-window (event-start first))) (get-buffer "*Completions*")) - (eq (key-binding key) 'mouse-choose-completion))) - ;; If the user does mouse-choose-completion with the mouse, + (memq (key-binding key) + '(mouse-choose-completion choose-completion)))) + ;; If the user does choose-completion with the mouse, ;; execute the command, then delete the completion window. (progn (choose-completion first)