From 0fef728ac2464d1019129679dc62277ffe4bd9b1 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Thu, 25 Feb 2016 17:43:34 -0500 Subject: [PATCH] update emacs config and packages --- emacs | 20 +- emacs.d/.mc-lists.el | 1 + .../ac-js2-20140906.442/ac-js2-autoloads.el | 50 - .../elpa/ac-js2-20140906.442/ac-js2-pkg.el | 7 - .../elpa/ac-js2-20140906.442/ac-js2-tests.el | 76 - emacs.d/elpa/ac-js2-20140906.442/ac-js2.el | 605 -- .../elpa/ac-js2-20140906.442/skewer-addon.js | 116 - .../company-20160117.321/company-abbrev.el | 50 - .../company-20160117.321/company-autoloads.el | 284 - .../elpa/company-20160117.321/company-bbdb.el | 61 - .../elpa/company-20160117.321/company-capf.el | 170 - .../company-20160117.321/company-clang.el | 331 - .../company-20160117.321/company-cmake.el | 198 - .../elpa/company-20160117.321/company-css.el | 442 - .../company-dabbrev-code.el | 104 - .../company-20160117.321/company-dabbrev.el | 188 - .../company-20160117.321/company-eclim.el | 185 - .../company-20160117.321/company-elisp.el | 225 - .../company-20160117.321/company-etags.el | 107 - .../company-20160117.321/company-files.el | 111 - .../company-20160117.321/company-gtags.el | 116 - .../company-20160117.321/company-ispell.el | 82 - .../company-20160117.321/company-keywords.el | 242 - .../elpa/company-20160117.321/company-nxml.el | 142 - .../company-20160117.321/company-oddmuse.el | 57 - .../elpa/company-20160117.321/company-pkg.el | 8 - .../company-20160117.321/company-semantic.el | 167 - .../company-20160117.321/company-template.el | 214 - .../company-20160117.321/company-tempo.el | 62 - .../company-20160117.321/company-xcode.el | 123 - .../company-20160117.321/company-yasnippet.el | 147 - emacs.d/elpa/company-20160117.321/company.el | 2992 ------ .../dockerfile-mode-autoloads.el | 35 + .../dockerfile-mode-pkg.el | 1 + .../dockerfile-mode.el | 136 + emacs.d/elpa/flycheck-20160224.642/dir | 18 + .../elpa/flycheck-20160224.642/fdl-1.3.info | 484 + .../flycheck-autoloads.el | 238 + .../flycheck-buttercup.el | 99 + .../flycheck-20160224.642/flycheck-ert.el | 432 + .../flycheck-20160224.642/flycheck-pkg.el | 11 + .../elpa/flycheck-20160224.642/flycheck.el | 8477 +++++++++++++++++ .../elpa/flycheck-20160224.642/flycheck.info | 3135 ++++++ .../elpa/flycheck-20160224.642/macros.info | 7 + .../json-mode-autoloads.el | 33 + .../json-mode-20151116.2000/json-mode-pkg.el | 1 + .../elpa/json-mode-20151116.2000/json-mode.el | 104 + .../json-reformat-autoloads.el | 26 + .../json-reformat-pkg.el | 1 + .../json-reformat.el | 221 + .../json-snatcher-autoloads.el | 22 + .../json-snatcher-pkg.el | 1 + .../json-snatcher.el | 351 + emacs.d/elpa/let-alist-1.0.4.signed | 1 + .../let-alist-1.0.4/let-alist-autoloads.el | 49 + emacs.d/elpa/let-alist-1.0.4/let-alist-pkg.el | 1 + emacs.d/elpa/let-alist-1.0.4/let-alist.el | 170 + emacs.d/elpa/seq-1.11.signed | 1 + emacs.d/elpa/seq-1.11/seq-autoloads.el | 15 + emacs.d/elpa/seq-1.11/seq-pkg.el | 1 + emacs.d/elpa/seq-1.11/seq.el | 564 ++ .../elpa/tern-20151228.511/tern-autoloads.el | 26 + emacs.d/elpa/tern-20151228.511/tern-pkg.el | 1 + emacs.d/elpa/tern-20151228.511/tern.el | 601 ++ .../tern-auto-complete-autoloads.el | 22 + .../tern-auto-complete-pkg.el | 1 + .../tern-auto-complete.el | 137 + 67 files changed, 15437 insertions(+), 7669 deletions(-) delete mode 100644 emacs.d/elpa/ac-js2-20140906.442/ac-js2-autoloads.el delete mode 100644 emacs.d/elpa/ac-js2-20140906.442/ac-js2-pkg.el delete mode 100644 emacs.d/elpa/ac-js2-20140906.442/ac-js2-tests.el delete mode 100644 emacs.d/elpa/ac-js2-20140906.442/ac-js2.el delete mode 100644 emacs.d/elpa/ac-js2-20140906.442/skewer-addon.js delete mode 100644 emacs.d/elpa/company-20160117.321/company-abbrev.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-autoloads.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-bbdb.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-capf.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-clang.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-cmake.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-css.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-dabbrev-code.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-dabbrev.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-eclim.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-elisp.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-etags.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-files.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-gtags.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-ispell.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-keywords.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-nxml.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-oddmuse.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-pkg.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-semantic.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-template.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-tempo.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-xcode.el delete mode 100644 emacs.d/elpa/company-20160117.321/company-yasnippet.el delete mode 100644 emacs.d/elpa/company-20160117.321/company.el create mode 100644 emacs.d/elpa/dockerfile-mode-20160128.951/dockerfile-mode-autoloads.el create mode 100644 emacs.d/elpa/dockerfile-mode-20160128.951/dockerfile-mode-pkg.el create mode 100644 emacs.d/elpa/dockerfile-mode-20160128.951/dockerfile-mode.el create mode 100644 emacs.d/elpa/flycheck-20160224.642/dir create mode 100644 emacs.d/elpa/flycheck-20160224.642/fdl-1.3.info create mode 100644 emacs.d/elpa/flycheck-20160224.642/flycheck-autoloads.el create mode 100644 emacs.d/elpa/flycheck-20160224.642/flycheck-buttercup.el create mode 100644 emacs.d/elpa/flycheck-20160224.642/flycheck-ert.el create mode 100644 emacs.d/elpa/flycheck-20160224.642/flycheck-pkg.el create mode 100644 emacs.d/elpa/flycheck-20160224.642/flycheck.el create mode 100644 emacs.d/elpa/flycheck-20160224.642/flycheck.info create mode 100644 emacs.d/elpa/flycheck-20160224.642/macros.info create mode 100644 emacs.d/elpa/json-mode-20151116.2000/json-mode-autoloads.el create mode 100644 emacs.d/elpa/json-mode-20151116.2000/json-mode-pkg.el create mode 100644 emacs.d/elpa/json-mode-20151116.2000/json-mode.el create mode 100644 emacs.d/elpa/json-reformat-20160212.53/json-reformat-autoloads.el create mode 100644 emacs.d/elpa/json-reformat-20160212.53/json-reformat-pkg.el create mode 100644 emacs.d/elpa/json-reformat-20160212.53/json-reformat.el create mode 100644 emacs.d/elpa/json-snatcher-20150511.2047/json-snatcher-autoloads.el create mode 100644 emacs.d/elpa/json-snatcher-20150511.2047/json-snatcher-pkg.el create mode 100644 emacs.d/elpa/json-snatcher-20150511.2047/json-snatcher.el create mode 100644 emacs.d/elpa/let-alist-1.0.4.signed create mode 100644 emacs.d/elpa/let-alist-1.0.4/let-alist-autoloads.el create mode 100644 emacs.d/elpa/let-alist-1.0.4/let-alist-pkg.el create mode 100644 emacs.d/elpa/let-alist-1.0.4/let-alist.el create mode 100644 emacs.d/elpa/seq-1.11.signed create mode 100644 emacs.d/elpa/seq-1.11/seq-autoloads.el create mode 100644 emacs.d/elpa/seq-1.11/seq-pkg.el create mode 100644 emacs.d/elpa/seq-1.11/seq.el create mode 100644 emacs.d/elpa/tern-20151228.511/tern-autoloads.el create mode 100644 emacs.d/elpa/tern-20151228.511/tern-pkg.el create mode 100644 emacs.d/elpa/tern-20151228.511/tern.el create mode 100644 emacs.d/elpa/tern-auto-complete-20151123.653/tern-auto-complete-autoloads.el create mode 100644 emacs.d/elpa/tern-auto-complete-20151123.653/tern-auto-complete-pkg.el create mode 100644 emacs.d/elpa/tern-auto-complete-20151123.653/tern-auto-complete.el diff --git a/emacs b/emacs index 3a26807..8bc37c8 100644 --- a/emacs +++ b/emacs @@ -81,14 +81,18 @@ (local-set-key (kbd "M-.") 'godef-jump) (add-hook 'before-save-hook 'gofmt-before-save))) (add-hook 'js-mode-hook (lambda() - (autoload 'jscs-indent-apply "jscs" nil t) - (autoload 'jscs-fix "jscs" nil t) - (autoload 'jscs-fix-before-save "jscs" nil t) (js2-minor-mode) - (ac-js2-mode) - (company-mode) - (add-hook 'before-save-hook #'jscs-fix-before-save) - (setq js-indent-level 2))) + (auto-complete-mode) + (tern-mode t) + (require 'tern-auto-complete) + (tern-ac-setup) + (setq js-indent-level 2) + (require 'flycheck) + (flycheck-mode t) + (flycheck-disabled-checkers . (javascript-jshint)) + (flycheck-checkers . (javascript-eslint)))) +(add-hook 'json-mode-hook (lambda() + (setq js-indent-level 2))) (add-hook 'ruby-mode-hook (lambda() (flyspell-prog-mode))) (add-hook `css-mode-hook (lambda() @@ -96,4 +100,6 @@ (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) (add-to-list 'auto-mode-alist '("\\.styl\\'" . css-mode)) +(add-to-list 'auto-mode-alist '("\\.scss\\'" . sass-mode)) +(add-to-list 'auto-mode-alist '("\\.pug\\'" . jade-mode)) (add-to-list 'magic-mode-alist '("#!.*node" . js-mode)) diff --git a/emacs.d/.mc-lists.el b/emacs.d/.mc-lists.el index e01a98e..de293da 100644 --- a/emacs.d/.mc-lists.el +++ b/emacs.d/.mc-lists.el @@ -3,6 +3,7 @@ (setq mc/cmds-to-run-for-all '( + helm-M-x )) (setq mc/cmds-to-run-once diff --git a/emacs.d/elpa/ac-js2-20140906.442/ac-js2-autoloads.el b/emacs.d/elpa/ac-js2-20140906.442/ac-js2-autoloads.el deleted file mode 100644 index 03058bd..0000000 --- a/emacs.d/elpa/ac-js2-20140906.442/ac-js2-autoloads.el +++ /dev/null @@ -1,50 +0,0 @@ -;;; ac-js2-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) - -;;;### (autoloads nil "ac-js2" "ac-js2.el" (21824 55291 0 0)) -;;; Generated autoloads from ac-js2.el - -(autoload 'ac-js2-expand-function "ac-js2" "\ -Expand the function definition left of point. -Expansion will only occur for candidates whose documentation -string contain a function prototype. - -\(fn)" t nil) - -(autoload 'ac-js2-completion-function "ac-js2" "\ -Function for `completions-at-point'. - -\(fn)" nil nil) - -(autoload 'ac-js2-company "ac-js2" "\ - - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -(autoload 'ac-js2-jump-to-definition "ac-js2" "\ -Jump to the definition of an object's property, variable or function. -Navigation to a property definend in an Object literal isn't -implemented. - -\(fn)" t nil) - -(autoload 'ac-js2-mode "ac-js2" "\ -A minor mode that provides auto-completion and navigation for Js2-mode. - -\(fn &optional ARG)" t nil) - -;;;*** - -;;;### (autoloads nil nil ("ac-js2-pkg.el" "ac-js2-tests.el") (21824 -;;;;;; 55291 874082 0)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; ac-js2-autoloads.el ends here diff --git a/emacs.d/elpa/ac-js2-20140906.442/ac-js2-pkg.el b/emacs.d/elpa/ac-js2-20140906.442/ac-js2-pkg.el deleted file mode 100644 index 0a7cacd..0000000 --- a/emacs.d/elpa/ac-js2-20140906.442/ac-js2-pkg.el +++ /dev/null @@ -1,7 +0,0 @@ -(define-package "ac-js2" "20140906.442" "Auto-complete source for Js2-mode, with navigation" - '((js2-mode "20090723") - (skewer-mode "1.4")) - :url "https://github.com/ScottyB/ac-js2") -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/emacs.d/elpa/ac-js2-20140906.442/ac-js2-tests.el b/emacs.d/elpa/ac-js2-20140906.442/ac-js2-tests.el deleted file mode 100644 index 05514e3..0000000 --- a/emacs.d/elpa/ac-js2-20140906.442/ac-js2-tests.el +++ /dev/null @@ -1,76 +0,0 @@ -;;; Tests for ac-js2 - -(require 'ert) -(require 'skewer-mode) -(require 'js2-mode) -(require 'ac-js2) - -;;; Must have a skewer client connected before running the tests -;; Need to call httpd-stop from main Emacs if running tests in batch mode -(unless skewer-clients - (run-skewer)) - -(ert-deftest ac-js2-candidates-test () - "Test the major function that returns candidates for all frontends." - (let (property - property-dot - func-call - var) - (with-temp-buffer - (insert " - var temp = function(param1, param2) { - var localParam = 15; - return param1 + param2; - }; - - var look; - -temp.aFun = function(lolParam) {}; -temp.anotherFunction = function() { return {about: 3};}") - (setq ac-js2-evaluate-calls t) - (setq ac-js2-external-libraries nil) - - (js2-mode) - (ac-js2-mode t) - (js2-parse) - - (insert "tem") - (ac-js2-candidates) - (setq var ac-js2-skewer-candidates) - (delete-char -3) - - (insert "temp.") - (js2-parse) - (ac-js2-candidates) - (setq property-dot ac-js2-skewer-candidates) - (delete-char -5) - - (insert "temp.aF") - (js2-parse) - (ac-js2-candidates) - (setq property ac-js2-skewer-candidates)) - - (should (assoc 'anotherFunction property-dot)) - (print property) - (should (assoc 'aFun property)) - (should (assoc 'temp var)))) - -(defmacro completion-frontend-test (test-name completion-function) - "Utility for testing completion front ends. -TODO: cover more cases" - `(ert-deftest ,test-name () - (let (var) - (with-temp-buffer - (insert "var testComplete = function(param1, param2) {};") - - (js2-mode) - (ac-js2-mode t) - (js2-parse) - - (insert "testComplet") - (funcall ',completion-function) - (setq var (thing-at-point 'word))) - (should (string= var "testComplete"))))) - -(completion-frontend-test auto-complete-test auto-complete) -(completion-frontend-test completion-at-point-test completion-at-point) diff --git a/emacs.d/elpa/ac-js2-20140906.442/ac-js2.el b/emacs.d/elpa/ac-js2-20140906.442/ac-js2.el deleted file mode 100644 index 1b010e2..0000000 --- a/emacs.d/elpa/ac-js2-20140906.442/ac-js2.el +++ /dev/null @@ -1,605 +0,0 @@ -;;; ac-js2.el --- Auto-complete source for Js2-mode, with navigation - -;; Copyright (C) 2013 Scott Barnett - -;; Author: Scott Barnett -;; URL: https://github.com/ScottyB/ac-js2 -;; Version: 1.0 -;; Package-Requires: ((js2-mode "20090723")(skewer-mode "1.4")) - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; An attempt to get context sensitive Javascript completion in Emacs. -;; Basic completions are obtained by parsing Javascript code with -;; Js2-mode's parser. -;; -;; Installation -;; -;; Easiest way to get ac-js2 is to install it from MELPA. You may need -;; this snippet -;; -;; `(add-to-list 'package-archives -;; '("melpa" . "http://melpa.milkbox.net/packages/") t)' -;; -;; if you don't have it already to fetch packages from MELPA. -;; -;; Enable ac-js2 in js2-mode as follows: -;; -;; (add-hook 'js2-mode-hook 'ac-js2-mode) -;; -;; Ac-js2 does not require auto-complete mode but I suggest you grab -;; it anyway as ac-js2 is designed to work with a completion frontend. -;; Support for Company mode is on its way. -;; -;; For more comprehensive completions you can opt to evaluate the code -;; for candidates. A browser needs to be connected to Emacs for the -;; evaluation completions to work. Put this in your init.el file. -;; -;; `(setq ac-js2-evaluate-calls t)' -;; -;; To add completions for external libraries add something like this: -;; -;; (add-to-list 'ac-js2-external-libraries "path/to/lib/library.js") -;; -;; Then connect a browser to Emacs by calling `(run-skewer)'. You may -;; need to save the buffer for completions to start. -;; -;; If auto-complete mode is installed on your system then completions -;; should start showing up otherwise use `completion-at-point'. -;; -;; Note: library completions will only work if `ac-js2-evaluate-calls' -;; is set and a browser is connected to Emacs. -;; -;; Bonus: M-. is bound to `ac-js2-jump-to-definition' which will jump -;; to Javascript definitions found in the same buffer. Given the -;; following proprety reference: -;; -;; foo.bar.baz(); -;; -;; placing the cursor on `foo', `bar' or `baz' and executing M-. will -;; take you straight to their respective definitions. Use M-, to jump -;; back to where you were. Also works for object literals. -;; -;; Recently added `ac-js2-expand-function' that will expand a function's -;; parameters bound to `C-c C-c`. Expansion will only work if the cursor -;; is after the function. -;; -;; If you have any issues or suggestions please create an issue on Github: -;; https://github.com/ScottyB/ac-js2 - -;;; History: - -;; Version 1.0 -;; * Navigation within current buffer -;; * Completion and docstring for objects via Skewer -;; * External library support -;; * Basic completions of objects in current buffer - -;;; Code: - -(require 'js2-mode) -(require 'skewer-mode) -(require 'cl-lib) -(require 'etags) - -(defgroup ac-js2 nil - "Auto-completion for js2-mode." - :group 'completion - :prefix "ac-js2-") - -;;; Configuration variables - -(defcustom ac-js2-add-ecma-262-externs t - "If non-nil add `js2-ecma-262-externs' to completion candidates.") - -(defcustom ac-js2-add-browser-externs t - "If non-nil add `js2-browser-externs' to completion candidates.") - -(defcustom ac-js2-add-keywords t - "If non-nil add `js2-keywords' to completion candidates.") - -(defcustom ac-js2-add-prototype-completions t - "When non-nil traverse the prototype chain adding to completion candidates.") - -(defcustom ac-js2-external-libraries '() - "List of absolute paths to external Javascript libraries.") - -(defcustom ac-js2-evaluate-calls nil - "Warning. When true function calls will be evaluated in the browser. -This may cause undesired side effects however it will - provide better completions. Use at your own risk.") - -(defcustom ac-js2-force-reparse t - "Force Js2-mode to reparse buffer before fetching completion candidates.") - -;;; Internal variables - -(defvar ac-js2-keywords '() - "Cached string version of `js2-keywords'.") - -(defvar ac-js2-candidates '()) - -;; Types of skewer completion methods available -(defconst ac-js2-method-eval 0) -(defconst ac-js2-method-global 1 - "Return candidates for the global object. -Only keys of the object are returned as the other properties come - from js2-mode's externs.") - -(defvar ac-js2-data-root (file-name-directory load-file-name) - "Location of data files needed for `ac-js2-on-skewer-load'.") - -;;; Skewer integration - -(defvar ac-js2-skewer-candidates '() - "Cadidates obtained from skewering.") - -(defun ac-js2-on-skewer-load () - "Inject skewer addon and evaluate external libraries in browser." - (insert-file-contents (expand-file-name "skewer-addon.js" ac-js2-data-root)) - (and ac-js2-evaluate-calls - (mapcar (lambda (library) - (with-temp-buffer - (insert-file-contents (expand-file-name library)) - (skewer-eval (buffer-string) - nil - :type "complete"))) ac-js2-external-libraries))) - -(defun ac-js2-skewer-completion-candidates () - "Get completions returned from skewer." - (mapcar (lambda (candidate) (symbol-name (car candidate))) ac-js2-skewer-candidates)) - -(defun ac-js2-skewer-document-candidates (name) - "Return document string for NAME from skewer." - (let ((doc (cdr (assoc-string name ac-js2-skewer-candidates)))) - (or (ac-js2-format-function doc) doc))) - -(defun ac-js2-get-object-properties (name) - "Find properties of NAME for completion." - (ac-js2-skewer-eval-wrapper name `((prototypes . ,ac-js2-add-prototype-completions)))) - -(defun ac-js2-skewer-result-callback (result) - "Process the RESULT passed from the browser." - (let ((value (cdr (assoc 'value result)))) - (if (and (skewer-success-p result) value) - (setq ac-js2-skewer-candidates (append value nil))))) - -(defun ac-js2-skewer-eval-wrapper (str &optional extras) - "Wrap `skewer-eval-synchronously' to check if a skewer-client is avilable. -STR is the text to send to the browser for evaluation. Extra -parameters can be passed to the browser using EXTRAS. EXTRAS must -be of the form (param-string . value) where param-string is the -reference and value is the value that can be retrieved from the -request object in Javacript." - (setq ac-js2-skewer-candidates nil) - (if skewer-clients - (if (or ac-js2-evaluate-calls - (not (ac-js2-has-function-calls str))) - (ac-js2-skewer-result-callback - (skewer-eval-synchronously str - :type "complete" - :extra extras))) - (setq skewer-queue nil))) - -;; Generate candidates -(defun ac-js2-candidates () - "Main function called to gather candidates for auto-completion." - (if ac-js2-force-reparse (js2-reparse)) - (let ((node (js2-node-parent (js2-node-at-point (1- (point))))) - beg - (prop-get-regex "[a-zA-Z)]\\.") - name) - (setq ac-js2-candidates nil) - (cond - ((looking-back "\\.") - ;; TODO: Need to come up with a better way to extract object than this regex!! - (save-excursion - (setq beg (and (skip-chars-backward "[a-zA-Z_$][0-9a-zA-Z_$#\"())]+\\.") (point)))) - (setq name (buffer-substring-no-properties beg (1- (point)))) - (ac-js2-get-object-properties name) - (setq node (ac-js2-initialized-node (if (string-match prop-get-regex name) - (reverse (split-string name prop-get-regex)) name))) - (if (js2-object-node-p node) - (setq ac-js2-candidates - (mapcar (lambda (elem) - (ac-js2-format-node (js2-node-string (js2-object-prop-node-left elem)) - elem)) - (js2-object-node-elems node)))) - (append (mapcar 'first ac-js2-candidates) - (ac-js2-skewer-completion-candidates))) - ((js2-prop-get-node-p node) - (setq node (js2-prop-get-node-left node)) - (setq name (js2-node-string node)) - (ac-js2-get-object-properties name) - (ac-js2-skewer-completion-candidates)) - (t - (ac-js2-skewer-eval-wrapper "" `((method . ,ac-js2-method-global))) - (append (ac-js2-skewer-completion-candidates) - (ac-js2-add-extra-completions - (mapcar 'first (ac-js2-get-names-in-scope)))))))) - -(defun ac-js2-document (name) - "Show documentation for NAME from local buffer if present -otherwise use documentation obtained from skewer." - (let* ((docs (cdr (assoc name ac-js2-candidates))) - (doc (if (listp docs) (first docs) docs))) - (if doc doc (ac-js2-skewer-document-candidates name)))) - -;; Auto-complete settings - -(defun ac-js2-ac-candidates () - "Completion candidates for auto-complete mode." - (ac-js2-candidates)) - -(defun ac-js2-ac-document (name) - "Documentation to be shown for auto-complete mode." - (ac-js2-document name)) - -(defun ac-js2-ac-prefix() - (or (ac-prefix-default) (ac-prefix-c-dot))) - -(defun ac-js2-save () - "Called on `before-save-hook' to evaluate buffer." - (interactive) - (when (string= major-mode "js2-mode") - (ac-js2-skewer-eval-wrapper (buffer-string))) - t) - -;;;###autoload -(defun ac-js2-expand-function() - "Expand the function definition left of point. -Expansion will only occur for candidates whose documentation -string contain a function prototype." - (interactive) - (let* ((word (progn - (if (featurep 'auto-complete) (ac-complete)) - (substring-no-properties (or (thing-at-point 'word) "")))) - (candidate (ac-js2-ac-document word))) - (if (and (looking-back word) (stringp candidate)) - (when (string-match "^function" candidate) - (cond ((featurep 'yasnippet) - (yas-expand-snippet - (concat "(" - (replace-regexp-in-string "\\([a-zA-Z0-9]+\\)" - (lambda (txt) (concat "${" txt "}")) - (second (split-string candidate "[()]"))) - ")$0")))))))) - -(defun ac-js2-setup-auto-complete-mode () - "Setup ac-js2 to be used with auto-complete-mode." - (add-to-list 'ac-sources 'ac-source-js2) - (auto-complete-mode) - (ac-define-source "js2" - '((candidates . ac-js2-ac-candidates) - (document . ac-js2-ac-document) - (prefix . ac-js2-ac-prefix) - (requires . -1)))) - -;;; Completion at point function - -;;;###autoload -(defun ac-js2-completion-function () - "Function for `completions-at-point'." - (save-excursion - (let ((bounds (if (looking-back "\\.") - (cons (point) (point)) - (bounds-of-thing-at-point 'word)))) - (list (car bounds) (cdr bounds) (ac-js2-candidates))))) - -;;; Company - -;;;###autoload -(defun ac-js2-company (command &optional arg &rest ignored) - (interactive (list 'interactive)) - (if (not (featurep 'company)) - (message "Company is not installed") - (case command - (interactive (company-begin-backend 'ac-js2-company)) - (prefix (when ac-js2-mode - (or (company-grab-symbol) - 'stop))) - (candidates (all-completions arg (ac-js2-candidates))) - (duplicates t) - (meta (let ((doc (ac-js2-document arg))) - (when doc - (with-temp-buffer - (insert doc) - (js-mode) - (font-lock-ensure) - (buffer-string)))))))) - -;;; Helper functions - -(defun ac-js2-build-prop-name-list (prop-node) - "Build a list of names from a PROP-NODE." - (let* (names - left - left-node) - (unless (js2-prop-get-node-p prop-node) - (error "Node is not a property prop-node")) - (while (js2-prop-get-node-p prop-node) - (push (js2-name-node-name (js2-prop-get-node-right prop-node)) names) - (setq left-node (js2-prop-get-node-left prop-node)) - (when (js2-name-node-p left-node) - (setq left (js2-name-node-name left-node))) - (setq prop-node (js2-node-parent prop-node))) - (append names `(,left)))) - -(defun ac-js2-prop-names-left (name-node) - "Create a list of all of the names in the property NAME-NODE. -NAME-NODE must have a js2-prop-get-node as parent. Only adds -properties to the left of point. This is so individual jump -points can be found for each property in the chain." - (let* (name - (parent (js2-node-parent name-node)) - left - names) - (unless (or (js2-prop-get-node-p parent) (js2-name-node-p name-node)) - (error "Not a name node or doesn't have a prop-get-node as parent")) - (setq name (js2-name-node-name name-node) - left (js2-prop-get-node-left parent)) - (if (and (js2-name-node-p left) - (string= name (js2-name-node-name left))) - (setq names name) - (js2-visit-ast - parent - (lambda (node endp) - (unless endp - (if (js2-name-node-p node) - (push (js2-name-node-name node) names) - t)))) - names))) - -(defun ac-js2-has-function-calls (string) - "Check if the Javascript code in STRING has a Js2-call-node." - (with-temp-buffer - (insert string) - (let* ((ast (js2-parse))) - (catch 'call-node - (js2-visit-ast-root - ast - (lambda (node end-p) - (unless end-p - (if (js2-call-node-p node) - (throw 'call-node t) - t)))))))) - -(defun ac-js2-add-extra-completions (completions) - "Add extra candidates to COMPLETIONS." - (append completions - (if ac-js2-add-keywords (or ac-js2-keywords (setq ac-js2-keywords (mapcar 'symbol-name js2-keywords)))) - (if ac-js2-add-ecma-262-externs js2-ecma-262-externs) - (if ac-js2-add-browser-externs js2-browser-externs))) - -(defun ac-js2-root-or-node () - "Return the current node or js2-ast-root node." - (let ((node (js2-node-at-point))) - (if (js2-ast-root-p node) - node - (js2-node-get-enclosing-scope node)))) - -(defun ac-js2-get-names-in-scope () - "Fetches all symbols in scope and formats them for completion." - (let* ((scope (ac-js2-root-or-node)) - result) - (while scope - (setq result (append result - (loop for item in (js2-scope-symbol-table scope) - if (not (assoc (car item) result)) - collect item))) - (setq scope (js2-scope-parent-scope scope))) - (setq ac-js2-candidates - (mapcar #'(lambda (x) - (let* ((name (symbol-name (car x))) - (init (ac-js2-initialized-node name))) - (ac-js2-format-node name init))) - result)))) - -(defun ac-js2-initialized-node (name) - "Return initial value assigned to NAME. -NAME may be either a variable, a function or a variable that -holds a function. NAME may also be a list of names that make up a -object property. Returns nil if no initial value can be found." - (let* ((node (if (listp name) (ac-js2-find-property name) - (ac-js2-name-declaration name))) - (parent (if node (js2-node-parent node))) - (init (cond - ((js2-function-node-p parent) - parent) - ((js2-function-node-p node) - node) - ((js2-var-init-node-p parent) - (js2-var-init-node-initializer parent)) - ((js2-assign-node-p parent) - (js2-assign-node-right parent)) - (t - nil)))) - init)) - -(defun ac-js2-name-declaration (name) - "Return the declaration node for node named NAME." - (let* ((node (ac-js2-root-or-node)) - (scope-def (js2-get-defining-scope node name)) - (scope (if scope-def (js2-scope-get-symbol scope-def name) nil)) - (symbol (if scope (js2-symbol-ast-node scope) nil))) - (if (not symbol) - (ac-js2-get-function-node name scope-def) - symbol))) - -;;; Completion candidate formatting - -(defun ac-js2-format-node (name node) - "Format NAME and NODE for completion. -Returned format is a list where the first element is the NAME of -the node (shown in completion candidate list) and the last -element is the text to show as documentation." - (let ((node (if (js2-object-prop-node-p node) (js2-object-prop-node-right node) node)) - (name-format (replace-regexp-in-string "\"" "" name)) - (doc (if (and (js2-function-node-p node) - (cl-find name (js2-function-node-params node) - :test '(lambda (name param) (string= name (js2-name-node-name param))))) - "Function parameter" - (ac-js2-format-node-doc node)))) - `(,name-format . ,doc))) - -(defun ac-js2-format-object-node-doc (obj-node) - "Format OBJ-NODE to display as documentation." - (let (elems) - (unless (js2-object-node-p obj-node) - (error "Node is not an object node")) - (setq elems (js2-object-node-elems obj-node)) - (if (not elems) - "{}" - (mapconcat #'(lambda (x) (ac-js2-format-js2-object-prop-doc x)) elems "\n")))) - -(defun ac-js2-format-node-doc (node) - "Format NODE for displaying in a document string." - (let* ((node-above (and node (js2-node-at-point - (save-excursion - (goto-char (js2-node-abs-pos node)) - (forward-line -1) - (point))))) - (comment (if (js2-comment-node-p node-above) - (ac-js2-format-comment (js2-node-string node-above)))) - (doc (cond - ((js2-function-node-p node) - (ac-js2-format-function node)) - ((js2-object-node-p node) - (ac-js2-format-object-node-doc node)) - ((js2-object-prop-node-p node) - (ac-js2-format-node-doc (js2-object-prop-node-right node))) - (t - (if (js2-node-p node) (js2-node-string node) ""))))) - (if comment (concat comment "\n" doc) doc))) - -(defun ac-js2-format-js2-object-prop-doc (obj-prop) - "Format an OBJ-PROP for displaying as a document string." - (unless (js2-object-prop-node-p obj-prop) - (error "Node is not an object property node")) - (let* ((left (js2-object-prop-node-left obj-prop)) - (right (js2-object-prop-node-right obj-prop))) - (concat (js2-node-string left) " : " - (ac-js2-format-node-doc right)))) - -(defun ac-js2-format-function (func) - "Formats a function for a document string. -FUNC can be either a function node or a string starting with -'function'. Returns nil if neither." - (let ((str (or (and (js2-function-node-p func) (js2-node-string func)) - (and (stringp func) (eq 0 (string-match "function" func)) func)))) - (if str (substring str 0 (1+ (string-match ")" str)))))) - -(defun ac-js2-format-comment (comment) - "Prepare a COMMENT node for displaying in a popup." - (let* ((node-string (if (js2-comment-node-p comment) - (js2-node-string comment) - comment)) - (string (replace-regexp-in-string "[ \t]$" "" - (replace-regexp-in-string "^[ \t\n*/*]+" "" node-string)))) - string)) - -;;; Navigation commands for js2-mode - -(defun ac-js2-find-property (list-names) - "Find the property definition that consists of LIST-NAMES. -Supports navigation to 'foo.bar = 3' and 'foo = {bar: 3}'." - (catch 'prop-found - (js2-visit-ast-root - js2-mode-ast - (lambda (node endp) - (let ((parent (js2-node-parent node))) - (unless endp - (if (or (and (js2-prop-get-node-p node) - (not (or (js2-elem-get-node-p parent) (js2-call-node-p parent))) - (equal list-names (ac-js2-build-prop-name-list node))) - (and (js2-name-node-p node) - (js2-object-prop-node-p parent) - (string= (js2-name-node-name node) - (first list-names)))) - (throw 'prop-found node)) - t)))))) - -(defun ac-js2-get-function-node (name scope) - "Return node of function named NAME in SCOPE." - (catch 'function-found - (js2-visit-ast - scope - (lambda (node end-p) - (when (and (not end-p) - (string= name (ac-js2-get-function-name node))) - (throw 'function-found node)) - t)) - nil)) - -;;;###autoload -(defun ac-js2-jump-to-definition () - "Jump to the definition of an object's property, variable or function. -Navigation to a property definend in an Object literal isn't -implemented." - (interactive) - (ring-insert find-tag-marker-ring (point-marker)) - (let* ((node (js2-node-at-point)) - (parent (js2-node-parent node)) - (prop-names (if (js2-prop-get-node-p parent) - (ac-js2-prop-names-left node))) - (name (if (and (js2-name-node-p node) - (not (js2-object-prop-node-p parent))) - (js2-name-node-name node) - (error "Node is not a supported jump node"))) - (node-init (if (and prop-names (listp prop-names)) - (ac-js2-find-property prop-names) - (ac-js2-name-declaration name)))) - (unless node-init - (pop-tag-mark) - (error "No jump location found")) - (goto-char (js2-node-abs-pos node-init)))) - -(defun ac-js2-get-function-name (fn-node) - "Return the name of the function FN-NODE. -Value may be either function name or the variable name that holds -the function." - (let ((parent (js2-node-parent fn-node))) - (if (js2-function-node-p fn-node) - (or (js2-function-name fn-node) - (if (js2-var-init-node-p parent) - (js2-name-node-name (js2-var-init-node-target parent))))))) - -(defvar ac-js2-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "M-.") 'ac-js2-jump-to-definition) - (define-key map (kbd "M-,") 'pop-tag-mark) - (define-key map (kbd "C-c C-c") 'ac-js2-expand-function) - map) - "Keymap for `ac-js2-mode'.") - -;;; Minor mode - -;;;###autoload -(define-minor-mode ac-js2-mode - "A minor mode that provides auto-completion and navigation for Js2-mode." - :keymap ac-js2-mode-map - (if (featurep 'auto-complete) - (ac-js2-setup-auto-complete-mode)) - (set (make-local-variable 'completion-at-point-functions) - (cons 'ac-js2-completion-function completion-at-point-functions)) - (ac-js2-skewer-eval-wrapper (buffer-string)) - (add-hook 'before-save-hook 'ac-js2-save nil t) - (add-hook 'skewer-js-hook 'ac-js2-on-skewer-load)) - - -(provide 'ac-js2) - -;;; ac-js2.el ends here diff --git a/emacs.d/elpa/ac-js2-20140906.442/skewer-addon.js b/emacs.d/elpa/ac-js2-20140906.442/skewer-addon.js deleted file mode 100644 index 8e2b5a1..0000000 --- a/emacs.d/elpa/ac-js2-20140906.442/skewer-addon.js +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @fileOverview Completion request handler for skewer.js - * @requires skewer - * @version 1.0 - */ - -/** - * Handles a completion request from Emacs. - * @param request The request object sent by Emacs - * @returns The completions and init values to be returned to Emacs - */ -skewer.fn.complete = function(request) { - var result = { - type : request.type, - id : request.id, - strict : request.strict, - status : "success" - }, - - /** - * Methods for generating candidates - */ - METHOD = { - EVAL : 0, - GLOBAL : 1 - }, - - /** - * Add the properties from object to extendObject. Properties - * may be from the prototype but we still want to add them. - */ - extend = function(extendObject, object) { - for(var key in object) { - extendObject[key] = object[key]; - } - }, - - globalCompletion = function() { - var global = Function('return this')(), - keys = Object.keys(global); - candidates = buildCandidates(global, keys); - }, - - evalCompletion = function(evalObject) { - var obj = (eval, eval)(evalObject); - if (typeof obj === "object") { - candidates = buildCandidates(obj) || {}; - while (request.prototypes && (obj = Object.getPrototypeOf(obj)) !== null) { - extend(candidates, buildCandidates(obj)); - } - } else if (typeof obj === "function"){ - candidates = buildCandidates(obj) || {}; - extend(candidates, buildCandidates(Object.getPrototypeOf(obj))); - if (request.prototypes) { - var protoObject = Object.getPrototypeOf(obj.prototype); - if (protoObject !== null) { - extend(candidates, buildCandidates(protoObject)); - } else { - extend(candidates, buildCandidates(obj.prototype)); - } - } - } - }, - - /** - * Completion candidates sent back to Emacs. Keys are - * completion candidates the values are the inital items or - * function interfaces. - */ - candidates = {}, - - /** - * Build the candiates to return to Emacs. - * @param obj The object to get candidates from - * @param items The selected keys from obj to create candidates for - * @return object containing completion candidates and documentation strings - */ - buildCandidates = function(obj, items) { - var keys = items || Object.getOwnPropertyNames(obj), values = {}; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key === "callee" || key === "caller" || key === "arguments") continue; - if (Object.prototype.toString.call(obj[key]) === "[object Function]") { - values[key] = obj[key].toString(); - } else if (typeof obj[key] === "object"){ - values[key] = "[object Object]"; - } else if (typeof obj[key] === "number") { - if (!(obj instanceof Array)) { - values[key] = obj[key].toString(); - } - } else if (typeof obj[key] === "string") { - values[key] = obj[key].toString(); - } else if(obj[key] === true) { - values[key] = "true"; - } else if (obj[key] === false) { - values[key] = "false"; - } else { - values[key] = ""; - } - } - return values; - }; - try { - switch (request.method) { - case METHOD.GLOBAL: - globalCompletion(); - break; - default: - evalCompletion(request.eval); - } - result.value = candidates; - } catch (error){ - skewer.errorResult(error, result, request); - } - return result; -}; diff --git a/emacs.d/elpa/company-20160117.321/company-abbrev.el b/emacs.d/elpa/company-20160117.321/company-abbrev.el deleted file mode 100644 index 24ec3b7..0000000 --- a/emacs.d/elpa/company-20160117.321/company-abbrev.el +++ /dev/null @@ -1,50 +0,0 @@ -;;; company-abbrev.el --- company-mode completion backend for abbrev - -;; Copyright (C) 2009-2011, 2015 Free Software Foundation, Inc. - -;; Author: Nikolaj Schumacher - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - - -;;; Commentary: -;; - -;;; Code: - -(require 'company) -(require 'cl-lib) -(require 'abbrev) - -(defun company-abbrev-insert (match) - "Replace MATCH with the expanded abbrev." - (expand-abbrev)) - -;;;###autoload -(defun company-abbrev (command &optional arg &rest ignored) - "`company-mode' completion backend for abbrev." - (interactive (list 'interactive)) - (cl-case command - (interactive (company-begin-backend 'company-abbrev - 'company-abbrev-insert)) - (prefix (company-grab-symbol)) - (candidates (nconc - (delete "" (all-completions arg global-abbrev-table)) - (delete "" (all-completions arg local-abbrev-table)))) - (meta (abbrev-expansion arg)))) - -(provide 'company-abbrev) -;;; company-abbrev.el ends here diff --git a/emacs.d/elpa/company-20160117.321/company-autoloads.el b/emacs.d/elpa/company-20160117.321/company-autoloads.el deleted file mode 100644 index b5f9a9e..0000000 --- a/emacs.d/elpa/company-20160117.321/company-autoloads.el +++ /dev/null @@ -1,284 +0,0 @@ -;;; company-autoloads.el --- automatically extracted autoloads -;; -;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) - -;;;### (autoloads nil "company" "company.el" (22171 46580 0 0)) -;;; Generated autoloads from company.el - -(autoload 'company-mode "company" "\ -\"complete anything\"; is an in-buffer completion framework. -Completion starts automatically, depending on the values -`company-idle-delay' and `company-minimum-prefix-length'. - -Completion can be controlled with the commands: -`company-complete-common', `company-complete-selection', `company-complete', -`company-select-next', `company-select-previous'. If these commands are -called before `company-idle-delay', completion will also start. - -Completions can be searched with `company-search-candidates' or -`company-filter-candidates'. These can be used while completion is -inactive, as well. - -The completion data is retrieved using `company-backends' and displayed -using `company-frontends'. If you want to start a specific backend, call -it interactively or use `company-begin-backend'. - -By default, the completions list is sorted alphabetically, unless the -backend chooses otherwise, or `company-transformers' changes it later. - -regular keymap (`company-mode-map'): - -\\{company-mode-map} -keymap during active completions (`company-active-map'): - -\\{company-active-map} - -\(fn &optional ARG)" t nil) - -(defvar global-company-mode nil "\ -Non-nil if Global-Company mode is enabled. -See the command `global-company-mode' for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `global-company-mode'.") - -(custom-autoload 'global-company-mode "company" nil) - -(autoload 'global-company-mode "company" "\ -Toggle Company mode in all buffers. -With prefix ARG, enable Global-Company mode if ARG is positive; -otherwise, disable it. If called from Lisp, enable the mode if -ARG is omitted or nil. - -Company mode is enabled in all buffers where -`company-mode-on' would do it. -See `company-mode' for more information on Company mode. - -\(fn &optional ARG)" t nil) - -;;;*** - -;;;### (autoloads nil "company-abbrev" "company-abbrev.el" (22171 -;;;;;; 46580 0 0)) -;;; Generated autoloads from company-abbrev.el - -(autoload 'company-abbrev "company-abbrev" "\ -`company-mode' completion backend for abbrev. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-bbdb" "company-bbdb.el" (22171 46580 -;;;;;; 0 0)) -;;; Generated autoloads from company-bbdb.el - -(autoload 'company-bbdb "company-bbdb" "\ -`company-mode' completion backend for BBDB. - -\(fn COMMAND &optional ARG &rest IGNORE)" t nil) - -;;;*** - -;;;### (autoloads nil "company-css" "company-css.el" (22171 46580 -;;;;;; 0 0)) -;;; Generated autoloads from company-css.el - -(autoload 'company-css "company-css" "\ -`company-mode' completion backend for `css-mode'. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-dabbrev" "company-dabbrev.el" (22171 -;;;;;; 46580 0 0)) -;;; Generated autoloads from company-dabbrev.el - -(autoload 'company-dabbrev "company-dabbrev" "\ -dabbrev-like `company-mode' completion backend. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-dabbrev-code" "company-dabbrev-code.el" -;;;;;; (22171 46580 0 0)) -;;; Generated autoloads from company-dabbrev-code.el - -(autoload 'company-dabbrev-code "company-dabbrev-code" "\ -dabbrev-like `company-mode' backend for code. -The backend looks for all symbols in the current buffer that aren't in -comments or strings. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-elisp" "company-elisp.el" (22171 46580 -;;;;;; 0 0)) -;;; Generated autoloads from company-elisp.el - -(autoload 'company-elisp "company-elisp" "\ -`company-mode' completion backend for Emacs Lisp. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-etags" "company-etags.el" (22171 46580 -;;;;;; 0 0)) -;;; Generated autoloads from company-etags.el - -(autoload 'company-etags "company-etags" "\ -`company-mode' completion backend for etags. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-files" "company-files.el" (22171 46580 -;;;;;; 0 0)) -;;; Generated autoloads from company-files.el - -(autoload 'company-files "company-files" "\ -`company-mode' completion backend existing file names. -Completions works for proper absolute and relative files paths. -File paths with spaces are only supported inside strings. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-gtags" "company-gtags.el" (22171 46580 -;;;;;; 0 0)) -;;; Generated autoloads from company-gtags.el - -(autoload 'company-gtags "company-gtags" "\ -`company-mode' completion backend for GNU Global. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-ispell" "company-ispell.el" (22171 -;;;;;; 46580 0 0)) -;;; Generated autoloads from company-ispell.el - -(autoload 'company-ispell "company-ispell" "\ -`company-mode' completion backend using Ispell. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-keywords" "company-keywords.el" (22171 -;;;;;; 46580 0 0)) -;;; Generated autoloads from company-keywords.el - -(autoload 'company-keywords "company-keywords" "\ -`company-mode' backend for programming language keywords. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-nxml" "company-nxml.el" (22171 46580 -;;;;;; 0 0)) -;;; Generated autoloads from company-nxml.el - -(autoload 'company-nxml "company-nxml" "\ -`company-mode' completion backend for `nxml-mode'. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-oddmuse" "company-oddmuse.el" (22171 -;;;;;; 46580 0 0)) -;;; Generated autoloads from company-oddmuse.el - -(autoload 'company-oddmuse "company-oddmuse" "\ -`company-mode' completion backend for `oddmuse-mode'. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-semantic" "company-semantic.el" (22171 -;;;;;; 46580 0 0)) -;;; Generated autoloads from company-semantic.el - -(autoload 'company-semantic "company-semantic" "\ -`company-mode' completion backend using CEDET Semantic. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-tempo" "company-tempo.el" (22171 46580 -;;;;;; 0 0)) -;;; Generated autoloads from company-tempo.el - -(autoload 'company-tempo "company-tempo" "\ -`company-mode' completion backend for tempo. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-xcode" "company-xcode.el" (22171 46580 -;;;;;; 0 0)) -;;; Generated autoloads from company-xcode.el - -(autoload 'company-xcode "company-xcode" "\ -`company-mode' completion backend for Xcode projects. - -\(fn COMMAND &optional ARG &rest IGNORED)" t nil) - -;;;*** - -;;;### (autoloads nil "company-yasnippet" "company-yasnippet.el" -;;;;;; (22171 46580 0 0)) -;;; Generated autoloads from company-yasnippet.el - -(autoload 'company-yasnippet "company-yasnippet" "\ -`company-mode' backend for `yasnippet'. - -This backend should be used with care, because as long as there are -snippets defined for the current major mode, this backend will always -shadow backends that come after it. Recommended usages: - -* In a buffer-local value of `company-backends', grouped with a backend or - several that provide actual text completions. - - (add-hook 'js-mode-hook - (lambda () - (set (make-local-variable 'company-backends) - '((company-dabbrev-code company-yasnippet))))) - -* After keyword `:with', grouped with other backends. - - (push '(company-semantic :with company-yasnippet) company-backends) - -* Not in `company-backends', just bound to a key. - - (global-set-key (kbd \"C-c y\") 'company-yasnippet) - -\(fn COMMAND &optional ARG &rest IGNORE)" t nil) - -;;;*** - -;;;### (autoloads nil nil ("company-capf.el" "company-clang.el" "company-cmake.el" -;;;;;; "company-eclim.el" "company-pkg.el" "company-template.el") -;;;;;; (22171 46580 491198 0)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: -;;; company-autoloads.el ends here diff --git a/emacs.d/elpa/company-20160117.321/company-bbdb.el b/emacs.d/elpa/company-20160117.321/company-bbdb.el deleted file mode 100644 index 36307d0..0000000 --- a/emacs.d/elpa/company-20160117.321/company-bbdb.el +++ /dev/null @@ -1,61 +0,0 @@ -;;; company-bbdb.el --- company-mode completion backend for BBDB in message-mode - -;; Copyright (C) 2013-2014, 2016 Free Software Foundation, Inc. - -;; Author: Jan Tatarik - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -(require 'company) -(require 'cl-lib) - -(declare-function bbdb-record-get-field "bbdb") -(declare-function bbdb-records "bbdb") -(declare-function bbdb-dwim-mail "bbdb-com") -(declare-function bbdb-search "bbdb-com") - -(defgroup company-bbdb nil - "Completion backend for BBDB." - :group 'company) - -(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)) - (bbdb-record-get-field record 'mail))) - (eval '(bbdb-search (bbdb-records) arg nil arg)))) - -;;;###autoload -(defun company-bbdb (command &optional arg &rest ignore) - "`company-mode' completion backend for BBDB." - (interactive (list 'interactive)) - (cl-case command - (interactive (company-begin-backend 'company-bbdb)) - (prefix (and (memq major-mode company-bbdb-modes) - (featurep 'bbdb-com) - (looking-back "^\\(To\\|Cc\\|Bcc\\): *.*?\\([^,; ]*\\)" - (line-beginning-position)) - (match-string-no-properties 2))) - (candidates (company-bbdb--candidates arg)) - (sorted t) - (no-cache t))) - -(provide 'company-bbdb) -;;; company-bbdb.el ends here diff --git a/emacs.d/elpa/company-20160117.321/company-capf.el b/emacs.d/elpa/company-20160117.321/company-capf.el deleted file mode 100644 index 6554782..0000000 --- a/emacs.d/elpa/company-20160117.321/company-capf.el +++ /dev/null @@ -1,170 +0,0 @@ -;;; company-capf.el --- company-mode completion-at-point-functions backend -*- lexical-binding: t -*- - -;; Copyright (C) 2013-2016 Free Software Foundation, Inc. - -;; Author: Stefan Monnier - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - - -;;; Commentary: -;; - -;;; Code: - -(require 'company) -(require 'cl-lib) - -(defvar company--capf-cache nil) - -(defun company--capf-data () - (let ((cache company--capf-cache)) - (if (and (equal (current-buffer) (car cache)) - (equal (point) (car (setq cache (cdr cache)))) - (equal (buffer-chars-modified-tick) (car (setq cache (cdr cache))))) - (cadr cache) - (let ((data (company--capf-data-real))) - (setq company--capf-cache - (list (current-buffer) (point) (buffer-chars-modified-tick) data)) - data)))) - -(defun company--capf-data-real () - (cl-letf* (((default-value 'completion-at-point-functions) - ;; Ignore tags-completion-at-point-function because it subverts - ;; company-etags in the default value of company-backends, where - ;; the latter comes later. - (remove 'tags-completion-at-point-function - (default-value 'completion-at-point-functions))) - (completion-at-point-functions (company--capf-workaround)) - (data (run-hook-wrapped 'completion-at-point-functions - ;; Ignore misbehaving functions. - #'completion--capf-wrapper 'optimist))) - (when (and (consp (cdr data)) (integer-or-marker-p (nth 1 data))) data))) - -(declare-function python-shell-get-process "python") - -(defun company--capf-workaround () - ;; For http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18067 - (if (or (not (listp completion-at-point-functions)) - (not (memq 'python-completion-complete-at-point completion-at-point-functions)) - (python-shell-get-process)) - completion-at-point-functions - (remq 'python-completion-complete-at-point completion-at-point-functions))) - -(defun company-capf (command &optional arg &rest _args) - "`company-mode' backend using `completion-at-point-functions'." - (interactive (list 'interactive)) - (pcase command - (`interactive (company-begin-backend 'company-capf)) - (`prefix - (let ((res (company--capf-data))) - (when res - (let* ((f (plist-get (nthcdr 4 res) :company-prefix-length)) - (beg (nth 1 res)) - (end (nth 2 res)) - (length (and f (funcall f beg (point)))) - (prefix (buffer-substring-no-properties beg (point)))) - (cond - ((> end (point)) 'stop) - (length (cons prefix length)) - (t prefix)))))) - (`candidates - (let ((res (company--capf-data))) - (when res - (let* ((table (nth 3 res)) - (pred (plist-get (nthcdr 4 res) :predicate)) - (meta (completion-metadata - (buffer-substring (nth 1 res) (nth 2 res)) - table pred)) - (sortfun (cdr (assq 'display-sort-function meta))) - (candidates (completion-all-completions arg table pred (length arg))) - (last (last candidates)) - (base-size (and (numberp (cdr last)) (cdr last)))) - (when base-size - (setcdr last nil)) - (when sortfun - (setq candidates (funcall sortfun candidates))) - (if (not (zerop (or base-size 0))) - (let ((before (substring arg 0 base-size))) - (mapcar (lambda (candidate) - (concat before candidate)) - candidates)) - candidates))))) - (`sorted - (let ((res (company--capf-data))) - (when res - (let ((meta (completion-metadata - (buffer-substring (nth 1 res) (nth 2 res)) - (nth 3 res) (plist-get (nthcdr 4 res) :predicate)))) - (cdr (assq 'display-sort-function meta)))))) - (`match - ;; Can't just use 0 when base-size (see above) is non-zero. - (let ((start (if (get-text-property 0 'font-lock-face arg) - 0 - (next-single-property-change 0 'font-lock-face arg)))) - (when start - ;; completions-common-part comes first, but we can't just look for this - ;; value because it can be in a list. - (or - (let ((value (get-text-property start 'font-lock-face arg))) - (text-property-not-all start (length arg) - 'font-lock-face value arg)) - (length arg))))) - (`duplicates t) - (`no-cache t) ;Not much can be done here, as long as we handle - ;non-prefix matches. - (`meta - (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-docsig))) - (when f (funcall f arg)))) - (`doc-buffer - (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-doc-buffer))) - (when f (funcall f arg)))) - (`location - (let ((f (plist-get (nthcdr 4 (company--capf-data)) :company-location))) - (when f (funcall f arg)))) - (`annotation - (save-excursion - ;; FIXME: `company-begin' sets `company-point' after calling - ;; `company--begin-new'. We shouldn't rely on `company-point' here, - ;; better to cache the capf-data value instead. However: we can't just - ;; save the last capf-data value in `prefix', because that command can - ;; get called more often than `candidates', and at any point in the - ;; buffer (https://github.com/company-mode/company-mode/issues/153). - ;; We could try propertizing the returned prefix string, but it's not - ;; passed to `annotation', and `company-prefix' is set only after - ;; `company--strip-duplicates' is called. - (when company-point - (goto-char company-point)) - (let ((f (plist-get (nthcdr 4 (company--capf-data)) :annotation-function))) - (when f (funcall f arg))))) - (`require-match - (plist-get (nthcdr 4 (company--capf-data)) :company-require-match)) - (`init nil) ;Don't bother: plenty of other ways to initialize the code. - (`post-completion - (let* ((res (company--capf-data)) - (exit-function (plist-get (nthcdr 4 res) :exit-function)) - (table (nth 3 res)) - (pred (plist-get (nthcdr 4 res) :predicate))) - (if exit-function - ;; Follow the example of `completion--done'. - (funcall exit-function arg - (if (eq (try-completion arg table pred) t) - 'finished 'sole))))) - )) - -(provide 'company-capf) - -;;; company-capf.el ends here diff --git a/emacs.d/elpa/company-20160117.321/company-clang.el b/emacs.d/elpa/company-20160117.321/company-clang.el deleted file mode 100644 index 54d4b9b..0000000 --- a/emacs.d/elpa/company-20160117.321/company-clang.el +++ /dev/null @@ -1,331 +0,0 @@ -;;; company-clang.el --- company-mode completion backend for Clang -*- lexical-binding: t -*- - -;; Copyright (C) 2009, 2011, 2013-2016 Free Software Foundation, Inc. - -;; Author: Nikolaj Schumacher - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - - -;;; Commentary: -;; - -;;; Code: - -(require 'company) -(require 'company-template) -(require 'cl-lib) - -(defgroup company-clang nil - "Completion backend for Clang." - :group 'company) - -(defcustom company-clang-executable - (executable-find "clang") - "Location of clang executable." - :type 'file) - -(defcustom company-clang-begin-after-member-access t - "When non-nil, automatic completion will start whenever the current -symbol is preceded by \".\", \"->\" or \"::\", ignoring -`company-minimum-prefix-length'. - -If `company-begin-commands' is a list, it should include `c-electric-lt-gt' -and `c-electric-colon', for automatic completion right after \">\" and -\":\".") - -(defcustom company-clang-arguments nil - "Additional arguments to pass to clang when completing. -Prefix files (-include ...) can be selected with `company-clang-set-prefix' -or automatically through a custom `company-clang-prefix-guesser'." - :type '(repeat (string :tag "Argument"))) - -(defcustom company-clang-prefix-guesser 'company-clang-guess-prefix - "A function to determine the prefix file for the current buffer." - :type '(function :tag "Guesser function" nil)) - -(defvar company-clang-modes '(c-mode c++-mode objc-mode) - "Major modes which clang may complete.") - -(defcustom company-clang-insert-arguments t - "When non-nil, insert function arguments as a template after completion." - :type 'boolean - :package-version '(company . "0.8.0")) - -;; prefix ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defvar company-clang--prefix nil) - -(defsubst company-clang--guess-pch-file (file) - (let ((dir (directory-file-name (file-name-directory file)))) - (when (equal (file-name-nondirectory dir) "Classes") - (setq dir (file-name-directory dir))) - (car (directory-files dir t "\\([^.]h\\|[^h]\\).pch\\'" t)))) - -(defsubst company-clang--file-substring (file beg end) - (with-temp-buffer - (insert-file-contents-literally file nil beg end) - (buffer-string))) - -(defun company-clang-guess-prefix () - "Try to guess the prefix file for the current buffer." - ;; Prefixes seem to be called .pch. Pre-compiled headers do, too. - ;; So we look at the magic number to rule them out. - (let* ((file (company-clang--guess-pch-file buffer-file-name)) - (magic-number (and file (company-clang--file-substring file 0 4)))) - (unless (member magic-number '("CPCH" "gpch")) - file))) - -(defun company-clang-set-prefix (&optional prefix) - "Use PREFIX as a prefix (-include ...) file for clang completion." - (interactive (let ((def (funcall company-clang-prefix-guesser))) - (unless (stringp def) - (setq def default-directory)) - (list (read-file-name "Prefix file: " - (when def (file-name-directory def)) - def t (when def (file-name-nondirectory def)))))) - ;; TODO: pre-compile? - (setq company-clang--prefix (and (stringp prefix) - (file-regular-p prefix) - prefix))) - -;; Clean-up on exit. -(add-hook 'kill-emacs-hook 'company-clang-set-prefix) - -;; parsing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; TODO: Handle Pattern (syntactic hints would be neat). -;; Do we ever see OVERLOAD (or OVERRIDE)? -(defconst company-clang--completion-pattern - "^COMPLETION: \\_<\\(%s[a-zA-Z0-9_:]*\\)\\(?: : \\(.*\\)$\\)?$") - -(defconst company-clang--error-buffer-name "*clang-error*") - -(defun company-clang--lang-option () - (if (eq major-mode 'objc-mode) - (if (string= "m" (file-name-extension buffer-file-name)) - "objective-c" "objective-c++") - (substring (symbol-name major-mode) 0 -5))) - -(defun company-clang--parse-output (prefix _objc) - (goto-char (point-min)) - (let ((pattern (format company-clang--completion-pattern - (regexp-quote prefix))) - (case-fold-search nil) - lines match) - (while (re-search-forward pattern nil t) - (setq match (match-string-no-properties 1)) - (unless (equal match "Pattern") - (save-match-data - (when (string-match ":" match) - (setq match (substring match 0 (match-beginning 0))))) - (let ((meta (match-string-no-properties 2))) - (when (and meta (not (string= match meta))) - (put-text-property 0 1 'meta - (company-clang--strip-formatting meta) - match))) - (push match lines))) - lines)) - -(defun company-clang--meta (candidate) - (get-text-property 0 'meta candidate)) - -(defun company-clang--annotation (candidate) - (let ((ann (company-clang--annotation-1 candidate))) - (if (not (and ann (string-prefix-p "(*)" ann))) - ann - (with-temp-buffer - (insert ann) - (search-backward ")") - (let ((pt (1+ (point)))) - (re-search-forward ".\\_>" nil t) - (delete-region pt (point))) - (buffer-string))))) - -(defun company-clang--annotation-1 (candidate) - (let ((meta (company-clang--meta candidate))) - (cond - ((null meta) nil) - ((string-match "[^:]:[^:]" meta) - (substring meta (1+ (match-beginning 0)))) - ((string-match "\\((.*)[ a-z]*\\'\\)" meta) - (let ((paren (match-beginning 1))) - (if (not (eq (aref meta (1- paren)) ?>)) - (match-string 1 meta) - (with-temp-buffer - (insert meta) - (goto-char paren) - (substring meta (1- (search-backward "<")))))))))) - -(defun company-clang--strip-formatting (text) - (replace-regexp-in-string - "#]" " " - (replace-regexp-in-string "[<{[]#\\|#[>}]" "" text t) - t)) - -(defun company-clang--handle-error (res args) - (goto-char (point-min)) - (let* ((buf (get-buffer-create company-clang--error-buffer-name)) - (cmd (concat company-clang-executable " " (mapconcat 'identity args " "))) - (pattern (format company-clang--completion-pattern "")) - (err (if (re-search-forward pattern nil t) - (buffer-substring-no-properties (point-min) - (1- (match-beginning 0))) - ;; Warn the user more aggressively if no match was found. - (message "clang failed with error %d:\n%s" res cmd) - (buffer-string)))) - - (with-current-buffer buf - (let ((inhibit-read-only t)) - (erase-buffer) - (insert (current-time-string) - (format "\nclang failed with error %d:\n" res) - cmd "\n\n") - (insert err) - (setq buffer-read-only t) - (goto-char (point-min)))))) - -(defun company-clang--start-process (prefix callback &rest args) - (let ((objc (derived-mode-p 'objc-mode)) - (buf (get-buffer-create "*clang-output*")) - ;; Looks unnecessary in Emacs 25.1 and later. - (process-adaptive-read-buffering nil)) - (if (get-buffer-process buf) - (funcall callback nil) - (with-current-buffer buf - (erase-buffer) - (setq buffer-undo-list t)) - (let ((process (apply #'start-process "company-clang" buf - company-clang-executable args))) - (set-process-sentinel - process - (lambda (proc status) - (unless (string-match-p "hangup" status) - (funcall - callback - (let ((res (process-exit-status proc))) - (with-current-buffer buf - (unless (eq 0 res) - (company-clang--handle-error res args)) - ;; Still try to get any useful input. - (company-clang--parse-output prefix objc))))))) - (unless (company-clang--auto-save-p) - (send-region process (point-min) (point-max)) - (send-string process "\n") - (process-send-eof process)))))) - -(defsubst company-clang--build-location (pos) - (save-excursion - (goto-char pos) - (format "%s:%d:%d" - (if (company-clang--auto-save-p) buffer-file-name "-") - (line-number-at-pos) - (1+ (length - (encode-coding-region - (line-beginning-position) - (point) - 'utf-8 - t)))))) - -(defsubst company-clang--build-complete-args (pos) - (append '("-fsyntax-only" "-Xclang" "-code-completion-macros") - (unless (company-clang--auto-save-p) - (list "-x" (company-clang--lang-option))) - company-clang-arguments - (when (stringp company-clang--prefix) - (list "-include" (expand-file-name company-clang--prefix))) - (list "-Xclang" (format "-code-completion-at=%s" - (company-clang--build-location pos))) - (list (if (company-clang--auto-save-p) buffer-file-name "-")))) - -(defun company-clang--candidates (prefix callback) - (and (company-clang--auto-save-p) - (buffer-modified-p) - (basic-save-buffer)) - (when (null company-clang--prefix) - (company-clang-set-prefix (or (funcall company-clang-prefix-guesser) - 'none))) - (apply 'company-clang--start-process - prefix - callback - (company-clang--build-complete-args (- (point) (length prefix))))) - -(defun company-clang--prefix () - (if company-clang-begin-after-member-access - (company-grab-symbol-cons "\\.\\|->\\|::" 2) - (company-grab-symbol))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defconst company-clang-required-version 1.1) - -(defvar company-clang--version nil) - -(defun company-clang--auto-save-p () - (< company-clang--version 2.9)) - -(defsubst company-clang-version () - "Return the version of `company-clang-executable'." - (with-temp-buffer - (call-process company-clang-executable nil t nil "--version") - (goto-char (point-min)) - (if (re-search-forward "clang\\(?: version \\|-\\)\\([0-9.]+\\)" nil t) - (let ((ver (string-to-number (match-string-no-properties 1)))) - (if (> ver 100) - (/ ver 100) - ver)) - 0))) - -(defun company-clang (command &optional arg &rest ignored) - "`company-mode' completion backend for Clang. -Clang is a parser for C and ObjC. Clang version 1.1 or newer is required. - -Additional command line arguments can be specified in -`company-clang-arguments'. Prefix files (-include ...) can be selected -with `company-clang-set-prefix' or automatically through a custom -`company-clang-prefix-guesser'. - -With Clang versions before 2.9, we have to save the buffer before -performing completion. With Clang 2.9 and later, buffer contents are -passed via standard input." - (interactive (list 'interactive)) - (cl-case command - (interactive (company-begin-backend 'company-clang)) - (init (when (memq major-mode company-clang-modes) - (unless company-clang-executable - (error "Company found no clang executable")) - (setq company-clang--version (company-clang-version)) - (when (< company-clang--version company-clang-required-version) - (error "Company requires clang version 1.1")))) - (prefix (and (memq major-mode company-clang-modes) - buffer-file-name - company-clang-executable - (not (company-in-string-or-comment)) - (or (company-clang--prefix) 'stop))) - (candidates (cons :async - (lambda (cb) (company-clang--candidates arg cb)))) - (meta (company-clang--meta arg)) - (annotation (company-clang--annotation arg)) - (post-completion (let ((anno (company-clang--annotation arg))) - (when (and company-clang-insert-arguments anno) - (insert anno) - (if (string-match "\\`:[^:]" anno) - (company-template-objc-templatify anno) - (company-template-c-like-templatify - (concat arg anno)))))))) - -(provide 'company-clang) -;;; company-clang.el ends here diff --git a/emacs.d/elpa/company-20160117.321/company-cmake.el b/emacs.d/elpa/company-20160117.321/company-cmake.el deleted file mode 100644 index 010df32..0000000 --- a/emacs.d/elpa/company-20160117.321/company-cmake.el +++ /dev/null @@ -1,198 +0,0 @@ -;;; company-cmake.el --- company-mode completion backend for CMake - -;; Copyright (C) 2013-2014 Free Software Foundation, Inc. - -;; Author: Chen Bin -;; Version: 0.2 - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: -;; -;; company-cmake offers completions for module names, variable names and -;; commands used by CMake. And their descriptions. - -;;; Code: - -(require 'company) -(require 'cl-lib) - -(defgroup company-cmake nil - "Completion backend for CMake." - :group 'company) - -(defcustom company-cmake-executable - (executable-find "cmake") - "Location of cmake executable." - :type 'file) - -(defvar company-cmake-executable-arguments - '("--help-command-list" - "--help-module-list" - "--help-variable-list") - "The arguments we pass to cmake, separately. -They affect which types of symbols we get completion candidates for.") - -(defvar company-cmake--completion-pattern - "^\\(%s[a-zA-Z0-9_<>]%s\\)$" - "Regexp to match the candidates.") - -(defvar company-cmake-modes '(cmake-mode) - "Major modes in which cmake may complete.") - -(defvar company-cmake--candidates-cache nil - "Cache for the raw candidates.") - -(defvar company-cmake--meta-command-cache nil - "Cache for command arguments to retrieve descriptions for the candidates.") - -(defun company-cmake--replace-tags (rlt) - (setq rlt (replace-regexp-in-string - "\\(.*?\\(IS_GNU\\)?\\)\\(.*\\)" - (lambda (_match) - (mapconcat 'identity - (if (match-beginning 2) - '("\\1CXX\\3" "\\1C\\3" "\\1G77\\3") - '("\\1CXX\\3" "\\1C\\3" "\\1Fortran\\3")) - "\n")) - rlt t)) - (setq rlt (replace-regexp-in-string - "\\(.*\\)\\(.*\\)" - (mapconcat 'identity '("\\1DEBUG\\2" "\\1RELEASE\\2" - "\\1RELWITHDEBINFO\\2" "\\1MINSIZEREL\\2") - "\n") - rlt)) - rlt) - -(defun company-cmake--fill-candidates-cache (arg) - "Fill candidates cache if needed." - (let (rlt) - (unless company-cmake--candidates-cache - (setq company-cmake--candidates-cache (make-hash-table :test 'equal))) - - ;; If hash is empty, fill it. - (unless (gethash arg company-cmake--candidates-cache) - (with-temp-buffer - (let ((res (call-process company-cmake-executable nil t nil arg))) - (unless (zerop res) - (message "cmake executable exited with error=%d" res))) - (setq rlt (buffer-string))) - (setq rlt (company-cmake--replace-tags rlt)) - (puthash arg rlt company-cmake--candidates-cache)) - )) - -(defun company-cmake--parse (prefix content cmd) - (let ((start 0) - (pattern (format company-cmake--completion-pattern - (regexp-quote prefix) - (if (zerop (length prefix)) "+" "*"))) - (lines (split-string content "\n")) - match - rlt) - (dolist (line lines) - (when (string-match pattern line) - (let ((match (match-string 1 line))) - (when match - (puthash match cmd company-cmake--meta-command-cache) - (push match rlt))))) - rlt)) - -(defun company-cmake--candidates (prefix) - (let (results - cmd-opts - str) - - (unless company-cmake--meta-command-cache - (setq company-cmake--meta-command-cache (make-hash-table :test 'equal))) - - (dolist (arg company-cmake-executable-arguments) - (company-cmake--fill-candidates-cache arg) - (setq cmd-opts (replace-regexp-in-string "-list$" "" arg) ) - - (setq str (gethash arg company-cmake--candidates-cache)) - (when str - (setq results (nconc results - (company-cmake--parse prefix str cmd-opts))))) - results)) - -(defun company-cmake--unexpand-candidate (candidate) - (cond - ((string-match "^CMAKE_\\(C\\|CXX\\|Fortran\\)\\(_.*\\)$" candidate) - (setq candidate (concat "CMAKE_" (match-string 2 candidate)))) - - ;; C flags - ((string-match "^\\(.*_\\)IS_GNU\\(C\\|CXX\\|G77\\)$" candidate) - (setq candidate (concat (match-string 1 candidate) "IS_GNU"))) - - ;; C flags - ((string-match "^\\(.*_\\)OVERRIDE_\\(C\\|CXX\\|Fortran\\)$" candidate) - (setq candidate (concat (match-string 1 candidate) "OVERRIDE_"))) - - ((string-match "^\\(.*\\)\\(_DEBUG\\|_RELEASE\\|_RELWITHDEBINFO\\|_MINSIZEREL\\)\\(.*\\)$" candidate) - (setq candidate (concat (match-string 1 candidate) - "_" - (match-string 3 candidate))))) - candidate) - -(defun company-cmake--meta (candidate) - (let ((cmd-opts (gethash candidate company-cmake--meta-command-cache)) - result) - (setq candidate (company-cmake--unexpand-candidate candidate)) - - ;; Don't cache the documentation of every candidate (command) - ;; Cache in this case will cost too much memory. - (with-temp-buffer - (call-process company-cmake-executable nil t nil cmd-opts candidate) - ;; Go to the third line, trim it and return the result. - ;; Tested with cmake 2.8.9. - (goto-char (point-min)) - (forward-line 2) - (setq result (buffer-substring-no-properties (line-beginning-position) - (line-end-position))) - (setq result (replace-regexp-in-string "^[ \t\n\r]+" "" result)) - result))) - -(defun company-cmake--doc-buffer (candidate) - (let ((cmd-opts (gethash candidate company-cmake--meta-command-cache))) - - (setq candidate (company-cmake--unexpand-candidate candidate)) - (with-temp-buffer - (call-process company-cmake-executable nil t nil cmd-opts candidate) - ;; Go to the third line, trim it and return the doc buffer. - ;; Tested with cmake 2.8.9. - (goto-char (point-min)) - (forward-line 2) - (company-doc-buffer - (buffer-substring-no-properties (line-beginning-position) - (point-max)))))) - -(defun company-cmake (command &optional arg &rest ignored) - "`company-mode' completion backend for CMake. -CMake is a cross-platform, open-source make system." - (interactive (list 'interactive)) - (cl-case command - (interactive (company-begin-backend 'company-cmake)) - (init (when (memq major-mode company-cmake-modes) - (unless company-cmake-executable - (error "Company found no cmake executable")))) - (prefix (and (memq major-mode company-cmake-modes) - (not (company-in-string-or-comment)) - (company-grab-symbol))) - (candidates (company-cmake--candidates arg)) - (meta (company-cmake--meta arg)) - (doc-buffer (company-cmake--doc-buffer arg)) - )) - -(provide 'company-cmake) -;;; company-cmake.el ends here diff --git a/emacs.d/elpa/company-20160117.321/company-css.el b/emacs.d/elpa/company-20160117.321/company-css.el deleted file mode 100644 index cf8c683..0000000 --- a/emacs.d/elpa/company-20160117.321/company-css.el +++ /dev/null @@ -1,442 +0,0 @@ -;;; company-css.el --- company-mode completion backend for css-mode -*- lexical-binding: t -*- - -;; Copyright (C) 2009, 2011, 2014 Free Software Foundation, Inc. - -;; Author: Nikolaj Schumacher - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: - -;;; Code: - -(require 'company) -(require 'cl-lib) - -(declare-function web-mode-language-at-pos "web-mode" (&optional pos)) - -(defconst company-css-property-alist - ;; see http://www.w3.org/TR/CSS21/propidx.html - '(("azimuth" angle "left-side" "far-left" "left" "center-left" "center" - "center-right" "right" "far-right" "right-side" "behind" "leftwards" - "rightwards") - ("background" background-color background-image background-repeat - background-attachment background-position - background-clip background-origin background-size) - ("background-attachment" "scroll" "fixed") - ("background-color" color "transparent") - ("background-image" uri "none") - ("background-position" percentage length "left" "center" "right" percentage - length "top" "center" "bottom" "left" "center" "right" "top" "center" - "bottom") - ("background-repeat" "repeat" "repeat-x" "repeat-y" "no-repeat") - ("border" border-width border-style border-color) - ("border-bottom" border) - ("border-bottom-color" border-color) - ("border-bottom-style" border-style) - ("border-bottom-width" border-width) - ("border-collapse" "collapse" "separate") - ("border-color" color "transparent") - ("border-left" border) - ("border-left-color" border-color) - ("border-left-style" border-style) - ("border-left-width" border-width) - ("border-right" border) - ("border-right-color" border-color) - ("border-right-style" border-style) - ("border-right-width" border-width) - ("border-spacing" length length) - ("border-style" border-style) - ("border-top" border) - ("border-top-color" border-color) - ("border-top-style" border-style) - ("border-top-width" border-width) - ("border-width" border-width) - ("bottom" length percentage "auto") - ("caption-side" "top" "bottom") - ("clear" "none" "left" "right" "both") - ("clip" shape "auto") - ("color" color) - ("content" "normal" "none" string uri counter "attr()" "open-quote" - "close-quote" "no-open-quote" "no-close-quote") - ("counter-increment" identifier integer "none") - ("counter-reset" identifier integer "none") - ("cue" cue-before cue-after) - ("cue-after" uri "none") - ("cue-before" uri "none") - ("cursor" uri "*" "auto" "crosshair" "default" "pointer" "move" "e-resize" - "ne-resize" "nw-resize" "n-resize" "se-resize" "sw-resize" "s-resize" - "w-resize" "text" "wait" "help" "progress") - ("direction" "ltr" "rtl") - ("display" "inline" "block" "list-item" "run-in" "inline-block" "table" - "inline-table" "table-row-group" "table-header-group" "table-footer-group" - "table-row" "table-column-group" "table-column" "table-cell" - "table-caption" "none") - ("elevation" angle "below" "level" "above" "higher" "lower") - ("empty-cells" "show" "hide") - ("float" "left" "right" "none") - ("font" font-style font-weight font-size "/" line-height - font-family "caption" "icon" "menu" "message-box" "small-caption" - "status-bar" "normal" "small-caps" - ;; CSS3 - font-stretch) - ("font-family" family-name generic-family) - ("font-size" absolute-size relative-size length percentage) - ("font-style" "normal" "italic" "oblique") - ("font-weight" "normal" "bold" "bolder" "lighter" "100" "200" "300" "400" - "500" "600" "700" "800" "900") - ("height" length percentage "auto") - ("left" length percentage "auto") - ("letter-spacing" "normal" length) - ("line-height" "normal" number length percentage) - ("list-style" list-style-type list-style-position list-style-image) - ("list-style-image" uri "none") - ("list-style-position" "inside" "outside") - ("list-style-type" "disc" "circle" "square" "decimal" "decimal-leading-zero" - "lower-roman" "upper-roman" "lower-greek" "lower-latin" "upper-latin" - "armenian" "georgian" "lower-alpha" "upper-alpha" "none") - ("margin" margin-width) - ("margin-bottom" margin-width) - ("margin-left" margin-width) - ("margin-right" margin-width) - ("margin-top" margin-width) - ("max-height" length percentage "none") - ("max-width" length percentage "none") - ("min-height" length percentage) - ("min-width" length percentage) - ("orphans" integer) - ("outline" outline-color outline-style outline-width) - ("outline-color" color "invert") - ("outline-style" border-style) - ("outline-width" border-width) - ("overflow" "visible" "hidden" "scroll" "auto" - ;; CSS3: - "no-display" "no-content") - ("padding" padding-width) - ("padding-bottom" padding-width) - ("padding-left" padding-width) - ("padding-right" padding-width) - ("padding-top" padding-width) - ("page-break-after" "auto" "always" "avoid" "left" "right") - ("page-break-before" "auto" "always" "avoid" "left" "right") - ("page-break-inside" "avoid" "auto") - ("pause" time percentage) - ("pause-after" time percentage) - ("pause-before" time percentage) - ("pitch" frequency "x-low" "low" "medium" "high" "x-high") - ("pitch-range" number) - ("play-during" uri "mix" "repeat" "auto" "none") - ("position" "static" "relative" "absolute" "fixed") - ("quotes" string string "none") - ("richness" number) - ("right" length percentage "auto") - ("speak" "normal" "none" "spell-out") - ("speak-header" "once" "always") - ("speak-numeral" "digits" "continuous") - ("speak-punctuation" "code" "none") - ("speech-rate" number "x-slow" "slow" "medium" "fast" "x-fast" "faster" - "slower") - ("stress" number) - ("table-layout" "auto" "fixed") - ("text-align" "left" "right" "center" "justify") - ("text-indent" length percentage) - ("text-transform" "capitalize" "uppercase" "lowercase" "none") - ("top" length percentage "auto") - ("unicode-bidi" "normal" "embed" "bidi-override") - ("vertical-align" "baseline" "sub" "super" "top" "text-top" "middle" - "bottom" "text-bottom" percentage length) - ("visibility" "visible" "hidden" "collapse") - ("voice-family" specific-voice generic-voice "*" specific-voice - generic-voice) - ("volume" number percentage "silent" "x-soft" "soft" "medium" "loud" - "x-loud") - ("white-space" "normal" "pre" "nowrap" "pre-wrap" "pre-line") - ("widows" integer) - ("width" length percentage "auto") - ("word-spacing" "normal" length) - ("z-index" "auto" integer) - ;; CSS3 - ("align-content" align-stretch "space-between" "space-around") - ("align-items" align-stretch "baseline") - ("align-self" align-items "auto") - ("animation" animation-name animation-duration animation-timing-function - animation-delay animation-iteration-count animation-direction - animation-fill-mode) - ("animation-delay" time) - ("animation-direction" "normal" "reverse" "alternate" "alternate-reverse") - ("animation-duration" time) - ("animation-fill-mode" "none" "forwards" "backwards" "both") - ("animation-iteration-count" integer "infinite") - ("animation-name" "none") - ("animation-play-state" "paused" "running") - ("animation-timing-function" transition-timing-function - "step-start" "step-end" "steps(,)") - ("backface-visibility" "visible" "hidden") - ("background-clip" background-origin) - ("background-origin" "border-box" "padding-box" "content-box") - ("background-size" length percentage "auto" "cover" "contain") - ("border-image" border-image-outset border-image-repeat border-image-source - border-image-slice border-image-width) - ("border-image-outset" length) - ("border-image-repeat" "stretch" "repeat" "round" "space") - ("border-image-source" uri "none") - ("border-image-slice" length) - ("border-image-width" length percentage) - ("border-radius" length) - ("border-top-left-radius" length) - ("border-top-right-radius" length) - ("border-bottom-left-radius" length) - ("border-bottom-right-radius" length) - ("box-decoration-break" "slice" "clone") - ("box-shadow" length color) - ("box-sizing" "content-box" "border-box") - ("break-after" "auto" "always" "avoid" "left" "right" "page" "column" - "avoid-page" "avoid-column") - ("break-before" break-after) - ("break-inside" "avoid" "auto") - ("columns" column-width column-count) - ("column-count" integer) - ("column-fill" "auto" "balance") - ("column-gap" length "normal") - ("column-rule" column-rule-width column-rule-style column-rule-color) - ("column-rule-color" color) - ("column-rule-style" border-style) - ("column-rule-width" border-width) - ("column-span" "all" "none") - ("column-width" length "auto") - ("filter" url "blur()" "brightness()" "contrast()" "drop-shadow()" - "grayscale()" "hue-rotate()" "invert()" "opacity()" "saturate()" "sepia()") - ("flex" flex-grow flex-shrink flex-basis) - ("flex-basis" percentage length "auto") - ("flex-direction" "row" "row-reverse" "column" "column-reverse") - ("flex-flow" flex-direction flex-wrap) - ("flex-grow" number) - ("flex-shrink" number) - ("flex-wrap" "nowrap" "wrap" "wrap-reverse") - ("font-feature-setting" normal string number) - ("font-kerning" "auto" "normal" "none") - ("font-language-override" "normal" string) - ("font-size-adjust" "none" number) - ("font-stretch" "normal" "ultra-condensed" "extra-condensed" "condensed" - "semi-condensed" "semi-expanded" "expanded" "extra-expanded" "ultra-expanded") - ("font-synthesis" "none" "weight" "style") - ("font-variant" font-variant-alternates font-variant-caps - font-variant-east-asian font-variant-ligatures font-variant-numeric - font-variant-position) - ("font-variant-alternates" "normal" "historical-forms" "stylistic()" - "styleset()" "character-variant()" "swash()" "ornaments()" "annotation()") - ("font-variant-caps" "normal" "small-caps" "all-small-caps" "petite-caps" - "all-petite-caps" "unicase" "titling-caps") - ("font-variant-east-asian" "jis78" "jis83" "jis90" "jis04" "simplified" - "traditional" "full-width" "proportional-width" "ruby") - ("font-variant-ligatures" "normal" "none" "common-ligatures" - "no-common-ligatures" "discretionary-ligatures" "no-discretionary-ligatures" - "historical-ligatures" "no-historical-ligatures" "contextual" "no-contextual") - ("font-variant-numeric" "normal" "ordinal" "slashed-zero" - "lining-nums" "oldstyle-nums" "proportional-nums" "tabular-nums" - "diagonal-fractions" "stacked-fractions") - ("font-variant-position" "normal" "sub" "super") - ("hyphens" "none" "manual" "auto") - ("justify-content" align-common "space-between" "space-around") - ("line-break" "auto" "loose" "normal" "strict") - ("marquee-direction" "forward" "reverse") - ("marquee-play-count" integer "infinite") - ("marquee-speed" "slow" "normal" "fast") - ("marquee-style" "scroll" "slide" "alternate") - ("opacity" number) - ("order" number) - ("outline-offset" length) - ("overflow-x" overflow) - ("overflow-y" overflow) - ("overflow-style" "auto" "marquee-line" "marquee-block") - ("overflow-wrap" "normal" "break-word") - ("perspective" "none" length) - ("perspective-origin" percentage length "left" "center" "right" "top" "bottom") - ("resize" "none" "both" "horizontal" "vertical") - ("tab-size" integer length) - ("text-align-last" "auto" "start" "end" "left" "right" "center" "justify") - ("text-decoration" text-decoration-color text-decoration-line text-decoration-style) - ("text-decoration-color" color) - ("text-decoration-line" "none" "underline" "overline" "line-through" "blink") - ("text-decoration-style" "solid" "double" "dotted" "dashed" "wavy") - ("text-overflow" "clip" "ellipsis") - ("text-shadow" color length) - ("text-underline-position" "auto" "under" "left" "right") - ("transform" "matrix(,,,,,)" "translate(,)" "translateX()" "translateY()" - "scale()" "scaleX()" "scaleY()" "rotate()" "skewX()" "skewY()" "none") - ("transform-origin" perspective-origin) - ("transform-style" "flat" "preserve-3d") - ("transition" transition-property transition-duration - transition-timing-function transition-delay) - ("transition-delay" time) - ("transition-duration" time) - ("transition-timing-function" - "ease" "linear" "ease-in" "ease-out" "ease-in-out" "cubic-bezier(,,,)") - ("transition-property" "none" "all" identifier) - ("word-wrap" overflow-wrap) - ("word-break" "normal" "break-all" "keep-all")) - "A list of CSS properties and their possible values.") - -(defconst company-css-value-classes - '((absolute-size "xx-small" "x-small" "small" "medium" "large" "x-large" - "xx-large") - (align-common "flex-start" "flex-end" "center") - (align-stretch align-common "stretch") - (border-style "none" "hidden" "dotted" "dashed" "solid" "double" "groove" - "ridge" "inset" "outset") - (border-width "thick" "medium" "thin") - (color "aqua" "black" "blue" "fuchsia" "gray" "green" "lime" "maroon" "navy" - "olive" "orange" "purple" "red" "silver" "teal" "white" "yellow") - (counter "counter(,)") - (family-name "Courier" "Helvetica" "Times") - (generic-family "serif" "sans-serif" "cursive" "fantasy" "monospace") - (generic-voice "male" "female" "child") - (margin-width "auto") ;; length percentage - (relative-size "larger" "smaller") - (shape "rect(,,,)") - (uri "url()")) - "A list of CSS property value classes and their contents.") -;; missing, because not completable -;; -;;