branch: master commit 027d180ae48ea11a0a60293f69b9ab96614e4435 Author: Dmitry Gutov <dgu...@yandex.ru> Commit: Dmitry Gutov <dgu...@yandex.ru>
company--perform: Clarify the control flow a little bit Inspired by #901 --- company.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/company.el b/company.el index 6feb6fc..e6c8c7e 100644 --- a/company.el +++ b/company.el @@ -1619,8 +1619,11 @@ prefix match (same case) will be prioritized." (cl-return c))))) (defun company--perform () - (or (and company-candidates (company--continue)) - (and (company--should-complete) (company--begin-new))) + (cond + (company-candidates + (company--continue)) + ((company--should-complete) + (company--begin-new))) (if (not company-candidates) (setq company-backend nil) (setq company-point (point) @@ -2724,6 +2727,7 @@ If SHOW-VERSION is non-nil, show the version in the echo area." (let ((str (concat (when nl " \n") (mapconcat 'identity (nreverse new) "\n") "\n"))) + ;; Use add-face-text-property in Emacs 24.4 (font-lock-append-text-property 0 (length str) 'face 'default str) (when nl (put-text-property 0 1 'cursor t str)) str)))