[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 7a05d1c 115/173: company-cancel: Call pre/post-completion
From: |
Dmitry Gutov |
Subject: |
[elpa] master 7a05d1c 115/173: company-cancel: Call pre/post-completion at the end |
Date: |
Thu, 23 Jun 2016 00:28:43 +0000 (UTC) |
branch: master
commit 7a05d1cb35a408a655f0f9f7b457b6e245a74976
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
company-cancel: Call pre/post-completion at the end
Fixes ##449 in a slightly different way
---
company.el | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/company.el b/company.el
index 117b093..af45141 100644
--- a/company.el
+++ b/company.el
@@ -1525,14 +1525,8 @@ from the rest of the backends in the group, if any, will
be left at the end."
(company-call-frontends 'update)))
(defun company-cancel (&optional result)
- (unwind-protect
- (when company-prefix
- (if (stringp result)
- (progn
- (company-call-backend 'pre-completion result)
- (run-hook-with-args 'company-completion-finished-hook result)
- (company-call-backend 'post-completion result))
- (run-hook-with-args 'company-completion-cancelled-hook result)))
+ (let ((prefix company-prefix)
+ (backend company-backend))
(setq company-backend nil
company-prefix nil
company-candidates nil
@@ -1551,7 +1545,16 @@ from the rest of the backends in the group, if any, will
be left at the end."
(company-echo-cancel t)
(company-search-mode 0)
(company-call-frontends 'hide)
- (company-enable-overriding-keymap nil))
+ (company-enable-overriding-keymap nil)
+ (when prefix
+ ;; FIXME: RESULT can also be e.g. `unique'. We should call
+ ;; `company-completion-finished-hook' in that case, with right argument.
+ (if (stringp result)
+ (let ((company-backend backend))
+ (company-call-backend 'pre-completion result)
+ (run-hook-with-args 'company-completion-finished-hook result)
+ (company-call-backend 'post-completion result))
+ (run-hook-with-args 'company-completion-cancelled-hook result))))
;; Make return value explicit.
nil)
- [elpa] master ac7f816 134/173: Merge pull request #466 from tarsius/patch-1, (continued)
- [elpa] master ac7f816 134/173: Merge pull request #466 from tarsius/patch-1, Dmitry Gutov, 2016/06/22
- [elpa] master 9e844d1 124/173: Merge pull request #459 from fbergroth/prefix-length-var, Dmitry Gutov, 2016/06/22
- [elpa] master 31780fb 114/173: Revert "company-cancel: Call frontends' 'hide before 'post-completion", Dmitry Gutov, 2016/06/22
- [elpa] master a7e4408 152/173: Merge pull request #491 from akirakyle/patch-1, Dmitry Gutov, 2016/06/22
- [elpa] master 2dd1f6a 112/173: company-cancel: Call frontends' 'hide before 'post-completion, Dmitry Gutov, 2016/06/22
- [elpa] master dc4927b 158/173: Allow company-dabbrev-ignore-buffers to be a function, Dmitry Gutov, 2016/06/22
- [elpa] master 3f1afc6 171/173: Revert "Remove the [return] binding (#530)", Dmitry Gutov, 2016/06/22
- [elpa] master 9fb6072 116/173: Reimplement -electric-do using a pre-command-hook, Dmitry Gutov, 2016/06/22
- [elpa] master c845c43 097/173: Revert "Add support for company-face", Dmitry Gutov, 2016/06/22
- [elpa] master e477eaf 107/173: Bump copyright years, Dmitry Gutov, 2016/06/22
- [elpa] master 7a05d1c 115/173: company-cancel: Call pre/post-completion at the end,
Dmitry Gutov <=
- [elpa] master cd69d7b 119/173: Add company-semantic-begin-after-member-access, Dmitry Gutov, 2016/06/22
- [elpa] master 724e6dd 136/173: Delete the cache when async completion aborts, Dmitry Gutov, 2016/06/22
- [elpa] master e251568 137/173: Update test for the latest change, Dmitry Gutov, 2016/06/22
- [elpa] master 7afffbc 068/173: Spell "backend" and "frontend" without hyphens, Dmitry Gutov, 2016/06/22
- [elpa] master 5565541 126/173: Option to have tempo expand tags after completion., Dmitry Gutov, 2016/06/22
- [elpa] master ec9f6c7 127/173: Moved company-tempo-insert call to post-completion, Dmitry Gutov, 2016/06/22
- [elpa] master bdf6b22 138/173: Fix #474 by filtering dabbrev completions at the end, Dmitry Gutov, 2016/06/22
- [elpa] master e65ab4c 111/173: Merge pull request #453 from jtatarik/bbdb-multiple-recipients, Dmitry Gutov, 2016/06/22
- [elpa] master 077182c 154/173: Add autoload cookies, Dmitry Gutov, 2016/06/22
- [elpa] master a619a93 132/173: Merge pull request #465 from vspinu/files-optim, Dmitry Gutov, 2016/06/22