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

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

[elpa] 02/35: More robust and simpler logic in prefix test


From: Dmitry Gutov
Subject: [elpa] 02/35: More robust and simpler logic in prefix test
Date: Sat, 19 Apr 2014 10:12:13 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit 5e1c9bf016c05c2d08c66144278c29cb5fc9c3f1
Author: Ingo Lohmar <address@hidden>
Date:   Tue Mar 25 22:41:49 2014 +0100

    More robust and simpler logic in prefix test
---
 company.el |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/company.el b/company.el
index 704b83b..7f327d4 100644
--- a/company.el
+++ b/company.el
@@ -1198,18 +1198,17 @@ Keywords and function definition names are ignored."
      (t (company-cancel)))))
 
 (defun company--good-prefix-p (prefix)
-  (and (or (and company--manual-prefix
+  (and (stringp (or (car-safe prefix) prefix)) ;excludes 'stop
+       (or (and company--manual-prefix
                 ;; changed selection not enough for valid prefix
                 (not (and company-abort-manual-when-too-short
                           ;; must not be less than minimum or initial length
                           (< (or (cdr-safe prefix) (length prefix))
                              (min company-minimum-prefix-length
                                   (length company--manual-prefix))))))
-           (unless (eq prefix 'stop)
-             (or (eq (cdr-safe prefix) t)
-                 (>= (or (cdr-safe prefix) (length prefix))
-                     company-minimum-prefix-length))))
-       (stringp (or (car-safe prefix) prefix))))
+           (or (eq (cdr-safe prefix) t)
+               (>= (or (cdr-safe prefix) (length prefix))
+                   company-minimum-prefix-length)))))
 
 (defun company--continue ()
   (when (company-call-backend 'no-cache company-prefix)



reply via email to

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