]> rtime.felk.cvut.cz Git - sojka/company-mode.git/commitdiff
Added safe-local-variable predicate for company-backends.
authorNikolaj Schumacher <git@nschum.de>
Thu, 16 Apr 2009 18:07:55 +0000 (20:07 +0200)
committerNikolaj Schumacher <git@nschum.de>
Sat, 18 Apr 2009 10:59:57 +0000 (12:59 +0200)
company.el

index 74dca39dab6bca154e0399fbd909ddea55517913..65a35ed3ff483b86f69dc402f0fe80156d4f5f4b 100644 (file)
@@ -243,6 +243,18 @@ The visualized data is stored in `company-prefix', `company-candidates',
                                 company-preview-if-just-one-frontend)
                          (function :tag "custom function" nil))))
 
+(defvar company-safe-backends
+  '(company-abbrev company-css company-dabbrev-code company-dabbrev
+    company-elisp company-etags company-files company-gtags company-ispell
+    company-nxml company-oddmuse company-semantic company-tempo company-xcode))
+(put 'company-safe-backends 'risky-local-variable t)
+
+(defun company-safe-backends-p (backends)
+  (and (consp backends)
+       (not (dolist (backend backends)
+              (unless (memq backend company-safe-backends)
+                (return t))))))
+
 (defcustom company-backends '(company-elisp company-nxml company-css
                               company-semantic company-xcode company-gtags
                               company-etags company-oddmuse company-files
@@ -294,6 +306,8 @@ does not know about.  It should also be callable interactively and use
   :group 'company
   :type '(repeat (function :tag "function" nil)))
 
+(put 'company-backends 'safe-local-variable 'company-safe-backend-p)
+
 (defcustom company-completion-started-hook nil
   "*Hook run when company starts completing.
 The hook is called with one argument that is non-nil if the completion was