[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e0d2bf0 157/173: company-bbdb: Use full names as prefix
From: |
Dmitry Gutov |
Subject: |
[elpa] master e0d2bf0 157/173: company-bbdb: Use full names as prefix |
Date: |
Thu, 23 Jun 2016 00:28:47 +0000 (UTC) |
branch: master
commit e0d2bf0ae6df94eca9d2d8afca6d1de4db0d4796
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
company-bbdb: Use full names as prefix
Fixing regression from #453.
---
company-bbdb.el | 2 +-
test/bbdb-tests.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/company-bbdb.el b/company-bbdb.el
index 36307d0..872e1fc 100644
--- a/company-bbdb.el
+++ b/company-bbdb.el
@@ -50,7 +50,7 @@
(interactive (company-begin-backend 'company-bbdb))
(prefix (and (memq major-mode company-bbdb-modes)
(featurep 'bbdb-com)
- (looking-back "^\\(To\\|Cc\\|Bcc\\): *.*?\\([^,; ]*\\)"
+ (looking-back "^\\(To\\|Cc\\|Bcc\\): *.*? *\\([^,;]*\\)"
(line-beginning-position))
(match-string-no-properties 2)))
(candidates (company-bbdb--candidates arg))
diff --git a/test/bbdb-tests.el b/test/bbdb-tests.el
new file mode 100644
index 0000000..b1f21b9
--- /dev/null
+++ b/test/bbdb-tests.el
@@ -0,0 +1,46 @@
+;;; bbdb-tests.el --- company-mode tests -*- lexical-binding: t -*-
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Dmitry Gutov
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+(require 'company-tests)
+(require 'company-bbdb)
+
+(provide 'bbdb-com)
+
+(ert-deftest company-bbdb-prefix-looks-in-header-value ()
+ (with-temp-buffer
+ (insert "To: J")
+ (setq-local major-mode 'message-mode)
+ (should (equal (company-bbdb 'prefix)
+ "J"))))
+
+(ert-deftest company-bbdb-prefix-includes-space ()
+ (with-temp-buffer
+ (insert "To: John Sm")
+ (setq-local major-mode 'message-mode)
+ (should (equal (company-bbdb 'prefix)
+ "John Sm"))))
+
+(ert-deftest company-bbdb-prefix-begins-after-comma-or-semi ()
+ (with-temp-buffer
+ (insert "To: John Smythe <address@hidden>, Jess C")
+ (setq-local major-mode 'message-mode)
+ (should (equal (company-bbdb 'prefix)
+ "Jess C"))))
- [elpa] master ada2ede 128/173: Merge pull request #461 from rlph/patch-1, (continued)
- [elpa] master ada2ede 128/173: Merge pull request #461 from rlph/patch-1, Dmitry Gutov, 2016/06/22
- [elpa] master c38d382 147/173: Fixed typo, Dmitry Gutov, 2016/06/22
- [elpa] master 1275cdd 141/173: Bump copyright, Dmitry Gutov, 2016/06/22
- [elpa] master 4f0d7a1 131/173: Kill trailing / on directories completion, Dmitry Gutov, 2016/06/22
- [elpa] master 1de23f8 148/173: Merge pull request #486 from akirakyle/patch-1, Dmitry Gutov, 2016/06/22
- [elpa] master c12216b 140/173: re-sort, Dmitry Gutov, 2016/06/22
- [elpa] master e525793 143/173: company-dabbrev--search-buffer: Speed up, Dmitry Gutov, 2016/06/22
- [elpa] master 7d2d49b 150/173: company--fetch-candidates: Bind non-essential, Dmitry Gutov, 2016/06/22
- [elpa] master 90ec4ce 153/173: Don't call company-abort right after startup, Dmitry Gutov, 2016/06/22
- [elpa] master d48eaee 155/173: Merge pull request #499 from fice-t/autoload, Dmitry Gutov, 2016/06/22
- [elpa] master e0d2bf0 157/173: company-bbdb: Use full names as prefix,
Dmitry Gutov <=
- [elpa] master 6067bc6 169/173: Mention company-sort-prefer-same-case-prefix, Dmitry Gutov, 2016/06/22
- [elpa] master adfb2d9 167/173: Mention company-pseudo-tooltip-unless-just-one-frontend-with-delay in NEWS, Dmitry Gutov, 2016/06/22
- [elpa] master ce38a7d 166/173: Replace :sorted with :separate, and sort within each chunk, Dmitry Gutov, 2016/06/22
- [elpa] master 971eea5 170/173: Bump copyright, Dmitry Gutov, 2016/06/22
- [elpa] master de9f2e1 163/173: Add support for auto-complete like behavior (#524), Dmitry Gutov, 2016/06/22
- [elpa] master 212c8fc 172/173: Make a new release, Dmitry Gutov, 2016/06/22
- [elpa] master 7a2deff 173/173: Merge commit '212c8fc3101781a2f1c55ca61772eb75a2046e87' from company, Dmitry Gutov, 2016/06/22
- [elpa] master c6d5330 165/173: company-eclim--project-dir: Try to handle non-project buffers, Dmitry Gutov, 2016/06/22