From d2ff1dcb0a9f8343cfe6f66d21527f81db16642f Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 17 Jun 2015 22:58:23 +0300 Subject: [PATCH] company--begin-new: Call `company-cancel' in the unique case To fix a problem reported in http://lists.gnu.org/archive/html/help-gnu-emacs/2015-06/msg00273.html --- company.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/company.el b/company.el index 0aa034286..ed5e14c2f 100644 --- a/company.el +++ b/company.el @@ -1472,10 +1472,13 @@ from the rest of the back-ends in the group, if any, will be left at the end." (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix)) - ;; t means complete/unique. We don't start, so no hooks. (if (not (consp c)) - (when company--manual-action - (message "No completion found")) + (progn + ;; t means complete/unique. + ;; Run the hooks anyway, to e.g. clear the cache. + (company-cancel 'unique) + (when company--manual-action + (message "No completion found"))) (when company--manual-action (setq company--manual-prefix prefix)) (company-update-candidates c) -- 2.39.2