]> code.delx.au - gnu-emacs-elpa/commitdiff
Deprecate setting company-idle-delay to t
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 20 Jul 2014 01:57:32 +0000 (04:57 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 20 Jul 2014 05:42:36 +0000 (08:42 +0300)
NEWS.md
company.el

diff --git a/NEWS.md b/NEWS.md
index af8ea70cbfd183c0ff1d1c6f10d8dad8dd06fe5e..e547f796831b9053ebd12e6371430d9fcf6ed7df 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,9 @@
 # History of user-visible changes
 
+## Next
+
+* Setting `company-idle-delay` to `t` is deprecated. Use the value 0 instead.
+
 ## 2014-07-01 (0.8.1)
 
 * `company-require-match` is not in effect when the new input doesn't continue
index 870751776a5bc2e6f87a1c6e9fdb6cbd5467dad9..ceb815a541823377603f10c58cab3a3bc3e2120f 100644 (file)
@@ -544,10 +544,10 @@ A character that is part of a valid candidate never triggers auto-completion."
 
 (defcustom company-idle-delay .5
   "The idle delay in seconds until completion starts automatically.
-A value of nil means no idle completion, t means show candidates
-immediately when a prefix of `company-minimum-prefix-length' is reached."
+The prefix still has to satisfy `company-minimum-prefix-length' before that
+happens.  The value of nil means no idle completion."
   :type '(choice (const :tag "never (nil)" nil)
-                 (const :tag "immediate (t)" t)
+                 (const :tag "immediate (0)" 0)
                  (number :tag "seconds")))
 
 (defcustom company-begin-commands '(self-insert-command org-self-insert-command)
@@ -692,6 +692,9 @@ keymap during active completions (`company-active-map'):
   nil company-lighter company-mode-map
   (if company-mode
       (progn
+        (when (eq company-idle-delay t)
+          (setq company-idle-delay 0)
+          (warn "Setting `company-idle-delay' to t is deprecated.  Set it to 0 instead."))
         (add-hook 'pre-command-hook 'company-pre-command nil t)
         (add-hook 'post-command-hook 'company-post-command nil t)
         (mapc 'company-init-backend company-backends))
@@ -1010,7 +1013,7 @@ can retrieve meta-data for them."
     candidate))
 
 (defun company--should-complete ()
-  (and (eq company-idle-delay t)
+  (and (eq company-idle-delay 'now)
        (not (or buffer-read-only overriding-terminal-local-map
                 overriding-local-map))
        ;; Check if in the middle of entering a key combination.
@@ -1256,7 +1259,7 @@ from the rest of the back-ends in the group, if any, will be left at the end."
 (defun company-auto-begin ()
   (and company-mode
        (not company-candidates)
-       (let ((company-idle-delay t))
+       (let ((company-idle-delay 'now))
          (condition-case-unless-debug err
              (company--perform)
            (error (message "Company: An error occurred in auto-begin")
@@ -1508,9 +1511,7 @@ from the rest of the back-ends in the group, if any, will be left at the end."
     (condition-case err
         (progn
           (unless (equal (point) company-point)
-            (let ((company-idle-delay (and (eq company-idle-delay t)
-                                           (company--should-begin)
-                                           t)))
+            (let (company-idle-delay) ; Against misbehavior while debugging.
               (company--perform)))
           (if company-candidates
               (company-call-frontends 'post-command)