From 1861d5a7121b349c4fb4db0ea06c898fcc85ca76 Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Sun, 30 Mar 2014 12:12:57 -0700 Subject: [PATCH] completion-in-region-mode improvements --- lisp/ChangeLog | 9 +++++++++ lisp/comint.el | 6 ++++++ lisp/simple.el | 2 ++ 3 files changed, 17 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ce4ee87abaf..af658ee09b6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2014-03-30 Daniel Colascione + + * comint.el (comint-send-input): Deactivate + completion-in-region-mode before we send comint input. + (Bug#17139). + + * simple.el (keyboard-quit): Deactivate completion-in-region-mode + on keyboard-quit. + 2014-03-29 Glenn Morris * textmodes/reftex.el: Manage most autoloads automatically. diff --git a/lisp/comint.el b/lisp/comint.el index ec11d5b162b..dfc3fee0884 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") diff --git a/lisp/simple.el b/lisp/simple.el index 6cc9c6bfd6b..eee9c9b9689 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -6580,6 +6580,8 @@ At top-level, as an editor command, this simply beeps." (deactivate-mark)) (if (fboundp 'kmacro-keyboard-quit) (kmacro-keyboard-quit)) + (when completion-in-region-mode + (completion-in-region-mode -1)) (setq defining-kbd-macro nil) (let ((debug-on-quit nil)) (signal 'quit nil))) -- 2.39.5