]> code.delx.au - gnu-emacs-elpa/commitdiff
Added company-elisp-detect-function-context option.
authorNikolaj Schumacher <git@nschum.de>
Fri, 27 Mar 2009 20:23:30 +0000 (21:23 +0100)
committerNikolaj Schumacher <git@nschum.de>
Sun, 5 Apr 2009 10:43:40 +0000 (12:43 +0200)
company-elisp.el
company.el

index b77851e18b741135413891ba1b4701d2b8da3795..4f8df83ad24a6fc7e3259dd34654a30b24d90659 100644 (file)
 (require 'company)
 (eval-when-compile (require 'cl))
 
-(defcustom company-elisp-functions-only-in-context nil
+(defcustom company-elisp-detect-function-context t
   "*If enabled, offer lisp functions only in appropriate contexts.
 Functions are offered for completion only after ' and \(."
   :group 'company
-  :type '(choice (const :tag "off (nil)" nil)
-                 (integer :tag "count" t)))
+  :type '(choice (const :tag "Off" nil)
+                 (const :tag "On" t)))
 
 (defvar company-lisp-symbol-regexp
   "\\_<\\(\\sw\\|\\s_\\)+\\_>\\=")
@@ -72,7 +72,7 @@ Functions are offered for completion only after ' and \(."
 (defun company-elisp-candidates (prefix)
   (let* ((completion-ignore-case nil)
          (before (char-before (- (point) (length prefix))))
-         (predicate (if (and company-elisp-functions-only-in-context
+         (predicate (if (and company-elisp-detect-function-context
                              (not (eq before ?')))
                         (if (eq before ?\()
                             'fboundp
@@ -91,8 +91,7 @@ Functions are offered for completion only after ' and \(."
          (match-string 0 doc))))
 
 (defun company-elisp (command &optional arg &rest ignored)
-  "A `company-mode' completion back-end for `emacs-lisp-mode'.
-See `company-elisp-functions-only-in-context'."
+  "A `company-mode' completion back-end for `emacs-lisp-mode'."
   (case command
     ('prefix (and (eq (derived-mode-p 'emacs-lisp-mode) 'emacs-lisp-mode)
                   (company-grab-lisp-symbol)))
index ea482c7e033cb3796304a64b0f45c45b5afdc8bd..99570b94b672dc1d2583554c621102b4cdf3273e 100644 (file)
@@ -56,7 +56,7 @@
 ;;
 ;;; Change Log:
 ;;
-;;    Added `company-elisp-functions-only-in-context' option.
+;;    Added `company-elisp-detect-function-context' option.
 ;;    The mouse can now be used for selection.
 ;;
 ;; 2009-03-22 (0.2)