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

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

[elpa] 09/31: Reuse `company-auto-begin' in `company-idle-begin'


From: Dmitry Gutov
Subject: [elpa] 09/31: Reuse `company-auto-begin' in `company-idle-begin'
Date: Tue, 18 Mar 2014 05:19:35 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit 4dd438587a3192d8021335127740ebd477d6c678
Author: Dmitry Gutov <address@hidden>
Date:   Mon Feb 24 08:46:25 2014 +0200

    Reuse `company-auto-begin' in `company-idle-begin'
---
 company.el |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/company.el b/company.el
index 8482035..5fab34a 100644
--- a/company.el
+++ b/company.el
@@ -1051,27 +1051,20 @@ Keywords and function definition names are ignored."
      noccurs)))
 
 (defun company-idle-begin (buf win tick pos)
-  (and company-mode
-       (eq buf (current-buffer))
+  (and (eq buf (current-buffer))
        (eq win (selected-window))
        (eq tick (buffer-chars-modified-tick))
        (eq pos (point))
-       (not company-candidates)
        (not (equal (point) company-point))
-       (let ((company-idle-delay t)
-             (company-begin-commands t))
-         (company-begin)
-         (when company-candidates
-           (when (version< emacs-version "24.3.50")
-             (company-input-noop))
-           (company-post-command)))))
+       (when (company-auto-begin)
+         (when (version< emacs-version "24.3.50")
+           (company-input-noop))
+         (company-post-command))))
 
 (defun company-auto-begin ()
-  (company-assert-enabled)
   (and company-mode
        (not company-candidates)
        (let ((company-idle-delay t)
-             (company-minimum-prefix-length 0)
              (company-begin-commands t))
          (company-begin)))
   ;; Return non-nil if active.
@@ -1079,9 +1072,11 @@ Keywords and function definition names are ignored."
 
 (defun company-manual-begin ()
   (interactive)
+  (company-assert-enabled)
   (setq company--explicit-action t)
   (unwind-protect
-      (company-auto-begin)
+      (let ((company-minimum-prefix-length 0))
+        (company-auto-begin))
     (unless company-candidates
       (setq company--explicit-action nil))))
 



reply via email to

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