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

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

[elpa] master 027d180 22/40: company--perform: Clarify the control flow


From: Dmitry Gutov
Subject: [elpa] master 027d180 22/40: company--perform: Clarify the control flow a little bit
Date: Thu, 2 Jan 2020 18:57:03 -0500 (EST)

branch: master
commit 027d180ae48ea11a0a60293f69b9ab96614e4435
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    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)))



reply via email to

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