From: Stefan Monnier Date: Mon, 1 Aug 2011 16:16:07 +0000 (-0400) Subject: * company/*.el: Fix case misunderstanding. Use checkdoc. X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/fa2930ab25d48b66e66f4fab283649dd6833fbeb * company/*.el: Fix case misunderstanding. Use checkdoc. * company/company.el (company-capf): First cut at making Company use completion-at-point-functions. --- diff --git a/packages/company/company-abbrev.el b/packages/company/company-abbrev.el index 21dcd2e45..0c19e9687 100644 --- a/packages/company/company-abbrev.el +++ b/packages/company/company-abbrev.el @@ -1,6 +1,6 @@ -;;; company-abbrev.el --- a company-mode completion back-end for abbrev +;;; company-abbrev.el --- A company-mode completion back-end for abbrev -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -34,14 +38,14 @@ "A `company-mode' completion back-end for abbrev." (interactive (list 'interactive)) (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)) - ('require-match t))) + (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)) + (require-match t))) (provide 'company-abbrev) ;;; company-abbrev.el ends here diff --git a/packages/company/company-clang.el b/packages/company/company-clang.el index c005f2ca1..51eb78fbd 100644 --- a/packages/company/company-clang.el +++ b/packages/company/company-clang.el @@ -1,6 +1,6 @@ -;;; company-clang.el --- a company-mode completion back-end for clang +;;; company-clang.el --- A company-mode completion back-end for clang -;; Copyright (C) 2009 Free Software Foundation, Inc. +;; Copyright (C) 2009, 2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -26,7 +30,7 @@ (defcustom company-clang-executable (executable-find "clang") - "*Location of clang executable" + "*Location of clang executable." :group 'company-clang :type 'file) @@ -207,21 +211,21 @@ Completions only work correctly when the buffer has been saved. `company-clang-auto-save' determines whether to do this automatically." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-clang)) - ('init (unless company-clang-executable - (error "Company found no clang executable")) - (when (version< (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-grab-symbol) 'stop))) - ('candidates (company-clang--candidates arg)) - ('post-completion (and (derived-mode-p 'objc-mode) - (string-match ":" arg) - (company-clang-objc-templatify arg))))) + (interactive (company-begin-backend 'company-clang)) + (init (unless company-clang-executable + (error "Company found no clang executable")) + (when (version< (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-grab-symbol) 'stop))) + (candidates (company-clang--candidates arg)) + (post-completion (and (derived-mode-p 'objc-mode) + (string-match ":" arg) + (company-clang-objc-templatify arg))))) (provide 'company-clang) ;;; company-clang.el ends here diff --git a/packages/company/company-css.el b/packages/company/company-css.el index d1b3e028c..5642c363c 100644 --- a/packages/company/company-css.el +++ b/packages/company/company-css.el @@ -1,6 +1,6 @@ -;;; company-css.el --- a company-mode completion back-end for css-mode +;;; company-css.el --- A company-mode completion back-end for css-mode -;; Copyright (C) 2009 Free Software Foundation, Inc. +;; Copyright (C) 2009, 2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: (require 'company) @@ -245,7 +247,7 @@ "\\)*" "\\(\\(?:#\\|\\_<[[:alpha:]]\\)\\(?:[[:alnum:]-#]*\\_>\\)?\\_>\\|\\)" "\\=") - "A regular expression matching CSS tags") + "A regular expression matching CSS tags.") ;;; pseudo id (defconst company-css-pseudo-regexp @@ -259,7 +261,7 @@ "\\)*" "\\(?:\\(?:\\#\\|\\_<[[:alpha:]]\\)[[:alnum:]-#]*\\):" "\\([[:alpha:]-]+\\_>\\|\\)\\_>\\=") - "A regular expression matching CSS pseudo classes") + "A regular expression matching CSS pseudo classes.") ;;; properties @@ -272,20 +274,20 @@ Returns \"\" if no property found, but feasible at this position." ;;; values (defconst company-css-property-value-regexp "\\_<\\([[:alpha:]-]+\\):\\(?:[^};]*[[:space:]]+\\)?\\([^};]*\\_>\\|\\)\\=" - "A regular expression matching CSS tags") + "A regular expression matching CSS tags.") ;;;###autoload (defun company-css (command &optional arg &rest ignored) "A `company-mode' completion back-end for `css-mode'." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-css)) - ('prefix (and (derived-mode-p 'css-mode) + (interactive (company-begin-backend 'company-css)) + (prefix (and (derived-mode-p 'css-mode) (or (company-grab company-css-tag-regexp 1) (company-grab company-css-pseudo-regexp 1) (company-grab company-css-property-value-regexp 2) (company-css-grab-property)))) - ('candidates + (candidates (cond ((company-grab company-css-tag-regexp 1) (all-completions arg company-css-html-tags)) @@ -297,7 +299,7 @@ Returns \"\" if no property found, but feasible at this position." (company-grab company-css-property-value-regexp 1)))) ((company-css-grab-property) (all-completions arg company-css-property-alist)))) - ('sorted t))) + (sorted t))) (provide 'company-css) ;;; company-css.el ends here diff --git a/packages/company/company-dabbrev-code.el b/packages/company/company-dabbrev-code.el index 0a531b2d8..9be5bdbdc 100644 --- a/packages/company/company-dabbrev-code.el +++ b/packages/company/company-dabbrev-code.el @@ -1,6 +1,6 @@ -;;; company-dabbrev-code.el --- a dabbrev-like company-mode back-end for code +;;; company-dabbrev-code.el --- A dabbrev-like company-mode back-end for code -;; Copyright (C) 2009 Free Software Foundation, Inc. +;; Copyright (C) 2009, 2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -34,7 +38,7 @@ "*Modes that use `company-dabbrev-code'. In all these modes `company-dabbrev-code' will complete only symbols, not text in comments or strings. In other modes `company-dabbrev-code' will pass control -to other back-ends \(e.g. `company-dabbrev'\). +to other back-ends \(e.g. `company-dabbrev'\). Value t means complete in all modes." :group 'company :type '(choice (repeat (symbol :tag "Major mode")) @@ -42,8 +46,8 @@ Value t means complete in all modes." (defcustom company-dabbrev-code-other-buffers t "*Determines whether `company-dabbrev-code' should search other buffers. -If 'all, search all other buffers. If t, search buffers with the same -major-mode. +If `all', search all other buffers. If t, search buffers with the same +major mode. See also `company-dabbrev-code-time-limit'." :group 'company :type '(choice (const :tag "Off" nil) @@ -69,17 +73,17 @@ The back-end looks for all symbols in the current buffer that aren't in comments or strings." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-dabbrev-code)) - ('prefix (and (or (eq t company-dabbrev-code-modes) - (apply 'derived-mode-p company-dabbrev-code-modes)) - (not (company-in-string-or-comment)) - (or (company-grab-symbol) 'stop))) - ('candidates (let ((completion-ignore-case nil)) - (company-dabbrev--search - (company-dabbrev-code--make-regexp arg) - company-dabbrev-code-time-limit - company-dabbrev-code-other-buffers t))) - ('duplicates t))) + (interactive (company-begin-backend 'company-dabbrev-code)) + (prefix (and (or (eq t company-dabbrev-code-modes) + (apply 'derived-mode-p company-dabbrev-code-modes)) + (not (company-in-string-or-comment)) + (or (company-grab-symbol) 'stop))) + (candidates (let ((completion-ignore-case nil)) + (company-dabbrev--search + (company-dabbrev-code--make-regexp arg) + company-dabbrev-code-time-limit + company-dabbrev-code-other-buffers t))) + (duplicates t))) (provide 'company-dabbrev-code) ;;; company-dabbrev-code.el ends here diff --git a/packages/company/company-dabbrev.el b/packages/company/company-dabbrev.el index 2480f7982..80d2e5f47 100644 --- a/packages/company/company-dabbrev.el +++ b/packages/company/company-dabbrev.el @@ -1,6 +1,6 @@ -;;; company-dabbrev.el --- a dabbrev-like company-mode completion back-end +;;; company-dabbrev.el --- A dabbrev-like company-mode completion back-end -;; Copyright (C) 2009 Free Software Foundation, Inc. +;; Copyright (C) 2009, 2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -26,8 +30,8 @@ (defcustom company-dabbrev-other-buffers 'all "*Determines whether `company-dabbrev' should search other buffers. -If 'all, search all other buffers. If t, search buffers with the same -major-mode. +If `all', search all other buffers. If t, search buffers with the same +major mode. See also `company-dabbrev-time-limit'." :group 'company :type '(choice (const :tag "Off" nil) @@ -108,15 +112,15 @@ See also `company-dabbrev-time-limit'." "A dabbrev-like `company-mode' completion back-end." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-dabbrev)) - ('prefix (company-grab-word)) - ('candidates + (interactive (company-begin-backend 'company-dabbrev)) + (prefix (company-grab-word)) + (candidates (mapcar 'downcase (company-dabbrev--search (company-dabbrev--make-regexp arg) company-dabbrev-time-limit company-dabbrev-other-buffers))) - ('ignore-case t) - ('duplicates t))) + (ignore-case t) + (duplicates t))) (provide 'company-dabbrev) ;;; company-dabbrev.el ends here diff --git a/packages/company/company-eclim.el b/packages/company/company-eclim.el index c4f8be88a..2bbe99e46 100644 --- a/packages/company/company-eclim.el +++ b/packages/company/company-eclim.el @@ -1,6 +1,6 @@ -;;; company-eclim.el --- a company-mode completion back-end for eclim. +;;; company-eclim.el --- A company-mode completion back-end for eclim. -;; Copyright (C) 2009 Free Software Foundation, Inc. +;; Copyright (C) 2009, 2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -35,7 +39,7 @@ (defcustom company-eclim-executable (or (executable-find "eclim") (company-eclim-executable-find)) - "*Location of eclim executable" + "*Location of eclim executable." :group 'company :type 'file) @@ -127,17 +131,17 @@ Completions only work correctly when the buffer has been saved. `company-eclim-auto-save' determines whether to do this automatically." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-eclim)) - ('prefix (and (derived-mode-p 'java-mode 'jde-mode) - buffer-file-name - company-eclim-executable - (company-eclim--project-name) - (not (company-in-string-or-comment)) - (or (company-grab-symbol) 'stop))) - ('candidates (company-eclim--candidates arg)) - ('meta (cadr (assoc arg company-eclim--doc))) + (interactive (company-begin-backend 'company-eclim)) + (prefix (and (derived-mode-p 'java-mode 'jde-mode) + buffer-file-name + company-eclim-executable + (company-eclim--project-name) + (not (company-in-string-or-comment)) + (or (company-grab-symbol) 'stop))) + (candidates (company-eclim--candidates arg)) + (meta (cadr (assoc arg company-eclim--doc))) ;; because "" doesn't return everything - ('no-cache (equal arg "")))) + (no-cache (equal arg "")))) (provide 'company-eclim) ;;; company-eclim.el ends here diff --git a/packages/company/company-elisp.el b/packages/company/company-elisp.el index 5d71ddfe0..b4a3aa36e 100644 --- a/packages/company/company-elisp.el +++ b/packages/company/company-elisp.el @@ -1,6 +1,6 @@ -;;; company-elisp.el --- a company-mode completion back-end for emacs-lisp-mode +;;; company-elisp.el --- A company-mode completion back-end for emacs-lisp-mode -;; Copyright (C) 2009 Free Software Foundation, Inc. +;; Copyright (C) 2009, 2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -26,7 +30,7 @@ (require 'help-mode) (defcustom company-elisp-detect-function-context t - "*If enabled, offer lisp functions only in appropriate contexts. + "*If enabled, offer Lisp functions only in appropriate contexts. Functions are offered for completion only after ' and \(." :group 'company :type '(choice (const :tag "Off" nil) @@ -113,20 +117,20 @@ Functions are offered for completion only after ' and \(." "A `company-mode' completion back-end for `emacs-lisp-mode'." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-elisp)) - ('prefix (and (eq (derived-mode-p 'emacs-lisp-mode) 'emacs-lisp-mode) - (company-grab-lisp-symbol))) - ('candidates (company-elisp-candidates arg)) - ('meta (company-elisp-doc arg)) - ('doc-buffer (let ((symbol (intern arg))) - (save-window-excursion - (when (or (ignore-errors (describe-function symbol)) - (ignore-errors (describe-variable symbol))) - (help-buffer))))) - ('location (let ((sym (intern arg))) - (or (ignore-errors (find-definition-noselect sym nil)) - (ignore-errors (find-definition-noselect sym 'defvar)) - (ignore-errors (find-definition-noselect sym t))))))) + (interactive (company-begin-backend 'company-elisp)) + (prefix (and (eq (derived-mode-p 'emacs-lisp-mode) 'emacs-lisp-mode) + (company-grab-lisp-symbol))) + (candidates (company-elisp-candidates arg)) + (meta (company-elisp-doc arg)) + (doc-buffer (let ((symbol (intern arg))) + (save-window-excursion + (when (or (ignore-errors (describe-function symbol)) + (ignore-errors (describe-variable symbol))) + (help-buffer))))) + (location (let ((sym (intern arg))) + (or (ignore-errors (find-definition-noselect sym nil)) + (ignore-errors (find-definition-noselect sym 'defvar)) + (ignore-errors (find-definition-noselect sym t))))))) (provide 'company-elisp) ;;; company-elisp.el ends here diff --git a/packages/company/company-etags.el b/packages/company/company-etags.el index ce28eca62..6153b3ba2 100644 --- a/packages/company/company-etags.el +++ b/packages/company/company-etags.el @@ -1,6 +1,6 @@ -;;; company-etags.el --- a company-mode completion back-end for etags +;;; company-etags.el --- A company-mode completion back-end for etags -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -57,24 +61,24 @@ buffer automatically." "A `company-mode' completion back-end for etags." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-etags)) - ('prefix (and (memq major-mode company-etags-modes) - (not (company-in-string-or-comment)) - (require 'etags nil t) - (company-etags-buffer-table) - (or (company-grab-symbol) 'stop))) - ('candidates (let ((tags-table-list (company-etags-buffer-table)) - (completion-ignore-case nil)) - (and (or tags-file-name tags-table-list) - (fboundp 'tags-completion-table) - tags-table-list - (all-completions arg (tags-completion-table))))) - ('location (let ((tags-table-list (company-etags-buffer-table))) - (when (fboundp 'find-tag-noselect) - (save-excursion - (let ((buffer (find-tag-noselect arg))) - (cons buffer (with-current-buffer buffer (point)))))))) - ('sorted t))) + (interactive (company-begin-backend 'company-etags)) + (prefix (and (memq major-mode company-etags-modes) + (not (company-in-string-or-comment)) + (require 'etags nil t) + (company-etags-buffer-table) + (or (company-grab-symbol) 'stop))) + (candidates (let ((tags-table-list (company-etags-buffer-table)) + (completion-ignore-case nil)) + (and (or tags-file-name tags-table-list) + (fboundp 'tags-completion-table) + tags-table-list + (all-completions arg (tags-completion-table))))) + (location (let ((tags-table-list (company-etags-buffer-table))) + (when (fboundp 'find-tag-noselect) + (save-excursion + (let ((buffer (find-tag-noselect arg))) + (cons buffer (with-current-buffer buffer (point)))))))) + (sorted t))) (provide 'company-etags) ;;; company-etags.el ends here diff --git a/packages/company/company-files.el b/packages/company/company-files.el index 26a611e74..fdc88ab40 100644 --- a/packages/company/company-files.el +++ b/packages/company/company-files.el @@ -1,6 +1,6 @@ -;;; company-files.el --- a company-mode completion back-end for file names +;;; company-files.el --- A company-mode completion back-end for file names -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -69,16 +73,16 @@ ;;;###autoload (defun company-files (command &optional arg &rest ignored) - "a `company-mode' completion back-end existing file names." + "A `company-mode' completion back-end existing file names." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-files)) - ('prefix (company-files-grab-existing-name)) - ('candidates (company-files-complete arg)) - ('location (cons (dired-noselect - (file-name-directory (directory-file-name arg))) 1)) - ('sorted t) - ('no-cache t))) + (interactive (company-begin-backend 'company-files)) + (prefix (company-files-grab-existing-name)) + (candidates (company-files-complete arg)) + (location (cons (dired-noselect + (file-name-directory (directory-file-name arg))) 1)) + (sorted t) + (no-cache t))) (provide 'company-files) ;;; company-files.el ends here diff --git a/packages/company/company-gtags.el b/packages/company/company-gtags.el index d98b04f44..9163e2d4a 100644 --- a/packages/company/company-gtags.el +++ b/packages/company/company-gtags.el @@ -1,6 +1,6 @@ -;;; company-gtags.el --- a company-mode completion back-end for GNU Global +;;; company-gtags.el --- A company-mode completion back-end for GNU Global -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -26,7 +30,7 @@ (defcustom company-gtags-executable (executable-find "global") - "*Location of GNU global executable" + "*Location of GNU global executable." :type 'string :group 'company) @@ -69,15 +73,15 @@ "A `company-mode' completion back-end for GNU Global." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-gtags)) - ('prefix (and company-gtags-executable - (memq major-mode company-gtags-modes) - (not (company-in-string-or-comment)) - (company-gtags--tags-available-p) - (or (company-grab-symbol) 'stop))) - ('candidates (company-gtags-fetch-tags arg)) - ('sorted t) - ('location (company-gtags-location arg)))) + (interactive (company-begin-backend 'company-gtags)) + (prefix (and company-gtags-executable + (memq major-mode company-gtags-modes) + (not (company-in-string-or-comment)) + (company-gtags--tags-available-p) + (or (company-grab-symbol) 'stop))) + (candidates (company-gtags-fetch-tags arg)) + (sorted t) + (location (company-gtags-location arg)))) (provide 'company-gtags) ;;; company-gtags.el ends here diff --git a/packages/company/company-ispell.el b/packages/company/company-ispell.el index 0b8351533..0d29dd966 100644 --- a/packages/company/company-ispell.el +++ b/packages/company/company-ispell.el @@ -1,6 +1,6 @@ -;;; company-ispell.el --- a company-mode completion back-end using ispell +;;; company-ispell.el --- A company-mode completion back-end using ispell -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -50,13 +54,13 @@ If nil, use `ispell-complete-word-dict'." "A `company-mode' completion back-end using ispell." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-ispell)) - ('prefix (when (company-ispell-available) - (company-grab-word))) - ('candidates (lookup-words arg (or company-ispell-dictionary - ispell-complete-word-dict))) - ('sorted t) - ('ignore-case t))) + (interactive (company-begin-backend 'company-ispell)) + (prefix (when (company-ispell-available) + (company-grab-word))) + (candidates (lookup-words arg (or company-ispell-dictionary + ispell-complete-word-dict))) + (sorted t) + (ignore-case t))) (provide 'company-ispell) ;;; company-ispell.el ends here diff --git a/packages/company/company-keywords.el b/packages/company/company-keywords.el index 0fb3dc5f3..9f76a6b93 100644 --- a/packages/company/company-keywords.el +++ b/packages/company/company-keywords.el @@ -1,6 +1,6 @@ -;;; company-keywords.el --- a company back-end for programming language keywords +;;; company-keywords.el --- A company back-end for programming language keywords -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -215,17 +219,17 @@ "A `company-mode' back-end for programming language keywords." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-)) - ('prefix (and (assq major-mode company-keywords-alist) - (not (company-in-string-or-comment)) - (or (company-grab-symbol) 'stop))) - ('candidates + (interactive (company-begin-backend 'company-)) + (prefix (and (assq major-mode company-keywords-alist) + (not (company-in-string-or-comment)) + (or (company-grab-symbol) 'stop))) + (candidates (let ((completion-ignore-case nil) (symbols (cdr (assq major-mode company-keywords-alist)))) (all-completions arg (if (consp symbols) symbols (cdr (assq symbols company-keywords-alist)))))) - ('sorted t))) + (sorted t))) (provide 'company-keywords) ;;; company-keywords.el ends here diff --git a/packages/company/company-nxml.el b/packages/company/company-nxml.el index 5602e5022..9a235310d 100644 --- a/packages/company/company-nxml.el +++ b/packages/company/company-nxml.el @@ -1,6 +1,6 @@ -;;; company-nxml.el --- a company-mode completion back-end for nxml-mode +;;; company-nxml.el --- A company-mode completion back-end for nxml-mode -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -33,8 +37,8 @@ (replace-regexp-in-string "w" company-nxml-token-regexp "\\)\\|'\\([^']*\\>\\)\\)\\=" t t)) @@ -64,66 +68,66 @@ (defun company-nxml-tag (command &optional arg &rest ignored) (case command - ('prefix (and (derived-mode-p 'nxml-mode) - rng-validate-mode - (company-grab company-nxml-in-tag-name-regexp 1))) - ('candidates (company-nxml-prepared - (company-nxml-all-completions arg - (rng-match-possible-start-tag-names)))) - ('sorted t))) + (prefix (and (derived-mode-p 'nxml-mode) + rng-validate-mode + (company-grab company-nxml-in-tag-name-regexp 1))) + (candidates (company-nxml-prepared + (company-nxml-all-completions arg + (rng-match-possible-start-tag-names)))) + (sorted t))) (defun company-nxml-attribute (command &optional arg &rest ignored) (case command - ('prefix (and (derived-mode-p 'nxml-mode) + (prefix (and (derived-mode-p 'nxml-mode) rng-validate-mode (memq (char-after) '(?\ ?\t ?\n)) ;; outside word (company-grab rng-in-attribute-regex 1))) - ('candidates (company-nxml-prepared - (and (rng-adjust-state-for-attribute - lt-pos (- (point) (length arg))) - (company-nxml-all-completions arg - (rng-match-possible-attribute-names))))) - ('sorted t))) + (candidates (company-nxml-prepared + (and (rng-adjust-state-for-attribute + lt-pos (- (point) (length arg))) + (company-nxml-all-completions arg + (rng-match-possible-attribute-names))))) + (sorted t))) (defun company-nxml-attribute-value (command &optional arg &rest ignored) (case command - ('prefix (and (derived-mode-p 'nxml-mode) - rng-validate-mode - (and (memq (char-after) '(?' ?\" ?\ ?\t ?\n)) ;; outside word - (looking-back company-nxml-in-attribute-value-regexp) - (or (match-string-no-properties 4) - (match-string-no-properties 5) - "")))) - ('candidates (company-nxml-prepared - (let (attr-start attr-end colon) - (and (looking-back rng-in-attribute-value-regex lt-pos) - (setq colon (match-beginning 2) - attr-start (match-beginning 1) - attr-end (match-end 1)) - (rng-adjust-state-for-attribute lt-pos attr-start) - (rng-adjust-state-for-attribute-value - attr-start colon attr-end) - (all-completions arg - (rng-match-possible-value-strings)))))))) + (prefix (and (derived-mode-p 'nxml-mode) + rng-validate-mode + (and (memq (char-after) '(?' ?\" ?\ ?\t ?\n)) ;; outside word + (looking-back company-nxml-in-attribute-value-regexp) + (or (match-string-no-properties 4) + (match-string-no-properties 5) + "")))) + (candidates (company-nxml-prepared + (let (attr-start attr-end colon) + (and (looking-back rng-in-attribute-value-regex lt-pos) + (setq colon (match-beginning 2) + attr-start (match-beginning 1) + attr-end (match-end 1)) + (rng-adjust-state-for-attribute lt-pos attr-start) + (rng-adjust-state-for-attribute-value + attr-start colon attr-end) + (all-completions arg + (rng-match-possible-value-strings)))))))) ;;;###autoload (defun company-nxml (command &optional arg &rest ignored) "A `company-mode' completion back-end for `nxml-mode'." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-nxml)) - ('prefix (or (company-nxml-tag 'prefix) - (company-nxml-attribute 'prefix) - (company-nxml-attribute-value 'prefix))) - ('candidates (cond - ((company-nxml-tag 'prefix) - (company-nxml-tag 'candidates arg)) - ((company-nxml-attribute 'prefix) - (company-nxml-attribute 'candidates arg)) - ((company-nxml-attribute-value 'prefix) - (sort (company-nxml-attribute-value 'candidates arg) - 'string<)))) - ('sorted t))) + (interactive (company-begin-backend 'company-nxml)) + (prefix (or (company-nxml-tag 'prefix) + (company-nxml-attribute 'prefix) + (company-nxml-attribute-value 'prefix))) + (candidates (cond + ((company-nxml-tag 'prefix) + (company-nxml-tag 'candidates arg)) + ((company-nxml-attribute 'prefix) + (company-nxml-attribute 'candidates arg)) + ((company-nxml-attribute-value 'prefix) + (sort (company-nxml-attribute-value 'candidates arg) + 'string<)))) + (sorted t))) (provide 'company-nxml) ;;; company-nxml.el ends here diff --git a/packages/company/company-oddmuse.el b/packages/company/company-oddmuse.el index 36891e325..a121bbd02 100644 --- a/packages/company/company-oddmuse.el +++ b/packages/company/company-oddmuse.el @@ -1,6 +1,6 @@ -;;; company-oddmuse.el --- a company-mode completion back-end for oddmuse-mode +;;; company-oddmuse.el --- A company-mode completion back-end for oddmuse-mode -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -31,23 +35,23 @@ (defun company-oddmuse-get-page-table () (case major-mode - ('yaoddmuse-mode (with-no-warnings - (yaoddmuse-get-pagename-table yaoddmuse-wikiname))) - ('oddmuse-mode (with-no-warnings - (oddmuse-make-completion-table oddmuse-wiki))))) + (yaoddmuse-mode (with-no-warnings + (yaoddmuse-get-pagename-table yaoddmuse-wikiname))) + (oddmuse-mode (with-no-warnings + (oddmuse-make-completion-table oddmuse-wiki))))) ;;;###autoload (defun company-oddmuse (command &optional arg &rest ignored) "A `company-mode' completion back-end for `oddmuse-mode'." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-oddmuse)) - ('prefix (let ((case-fold-search nil)) - (and (memq major-mode '(oddmuse-mode yaoddmuse-mode)) - (looking-back company-oddmuse-link-regexp (point-at-bol)) - (or (match-string 1) - (match-string 2))))) - ('candidates (all-completions arg (company-oddmuse-get-page-table))))) + (interactive (company-begin-backend 'company-oddmuse)) + (prefix (let ((case-fold-search nil)) + (and (memq major-mode '(oddmuse-mode yaoddmuse-mode)) + (looking-back company-oddmuse-link-regexp (point-at-bol)) + (or (match-string 1) + (match-string 2))))) + (candidates (all-completions arg (company-oddmuse-get-page-table))))) (provide 'company-oddmuse) ;;; company-oddmuse.el ends here diff --git a/packages/company/company-pysmell.el b/packages/company/company-pysmell.el index 8a5dcbe5c..88a4c38ad 100644 --- a/packages/company/company-pysmell.el +++ b/packages/company/company-pysmell.el @@ -1,6 +1,6 @@ -;;; company-pysmell.el --- a company-mode completion back-end for pysmell.el +;;; company-pysmell.el --- A company-mode completion back-end for pysmell.el -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (eval-when-compile (require 'cl)) @@ -51,13 +55,13 @@ This requires pysmell.el and pymacs.el." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-pysmell)) - ('prefix (and (derived-mode-p 'python-mode) - buffer-file-name - (not (company-in-string-or-comment)) - (company-pysmell--available-p) - (company-pysmell--grab-symbol))) - ('candidates (delete "" (pysmell-get-all-completions))))) + (interactive (company-begin-backend 'company-pysmell)) + (prefix (and (derived-mode-p 'python-mode) + buffer-file-name + (not (company-in-string-or-comment)) + (company-pysmell--available-p) + (company-pysmell--grab-symbol))) + (candidates (delete "" (pysmell-get-all-completions))))) (provide 'company-pysmell) ;;; company-pysmell.el ends here diff --git a/packages/company/company-ropemacs.el b/packages/company/company-ropemacs.el index f92d5ce6b..008630cf9 100644 --- a/packages/company/company-ropemacs.el +++ b/packages/company/company-ropemacs.el @@ -1,6 +1,6 @@ -;;; company-ropemacs.el --- a company-mode completion back-end for pysmell.el +;;; company-ropemacs.el --- A company-mode completion back-end for pysmell.el -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (eval-when-compile (require 'cl)) @@ -61,14 +65,14 @@ "A `company-mode' completion back-end for ropemacs." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-ropemacs)) - ('prefix (and (derived-mode-p 'python-mode) - (not (company-in-string-or-comment)) - (company-ropemacs--grab-symbol))) - ('candidates (mapcar (lambda (element) (concat arg element)) - (rope-completions))) - ('doc-buffer (company-ropemacs-doc-buffer arg)) - ('location (company-ropemacs-location arg)))) + (interactive (company-begin-backend 'company-ropemacs)) + (prefix (and (derived-mode-p 'python-mode) + (not (company-in-string-or-comment)) + (company-ropemacs--grab-symbol))) + (candidates (mapcar (lambda (element) (concat arg element)) + (rope-completions))) + (doc-buffer (company-ropemacs-doc-buffer arg)) + (location (company-ropemacs-location arg)))) (provide 'company-ropemacs) ;;; company-ropemacs.el ends here diff --git a/packages/company/company-semantic.el b/packages/company/company-semantic.el index da0a5d3d8..bc097fbac 100644 --- a/packages/company/company-semantic.el +++ b/packages/company/company-semantic.el @@ -1,6 +1,6 @@ -;;; company-semantic.el --- a company-mode back-end using CEDET Semantic +;;; company-semantic.el --- A company-mode back-end using CEDET Semantic -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -34,7 +38,7 @@ (defvar company-semantic-modes '(c-mode c++-mode jde-mode java-mode)) (defvar company-semantic--current-tags nil - "Tags for the current context") + "Tags for the current context.") (defun company-semantic-doc-or-summary (tag) (or (semantic-documentation-for-tag tag) @@ -101,25 +105,25 @@ Symbols are chained by \".\" or \"->\"." "A `company-mode' completion back-end using CEDET Semantic." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-semantic)) - ('prefix (and (memq major-mode company-semantic-modes) - (semantic-active-p) - (not (company-in-string-or-comment)) - (or (company-semantic--grab) 'stop))) - ('candidates (if (and (equal arg "") - (not (looking-back "->\\|\\."))) - (company-semantic-completions-raw arg) - (company-semantic-completions arg))) - ('meta (funcall company-semantic-metadata-function - (assoc arg company-semantic--current-tags))) - ('doc-buffer (company-semantic-doc-buffer - (assoc arg company-semantic--current-tags))) - ;; because "" is an empty context and doesn't return local variables - ('no-cache (equal arg "")) - ('location (let ((tag (assoc arg company-semantic--current-tags))) - (when (buffer-live-p (semantic-tag-buffer tag)) - (cons (semantic-tag-buffer tag) - (semantic-tag-start tag))))))) + (interactive (company-begin-backend 'company-semantic)) + (prefix (and (memq major-mode company-semantic-modes) + (semantic-active-p) + (not (company-in-string-or-comment)) + (or (company-semantic--grab) 'stop))) + (candidates (if (and (equal arg "") + (not (looking-back "->\\|\\."))) + (company-semantic-completions-raw arg) + (company-semantic-completions arg))) + (meta (funcall company-semantic-metadata-function + (assoc arg company-semantic--current-tags))) + (doc-buffer (company-semantic-doc-buffer + (assoc arg company-semantic--current-tags))) + ;; Because "" is an empty context and doesn't return local variables. + (no-cache (equal arg "")) + (location (let ((tag (assoc arg company-semantic--current-tags))) + (when (buffer-live-p (semantic-tag-buffer tag)) + (cons (semantic-tag-buffer tag) + (semantic-tag-start tag))))))) (provide 'company-semantic) ;;; company-semantic.el ends here diff --git a/packages/company/company-tempo.el b/packages/company/company-tempo.el index d1fe8ed83..bc3408935 100644 --- a/packages/company/company-tempo.el +++ b/packages/company/company-tempo.el @@ -1,6 +1,6 @@ -;;; company-tempo.el --- a company-mode completion back-end for tempo +;;; company-tempo.el --- A company-mode completion back-end for tempo -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,6 +19,10 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) @@ -47,13 +51,13 @@ "A `company-mode' completion back-end for tempo." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-tempo - 'company-tempo-insert)) - ('prefix (or (car (tempo-find-match-string tempo-match-finder)) "")) - ('candidates (all-completions arg (tempo-build-collection))) - ('meta (company-tempo-meta arg)) - ('require-match t) - ('sorted t))) + (interactive (company-begin-backend 'company-tempo + 'company-tempo-insert)) + (prefix (or (car (tempo-find-match-string tempo-match-finder)) "")) + (candidates (all-completions arg (tempo-build-collection))) + (meta (company-tempo-meta arg)) + (require-match t) + (sorted t))) (provide 'company-tempo) ;;; company-tempo.el ends here diff --git a/packages/company/company-xcode.el b/packages/company/company-xcode.el index 079ecb44a..1c6576453 100644 --- a/packages/company/company-xcode.el +++ b/packages/company/company-xcode.el @@ -1,6 +1,6 @@ -;;; company-xcode.el --- a company-mode completion back-end for Xcode projects +;;; company-xcode.el --- A company-mode completion back-end for Xcode projects -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher @@ -19,13 +19,17 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; + ;;; Code: (require 'company) (eval-when-compile (require 'cl)) (defcustom company-xcode-xcodeindex-executable (executable-find "xcodeindex") - "*Location of xcodeindex executable" + "*Location of xcodeindex executable." :group 'company-xcode :type 'file) @@ -39,7 +43,7 @@ (defcustom company-xcode-types '("Class" "Constant" "Enum" "Macro" "Modeled Class" "Structure" "Type" "Union" "Function") - "*The types of symbols offered by `company-xcode' + "*The types of symbols offered by `company-xcode'. No context-enabled completion is available. Types like methods will be offered regardless of whether the class supports them. The defaults should be valid in most contexts." @@ -104,14 +108,14 @@ valid in most contexts." "A `company-mode' completion back-end for Xcode projects." (interactive (list 'interactive)) (case command - ('interactive (company-begin-backend 'company-xcode)) - ('prefix (and company-xcode-xcodeindex-executable + (interactive (company-begin-backend 'company-xcode)) + (prefix (and company-xcode-xcodeindex-executable + (company-xcode-tags) + (not (company-in-string-or-comment)) + (or (company-grab-symbol) 'stop))) + (candidates (let ((completion-ignore-case nil)) (company-xcode-tags) - (not (company-in-string-or-comment)) - (or (company-grab-symbol) 'stop))) - ('candidates (let ((completion-ignore-case nil)) - (company-xcode-tags) - (all-completions arg (company-xcode-tags)))))) + (all-completions arg (company-xcode-tags)))))) (provide 'company-xcode) diff --git a/packages/company/company.el b/packages/company/company.el index 824952513..5314ef601 100644 --- a/packages/company/company.el +++ b/packages/company/company.el @@ -1,11 +1,11 @@ -;;; company.el --- extensible inline text completion mechanism +;;; company.el --- Extensible inline text completion mechanism -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Nikolaj Schumacher ;; Version: 0.5 ;; Keywords: abbrev, convenience, matching -;; URL: http://nschum.de/src/emacs/company/ +;; URL: http://nschum.de/src/emacs/company-mode/ ;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x ;; This file is part of GNU Emacs. @@ -48,10 +48,10 @@ ;; ;; (defun company-my-backend (command &optional arg &rest ignored) ;; (case command -;; ('prefix (when (looking-back "foo\\>") +;; (prefix (when (looking-back "foo\\>") ;; (match-string 0))) -;; ('candidates (list "foobar" "foobaz" "foobarbaz")) -;; ('meta (format "This value is named %s" arg)))) +;; (candidates (list "foobar" "foobaz" "foobarbaz")) +;; (meta (format "This value is named %s" arg)))) ;; ;; Sometimes it is a good idea to mix two back-ends together, for example to ;; enrich gtags with dabbrev-code results (to emulate local variables): @@ -307,7 +307,29 @@ If this many lines are not available, prefer to display the tooltip above." (assq backend company-safe-backends)) (return t)))))) -(defcustom company-backends '(company-elisp company-nxml company-css +(defun company-capf (command &optional arg &rest args) + "Adapter for Company completion to use `completion-at-point-functions'." + (interactive (list 'interactive)) + (case command + (interactive (company-begin-backend 'company-capf)) + (prefix + (let ((res (run-hook-wrapped 'completion-at-point-functions + ;; Ignore misbehaving functions. + #'completion--capf-wrapper 'optimist))) + (when (consp res) + (if (> (nth 1 res) (point)) + 'stop + (buffer-substring-no-properties (nth 0 res) (point)))))) + (candidates + (let ((res (run-hook-wrapped 'completion-at-point-functions + ;; Ignore misbehaving functions. + #'completion--capf-wrapper 'optimist))) + (when (consp res) + (all-completions arg (nth 2 res) + (plist-get (nthcdr 3 res) :predicate))))))) + +(defcustom company-backends '(;; company-capf ;FIXME: Untested! + company-elisp company-nxml company-css company-eclim company-semantic company-clang company-xcode company-ropemacs (company-gtags company-etags company-dabbrev-code @@ -325,7 +347,7 @@ Each back-end is a function that takes a variable number of arguments. The first argument is the command requested from the back-end. It is one of the following: -'prefix: The back-end should return the text to be completed. It must be +`prefix': The back-end should return the text to be completed. It must be text immediately before `point'. Returning nil passes control to the next back-end. The function should return 'stop if it should complete but cannot \(e.g. if it is in the middle of a string\). If the returned value is only @@ -333,33 +355,33 @@ part of the prefix (e.g. the part after \"->\" in C), the back-end may return a cons of prefix and prefix length, which is then used in the `company-minimum-prefix-length' test. -'candidates: The second argument is the prefix to be completed. The +`candidates': The second argument is the prefix to be completed. The return value should be a list of candidates that start with the prefix. Optional commands: -'sorted: The back-end may return t here to indicate that the candidates +`sorted': The back-end may return t here to indicate that the candidates are sorted and will not need to be sorted again. -'duplicates: If non-nil, company will take care of removing duplicates +`duplicates': If non-nil, company will take care of removing duplicates from the list. -'no-cache: Usually company doesn't ask for candidates again as completion +`no-cache': Usually company doesn't ask for candidates again as completion progresses, unless the back-end returns t for this command. The second argument is the latest prefix. -'meta: The second argument is a completion candidate. The back-end should +`meta': The second argument is a completion candidate. The back-end should return a (short) documentation string for it. -'doc-buffer: The second argument is a completion candidate. The back-end should -create a buffer (preferably with `company-doc-buffer'), fill it with -documentation and return it. +`doc-buffer': The second argument is a completion candidate. +The back-end should create a buffer (preferably with `company-doc-buffer'), +fill it with documentation and return it. -'location: The second argument is a completion candidate. The back-end can +`location': The second argument is a completion candidate. The back-end can return the cons of buffer and buffer location, or of file and line number where the completion candidate was defined. -'require-match: If this value is t, the user is not allowed to enter anything +`require-match': If this value is t, the user is not allowed to enter anything not offering as a candidate. Use with care! The default value nil gives the user that choice with `company-require-match'. Return value 'never overrides that option the other way around. @@ -694,11 +716,11 @@ keymap during active completions (`company-active-map'): (defun company--multi-backend-adapter (backends command &rest args) (case command - ('candidates + (candidates (apply 'append (mapcar (lambda (backend) (apply backend command args)) backends))) - ('sorted nil) - ('duplicates t) + (sorted nil) + (duplicates t) (otherwise (let (value) (dolist (backend backends) @@ -1800,8 +1822,8 @@ Returns a negative number if the tooltip should be displayed above point." (defun company-pseudo-tooltip-frontend (command) "A `company-mode' front-end similar to a tool-tip but based on overlays." (case command - ('pre-command (company-pseudo-tooltip-hide-temporarily)) - ('post-command + (pre-command (company-pseudo-tooltip-hide-temporarily)) + (post-command (let ((old-height (if (overlayp company-pseudo-tooltip-overlay) (overlay-get company-pseudo-tooltip-overlay 'company-height) @@ -1813,9 +1835,9 @@ Returns a negative number if the tooltip should be displayed above point." (company-pseudo-tooltip-show-at-point (- (point) (length company-prefix))))) (company-pseudo-tooltip-unhide)) - ('hide (company-pseudo-tooltip-hide) + (hide (company-pseudo-tooltip-hide) (setq company-tooltip-offset 0)) - ('update (when (overlayp company-pseudo-tooltip-overlay) + (update (when (overlayp company-pseudo-tooltip-overlay) (company-pseudo-tooltip-edit company-candidates company-selection))))) @@ -1865,9 +1887,9 @@ Returns a negative number if the tooltip should be displayed above point." (defun company-preview-frontend (command) "A `company-mode' front-end showing the selection as if it had been inserted." (case command - ('pre-command (company-preview-hide)) - ('post-command (company-preview-show-at-point (point))) - ('hide (company-preview-hide)))) + (pre-command (company-preview-hide)) + (post-command (company-preview-show-at-point (point))) + (hide (company-preview-hide)))) (defun company-preview-if-just-one-frontend (command) "`company-preview-frontend', but only shown for single candidates." @@ -1963,23 +1985,23 @@ Returns a negative number if the tooltip should be displayed above point." (defun company-echo-frontend (command) "A `company-mode' front-end showing the candidates in the echo area." (case command - ('pre-command (company-echo-show-soon)) - ('post-command (company-echo-show-soon 'company-echo-format)) - ('hide (company-echo-hide)))) + (pre-command (company-echo-show-soon)) + (post-command (company-echo-show-soon 'company-echo-format)) + (hide (company-echo-hide)))) (defun company-echo-strip-common-frontend (command) "A `company-mode' front-end showing the candidates in the echo area." (case command - ('pre-command (company-echo-show-soon)) - ('post-command (company-echo-show-soon 'company-echo-strip-common-format)) - ('hide (company-echo-hide)))) + (pre-command (company-echo-show-soon)) + (post-command (company-echo-show-soon 'company-echo-strip-common-format)) + (hide (company-echo-hide)))) (defun company-echo-metadata-frontend (command) "A `company-mode' front-end showing the documentation in the echo area." (case command - ('pre-command (company-echo-show-soon)) - ('post-command (company-echo-show-soon 'company-fetch-metadata)) - ('hide (company-echo-hide)))) + (pre-command (company-echo-show-soon)) + (post-command (company-echo-show-soon 'company-fetch-metadata)) + (hide (company-echo-hide)))) ;; templates ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;