emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 08/30: company-post-command: Handle being called after quitting


From: Dmitry Gutov
Subject: [elpa] 08/30: company-post-command: Handle being called after quitting
Date: Tue, 14 Oct 2014 22:22:46 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit bb6ca75eca40864815034164fef07abbb4de6147
Author: Dmitry Gutov <address@hidden>
Date:   Sun Sep 28 07:10:22 2014 +0400

    company-post-command: Handle being called after quitting
    
    Fixes #190
---
 company.el |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/company.el b/company.el
index 8cb12e3..079a055 100644
--- a/company.el
+++ b/company.el
@@ -1279,7 +1279,8 @@ from the rest of the back-ends in the group, if any, will 
be left at the end."
        (eq pos (point))
        (when (company-auto-begin)
          (company-input-noop)
-         (company-post-command))))
+         (let ((this-command 'company-idle-begin))
+           (company-post-command)))))
 
 (defun company-auto-begin ()
   (and company-mode
@@ -1518,6 +1519,13 @@ from the rest of the back-ends in the group, if any, 
will be left at the end."
   (company-uninstall-map))
 
 (defun company-post-command ()
+  (when (null this-command)
+    ;; Happens when the user presses `C-g' while inside
+    ;; `flyspell-post-command-hook', for example.
+    ;; Or any other `post-command-hook' function that can call `sit-for',
+    ;; or any quittable timer function.
+    (company-abort)
+    (setq this-command 'company-abort))
   (unless (company-keep this-command)
     (condition-case err
         (progn



reply via email to

[Prev in Thread] Current Thread [Next in Thread]