]> code.delx.au - gnu-emacs-elpa/blobdiff - company-xcode.el
Removed superfluous quotes.
[gnu-emacs-elpa] / company-xcode.el
index ac3f4cc87b8ca548c9b61b03dd9bc786deb0efcf..884a78d2f705f58726e4b50f20936830b0dc97a1 100644 (file)
@@ -2,7 +2,7 @@
 ;;
 ;; Copyright (C) 2009 Nikolaj Schumacher
 ;;
-;; This file is part of company 0.3.1.
+;; This file is part of company 0.5.
 ;;
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License
@@ -44,12 +44,13 @@ valid in most contexts."
          (company-xcode-reset))
   :group 'company-xcode
   :type '(set (const "Category") (const "Class") (const "Class Method")
-              (const "Constant") (const "Enum") (const "Field")
-              (const "Instance Method") (const "Instance Variable")
-              (const "Macro") (const "Modeled Class") (const "Modeled Method")
-              (const "Property") (const "Protocol") (const "Structure")
-              (const "Type") (const "Union") (const "Variable")
-              (const "Function")))
+              (const "Class Variable") (const "Constant") (const "Enum")
+              (const "Field") (const "Instance Method")
+              (const "Instance Variable") (const "Macro")
+              (const "Modeled Class") (const "Modeled Method")
+              (const "Modeled Property") (const "Property") (const "Protocol")
+              (const "Structure") (const "Type") (const "Union")
+              (const "Variable") (const "Function")))
 
 (defvar company-xcode-project 'unknown)
 (make-variable-buffer-local 'company-xcode-project)
@@ -78,9 +79,11 @@ valid in most contexts."
   (let ((dir (if buffer-file-name
                  (file-name-directory buffer-file-name)
                (expand-file-name default-directory)))
+        (prev-dir nil)
         file)
-    (while (not (or file (equal dir "/")))
+    (while (not (or file (equal dir prev-dir)))
       (setq file (car (directory-files dir t ".xcodeproj\\'" t))
+            prev-dir dir
             dir (file-name-directory (directory-file-name dir))))
     file))
 
@@ -97,13 +100,14 @@ valid in most contexts."
   "A `company-mode' completion back-end for Xcode projects."
   (interactive (list 'interactive))
   (case command
-    ('interactive (company-begin-backend 'company-xcode))
-    ('prefix (and company-xcode-xcodeindex-executable
-                  (not (company-in-string-or-comment))
-                  (or (company-grab-symbol) 'stop)))
-    ('candidates (let ((completion-ignore-case nil))
-                   (company-xcode-tags)
-                   (all-completions arg (company-xcode-tags))))))
+    (interactive (company-begin-backend 'company-xcode))
+    (prefix (and company-xcode-xcodeindex-executable
+                 (company-xcode-tags)
+                 (not (company-in-string-or-comment))
+                 (or (company-grab-symbol) 'stop)))
+    (candidates (let ((completion-ignore-case nil))
+                  (company-xcode-tags)
+                  (all-completions arg (company-xcode-tags))))))
 
 
 (provide 'company-xcode)