[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ELPA-diffs] /srv/bzr/emacs/elpa r380: company: Release 0.6.7
From: |
Dmitry Gutov |
Subject: |
[ELPA-diffs] /srv/bzr/emacs/elpa r380: company: Release 0.6.7 |
Date: |
Fri, 05 Apr 2013 00:09:23 +0400 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 380
committer: Dmitry Gutov <address@hidden>
branch nick: elpa
timestamp: Fri 2013-04-05 00:09:23 +0400
message:
company: Release 0.6.7
* Two `company-elisp` tweaks.
Git commit 8dceda389115b397de48becc4b68a64f4dc4bbab
modified:
packages/company/company-elisp.el
packages/company/company-pkg.el
packages/company/company-tests.el
packages/company/company.el
=== modified file 'packages/company/company-elisp.el'
--- a/packages/company/company-elisp.el 2013-04-01 05:30:58 +0000
+++ b/packages/company/company-elisp.el 2013-04-04 20:09:23 +0000
@@ -157,24 +157,29 @@
(defun company-elisp--candidates-predicate (prefix)
(let* ((completion-ignore-case nil)
- (before (char-before (- (point) (length prefix)))))
+ (beg (- (point) (length prefix)))
+ (before (char-before beg)))
(if (and company-elisp-detect-function-context
- (not (eq before ?')))
+ (not (memq before '(?' ?`))))
(if (and (eq before ?\()
(not
(save-excursion
(ignore-errors
- (up-list -2)
- (and (save-excursion
- (forward-char 1)
- (looking-at "[ \t\n]*("))
- (prog1 (search-backward "(")
- (forward-char 1))
- (looking-at company-elisp-var-binding-regexp))))))
+ (goto-char (1- beg))
+ (or (company-elisp--before-binding-varlist-p)
+ (progn
+ (up-list -1)
+ (company-elisp--before-binding-varlist-p)))))))
'fboundp
'boundp)
'company-elisp--predicate)))
+(defun company-elisp--before-binding-varlist-p ()
+ (save-excursion
+ (and (prog1 (search-backward "(")
+ (forward-char 1))
+ (looking-at company-elisp-var-binding-regexp))))
+
(defun company-elisp--doc (symbol)
(let* ((symbol (intern symbol))
(doc (if (fboundp symbol)
=== modified file 'packages/company/company-pkg.el'
--- a/packages/company/company-pkg.el 2013-04-01 05:30:58 +0000
+++ b/packages/company/company-pkg.el 2013-04-04 20:09:23 +0000
@@ -1,1 +1,1 @@
-(define-package "company" "0.6.6" "Modular in-buffer completion framework")
+(define-package "company" "0.6.7" "Modular in-buffer completion framework")
=== modified file 'packages/company/company-tests.el'
--- a/packages/company/company-tests.el 2013-04-01 05:30:58 +0000
+++ b/packages/company/company-tests.el 2013-04-04 20:09:23 +0000
@@ -225,31 +225,35 @@
(setq major-mode 'emacs-lisp-mode)
(re-search-backward "|")
(replace-match "")
- ,@body))
+ (let ((company-elisp-detect-function-context t))
+ ,@body)))
(ert-deftest company-elisp-candidates-predicate ()
(company-elisp-with-buffer
"(foo ba|)"
- (should (eq (let ((company-elisp-detect-function-context t))
- (company-elisp--candidates-predicate "ba"))
+ (should (eq (company-elisp--candidates-predicate "ba")
'boundp))
(should (eq (let (company-elisp-detect-function-context)
(company-elisp--candidates-predicate "ba"))
'company-elisp--predicate)))
(company-elisp-with-buffer
"(foo| )"
- (should (eq (let ((company-elisp-detect-function-context t))
- (company-elisp--candidates-predicate "foo"))
+ (should (eq (company-elisp--candidates-predicate "foo")
'fboundp))
(should (eq (let (company-elisp-detect-function-context)
(company-elisp--candidates-predicate "foo"))
'company-elisp--predicate)))
(company-elisp-with-buffer
"(foo 'b|)"
- (should (eq (let ((company-elisp-detect-function-context t))
- (company-elisp--candidates-predicate "b"))
+ (should (eq (company-elisp--candidates-predicate "b")
'company-elisp--predicate))))
+(ert-deftest company-elisp-candidates-predicate-in-docstring ()
+ (company-elisp-with-buffer
+ "(def foo () \"Doo be doo `ide|"
+ (should (eq 'company-elisp--predicate
+ (company-elisp--candidates-predicate "ide")))))
+
;; This one's also an integration test.
(ert-deftest company-elisp-candidates-recognizes-binding-form ()
(let ((company-elisp-detect-function-context t)
@@ -266,6 +270,16 @@
(should (equal '("when")
(company-elisp-candidates "wh"))))))
+(ert-deftest company-elisp-candidates-predicate-binding-without-value ()
+ (loop for (text prefix predicate) in '(("(let (foo|" "foo" boundp)
+ ("(let (foo (bar|" "bar" boundp)
+ ("(let (foo) (bar|" "bar" fboundp))
+ do
+ (eval `(company-elisp-with-buffer
+ ,text
+ (should (eq ',predicate
+ (company-elisp--candidates-predicate
,prefix)))))))
+
(ert-deftest company-elisp-finds-vars ()
(let ((obarray [boo bar baz backquote])
(boo t)
=== modified file 'packages/company/company.el'
--- a/packages/company/company.el 2013-04-01 05:30:58 +0000
+++ b/packages/company/company.el 2013-04-04 20:09:23 +0000
@@ -4,7 +4,7 @@
;; Author: Nikolaj Schumacher
;; Maintainer: Dmitry Gutov <address@hidden>
-;; Version: 0.6.6
+;; Version: 0.6.7
;; Keywords: abbrev, convenience, matching
;; URL: http://company-mode.github.com/
;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x, GNU Emacs 24.x
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ELPA-diffs] /srv/bzr/emacs/elpa r380: company: Release 0.6.7,
Dmitry Gutov <=