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

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

[elpa] master 996fbd2 24/66: Add company-bbdb-modes defcustom


From: Dmitry Gutov
Subject: [elpa] master 996fbd2 24/66: Add company-bbdb-modes defcustom
Date: Tue, 13 Jan 2015 02:44:51 +0000

branch: master
commit 996fbd2b6a2fa38e14277b98cdcf99faf39a8a5f
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Add company-bbdb-modes defcustom
---
 NEWS.md         |    1 +
 company-bbdb.el |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index 8494f08..0e1c8c1 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
 
 ## Next
 
+* New user option, `company-bbdb-modes`.
 * `company-show-numbers` and `company-complete-number` now use visual numbering
   of the candidates, taking into account only the ones currently displayed.
 * `company-complete-number` can be bound to keypad numbers directly, with or
diff --git a/company-bbdb.el b/company-bbdb.el
index b2760b2..a134f90 100644
--- a/company-bbdb.el
+++ b/company-bbdb.el
@@ -27,6 +27,11 @@
 (declare-function bbdb-dwim-mail "bbdb-com")
 (declare-function bbdb-search "bbdb-com")
 
+(defcustom company-bbdb-modes '(message-mode)
+  "Major modes in which `company-bbdb' may complete."
+  :type '(repeat (symbol :tag "Major mode"))
+  :package-version '(company . "0.8.8"))
+
 (defun company-bbdb--candidates (arg)
   (cl-mapcan (lambda (record)
                (mapcar (lambda (mail) (bbdb-dwim-mail record mail))
@@ -39,7 +44,7 @@
   (interactive (list 'interactive))
   (cl-case command
     (interactive (company-begin-backend 'company-bbdb))
-    (prefix (and (eq major-mode 'message-mode)
+    (prefix (and (memq major-mode company-bbdb-modes)
                  (featurep 'bbdb-com)
                  (looking-back "^\\(To\\|Cc\\|Bcc\\): *\\(.*\\)"
                                (line-beginning-position))



reply via email to

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