X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/8b7d5ff1768dc573b9d2e64d1fc8a5973de163b9..4a6eea94edb138a3ea73e7a50553b69dedc5c3ad:/company-xcode.el diff --git a/company-xcode.el b/company-xcode.el index b558fe806..56da19890 100644 --- a/company-xcode.el +++ b/company-xcode.el @@ -1,6 +1,6 @@ -;;; company-xcode.el --- A company-mode completion back-end for Xcode projects +;;; company-xcode.el --- company-mode completion backend for Xcode projects -;; Copyright (C) 2009-2011 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011, 2014 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -26,11 +26,14 @@ ;;; Code: (require 'company) -(eval-when-compile (require 'cl)) +(require 'cl-lib) + +(defgroup company-xcode nil + "Completion backend for Xcode projects." + :group 'company) (defcustom company-xcode-xcodeindex-executable (executable-find "xcodeindex") "Location of xcodeindex executable." - :group 'company-xcode :type 'file) (defvar company-xcode-tags nil) @@ -50,7 +53,6 @@ valid in most contexts." :set (lambda (variable value) (set variable value) (company-xcode-reset)) - :group 'company-xcode :type '(set (const "Category") (const "Class") (const "Class Method") (const "Class Variable") (const "Constant") (const "Enum") (const "Field") (const "Instance Method") @@ -60,8 +62,7 @@ valid in most contexts." (const "Structure") (const "Type") (const "Union") (const "Variable") (const "Function"))) -(defvar company-xcode-project 'unknown) -(make-variable-buffer-local 'company-xcode-project) +(defvar-local company-xcode-project 'unknown) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -79,7 +80,7 @@ valid in most contexts." "\t[^\t\n]*\t[^\t\n]*")) candidates) (while (re-search-forward regexp nil t) - (add-to-list 'candidates (match-string 1))) + (cl-pushnew (match-string 1) candidates :test #'equal)) (message "Retrieving dump from %s...done" project-bundle) candidates)))) @@ -105,9 +106,9 @@ valid in most contexts." company-xcode-tags)))))) ;;;###autoload (defun company-xcode (command &optional arg &rest ignored) - "A `company-mode' completion back-end for Xcode projects." + "`company-mode' completion backend for Xcode projects." (interactive (list 'interactive)) - (case command + (cl-case command (interactive (company-begin-backend 'company-xcode)) (prefix (and company-xcode-xcodeindex-executable (company-xcode-tags)