[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ELPA-diffs] /srv/bzr/emacs/elpa r389: Release 0.6.8
From: |
Dmitry Gutov |
Subject: |
[ELPA-diffs] /srv/bzr/emacs/elpa r389: Release 0.6.8 |
Date: |
Tue, 16 Apr 2013 15:40:14 +0400 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 389
committer: Dmitry Gutov <address@hidden>
branch nick: elpa
timestamp: Tue 2013-04-16 15:40:14 +0400
message:
Release 0.6.8
* `company-auto-complete` is disabled by default.
* `company-auto-complete-chars` default value includes fewer syntax classes.
* In expanded function calls, arguments skipped by the user default to "argN".
* `company-eclim` and `company-clang` do not strip argument types from fields.
* `company-clang` expands function calls for all three modes now.
* `company-clang` supports `c++-mode` by default.
Git commit 92ac3d0ef663bca26abbda33cc20a02a58b1c328
modified:
packages/company/company-abbrev.el
packages/company/company-clang.el
packages/company/company-css.el
packages/company/company-dabbrev-code.el
packages/company/company-dabbrev.el
packages/company/company-eclim.el
packages/company/company-elisp.el
packages/company/company-etags.el
packages/company/company-files.el
packages/company/company-gtags.el
packages/company/company-ispell.el
packages/company/company-keywords.el
packages/company/company-nxml.el
packages/company/company-oddmuse.el
packages/company/company-pkg.el
packages/company/company-pysmell.el
packages/company/company-ropemacs.el
packages/company/company-semantic.el
packages/company/company-template.el
packages/company/company-tempo.el
packages/company/company-tests.el
packages/company/company-xcode.el
packages/company/company.el
=== modified file 'packages/company/company-abbrev.el'
--- a/packages/company/company-abbrev.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-abbrev.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-abbrev.el --- A company-mode completion back-end for abbrev
+;;; company-abbrev.el --- company-mode completion back-end for abbrev
;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
@@ -35,7 +35,7 @@
;;;###autoload
(defun company-abbrev (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for abbrev."
+ "`company-mode' completion back-end for abbrev."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-abbrev
=== modified file 'packages/company/company-clang.el'
--- a/packages/company/company-clang.el 2013-03-23 22:22:44 +0000
+++ b/packages/company/company-clang.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-clang.el --- A company-mode completion back-end for clang
+;;; company-clang.el --- company-mode completion back-end for Clang
;; Copyright (C) 2009, 2011, 2013 Free Software Foundation, Inc.
@@ -29,16 +29,18 @@
(require 'company-template)
(eval-when-compile (require 'cl))
+(defgroup company-clang nil
+ "Completion back-end for Clang."
+ :group 'company)
+
(defcustom company-clang-executable
(executable-find "clang")
"Location of clang executable."
- :group 'company-clang
:type 'file)
(defcustom company-clang-auto-save t
"Determines whether to save the buffer when retrieving completions.
clang can only complete correctly when the buffer has been saved."
- :group 'company-clang
:type '(choice (const :tag "Off" nil)
(const :tag "On" t)))
@@ -47,15 +49,13 @@
Prefix files (-include ...) can be selected with
`company-clang-set-prefix' or automatically through a custom
`company-clang-prefix-guesser'."
- :group 'company-clang
:type '(repeat (string :tag "Argument" nil)))
(defcustom company-clang-prefix-guesser 'company-clang-guess-prefix
"A function to determine the prefix file for the current buffer."
- :group 'company-clang
:type '(function :tag "Guesser function" nil))
-(defvar company-clang-modes '(c-mode objc-mode)
+(defvar company-clang-modes '(c-mode c++-mode objc-mode)
"Major modes which clang may complete.")
;; prefix
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -100,15 +100,16 @@
;; parsing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; TODO: How to handle OVERLOAD and Pattern?
+;; 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_:]*\\)\\(?: : \\(.*\\)$\\)?")
+ "^COMPLETION: \\_<\\(%s[a-zA-Z0-9_:]*\\)\\(?: : \\(.*\\)$\\)?$")
(defconst company-clang--error-buffer-name "*clang error*")
(defvar company-clang--meta-cache nil)
-(defun company-clang--parse-output (prefix)
+(defun company-clang--parse-output (prefix objc)
(goto-char (point-min))
(let ((pattern (format company-clang--completion-pattern
(regexp-quote prefix)))
@@ -117,13 +118,22 @@
(setq company-clang--meta-cache (make-hash-table :test 'equal))
(while (re-search-forward pattern nil t)
(setq match (match-string-no-properties 1))
- (let ((meta (match-string-no-properties 2)))
- (when (and meta (not (string= match meta)))
- (puthash match meta company-clang--meta-cache)))
(unless (equal match "Pattern")
+ (let ((meta (match-string-no-properties 2)))
+ (when (and meta (not (string= match meta)))
+ (setq meta (company-clang--strip-formatting meta))
+ (when (and (not objc) (string-match "\\((.*)\\)" meta))
+ (setq match (concat match (match-string 1 meta))))
+ (puthash match meta company-clang--meta-cache)))
(push match lines)))
lines))
+(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))
@@ -147,12 +157,13 @@
(goto-char (point-min))))))
(defun company-clang--call-process (prefix &rest args)
- (with-temp-buffer
- (let ((res (apply 'call-process company-clang-executable nil t nil args)))
- (unless (eq 0 res)
- (company-clang--handle-error res args))
- ;; Still try to get any useful input.
- (company-clang--parse-output prefix))))
+ (let ((objc (derived-mode-p 'objc-mode)))
+ (with-temp-buffer
+ (let ((res (apply 'call-process company-clang-executable nil t nil
args)))
+ (unless (eq 0 res)
+ (company-clang--handle-error res args))
+ ;; Still try to get any useful input.
+ (company-clang--parse-output prefix objc)))))
(defsubst company-clang--build-location (pos)
(save-excursion
@@ -197,26 +208,23 @@
0)))
(defun company-clang-objc-templatify (selector)
- (let* ((end (point))
+ (let* ((end (point-marker))
(beg (- (point) (length selector)))
(templ (company-template-declare-template beg end))
(cnt 0))
(save-excursion
(goto-char beg)
- (while (search-forward ":" end t)
- (let* ((name (format "arg%d" cnt))
- (len (length name)))
- (incf end len)
- (company-template-add-field templ (match-end 0) name)
- (goto-char (+ (match-end 0) len))
- (when (< (point) end)
- (insert " ")
- (incf end))
+ (catch 'stop
+ (while (search-forward ":" end t)
+ (company-template-add-field templ (point) (format "arg%d" cnt))
+ (if (< (point) end)
+ (insert " ")
+ (throw 'stop t))
(incf cnt))))
(company-template-move-to-first templ)))
(defun company-clang (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for clang.
+ "`company-mode' completion back-end 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
@@ -240,18 +248,14 @@
(not (company-in-string-or-comment))
(or (company-grab-symbol) 'stop)))
(candidates (company-clang--candidates arg))
- (meta (let ((meta (gethash arg company-clang--meta-cache)))
- (when meta
- (replace-regexp-in-string
- "#]" " "
- (replace-regexp-in-string "[<{[]#\\|#[>}]" "" meta t)
- t))))
- (crop (and (derived-mode-p 'objc-mode)
- (string-match ":" arg)
+ (meta (gethash arg company-clang--meta-cache))
+ (crop (and (string-match ":\\|(" arg)
(substring arg 0 (match-beginning 0))))
- (post-completion (and (derived-mode-p 'objc-mode)
- (string-match ":" arg)
- (company-clang-objc-templatify arg)))))
+ (post-completion (cond
+ ((not (derived-mode-p 'objc-mode))
+ (company-template-c-like-templatify arg))
+ ((string-match ":" arg)
+ (company-clang-objc-templatify arg))))))
(provide 'company-clang)
;;; company-clang.el ends here
=== modified file 'packages/company/company-css.el'
--- a/packages/company/company-css.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-css.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-css.el --- A company-mode completion back-end for css-mode
+;;; company-css.el --- company-mode completion back-end for css-mode
;; Copyright (C) 2009, 2011 Free Software Foundation, Inc.
@@ -278,7 +278,7 @@
;;;###autoload
(defun company-css (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for `css-mode'."
+ "`company-mode' completion back-end for `css-mode'."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-css))
=== modified file 'packages/company/company-dabbrev-code.el'
--- a/packages/company/company-dabbrev-code.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-dabbrev-code.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-dabbrev-code.el --- A dabbrev-like company-mode back-end for code
+;;; company-dabbrev-code.el --- dabbrev-like company-mode back-end for code
;; Copyright (C) 2009, 2011 Free Software Foundation, Inc.
@@ -29,6 +29,10 @@
(require 'company-dabbrev)
(eval-when-compile (require 'cl))
+(defgroup company-dabbrev-code nil
+ "dabbrev-like completion back-end for code."
+ :group 'company)
+
(defcustom company-dabbrev-code-modes
'(asm-mode batch-file-mode c++-mode c-mode cperl-mode csharp-mode css-mode
emacs-lisp-mode erlang-mode espresso-mode f90-mode fortran-mode
@@ -40,7 +44,6 @@
in comments or strings. In other modes `company-dabbrev-code' will pass
control
to other back-ends \(e.g. `company-dabbrev'\).
Value t means complete in all modes."
- :group 'company
:type '(choice (repeat (symbol :tag "Major mode"))
(const tag "All modes" t)))
@@ -49,14 +52,12 @@
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)
(const :tag "Same major mode" t)
(const :tag "All" all)))
(defcustom company-dabbrev-code-time-limit .5
"Determines how long `company-dabbrev-code' should look for matches."
- :group 'company
:type '(choice (const :tag "Off" nil)
(number :tag "Seconds")))
@@ -68,7 +69,7 @@
;;;###autoload
(defun company-dabbrev-code (command &optional arg &rest ignored)
- "A dabbrev-like `company-mode' back-end for code.
+ "dabbrev-like `company-mode' back-end for code.
The back-end looks for all symbols in the current buffer that aren't in
comments or strings."
(interactive (list 'interactive))
=== modified file 'packages/company/company-dabbrev.el'
--- a/packages/company/company-dabbrev.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-dabbrev.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-dabbrev.el --- A dabbrev-like company-mode completion back-end
+;;; company-dabbrev.el --- dabbrev-like company-mode completion back-end
;; Copyright (C) 2009, 2011 Free Software Foundation, Inc.
@@ -28,25 +28,26 @@
(require 'company)
(eval-when-compile (require 'cl))
+(defgroup company-dabbrev nil
+ "dabbrev-like completion back-end."
+ :group 'company)
+
(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.
See also `company-dabbrev-time-limit'."
- :group 'company
:type '(choice (const :tag "Off" nil)
(const :tag "Same major mode" t)
(const :tag "All" all)))
(defcustom company-dabbrev-time-limit .5
"Determines how many seconds `company-dabbrev' should look for matches."
- :group 'company
:type '(choice (const :tag "Off" nil)
(number :tag "Seconds")))
(defcustom company-dabbrev-char-regexp "\\sw"
"A regular expression matching the characters `company-dabbrev' looks for."
- :group 'company
:type 'regexp)
(defmacro company-dabrev--time-limit-while (test start limit &rest body)
@@ -109,7 +110,7 @@
;;;###autoload
(defun company-dabbrev (command &optional arg &rest ignored)
- "A dabbrev-like `company-mode' completion back-end."
+ "dabbrev-like `company-mode' completion back-end."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-dabbrev))
=== modified file 'packages/company/company-eclim.el'
--- a/packages/company/company-eclim.el 2013-04-01 05:30:58 +0000
+++ b/packages/company/company-eclim.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-eclim.el --- A company-mode completion back-end for eclim.
+;;; company-eclim.el --- company-mode completion back-end for Eclim
;; Copyright (C) 2009, 2011, 2013 Free Software Foundation, Inc.
@@ -34,6 +34,10 @@
(require 'company-template)
(eval-when-compile (require 'cl))
+(defgroup company-eclim nil
+ "Completion back-end for Eclim."
+ :group 'company)
+
(defun company-eclim-executable-find ()
(let (file)
(dolist (eclipse-root '("/Applications/eclipse" "/usr/lib/eclipse"
@@ -46,13 +50,11 @@
(defcustom company-eclim-executable
(or (executable-find "eclim") (company-eclim-executable-find))
"Location of eclim executable."
- :group 'company
:type 'file)
(defcustom company-eclim-auto-save t
"Determines whether to save the buffer when retrieving completions.
eclim can only complete correctly when the buffer has been saved."
- :group 'company
:type '(choice (const :tag "Off" nil)
(const :tag "On" t)))
@@ -140,21 +142,8 @@
(defun company-eclim--meta (candidate)
(gethash candidate company-eclim--doc))
-(defun company-eclim--templatify (call)
- (let* ((end (point))
- (beg (- (point) (length call)))
- (templ (company-template-declare-template beg end)))
- (save-excursion
- (goto-char beg)
- (while (re-search-forward "\\([(,] ?\\)\\([^ ]+ \\)\\([^ ,)]*\\)" end t)
- (let ((name (match-string 3)))
- (replace-match "\\1" t)
- (decf end (length (match-string 2)))
- (company-template-add-field templ (point) name))))
- (company-template-move-to-first templ)))
-
(defun company-eclim (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for Eclim.
+ "`company-mode' completion back-end for Eclim.
Eclim provides access to Eclipse Java IDE features for other editors.
Eclim version 1.7.13 or newer (?) is required.
@@ -177,7 +166,7 @@
(crop (when (string-match "(" arg)
(substring arg 0 (match-beginning 0))))
(post-completion (when (string-match "([^)]" arg)
- (company-eclim--templatify arg)))))
+ (company-template-c-like-templatify arg)))))
(provide 'company-eclim)
;;; company-eclim.el ends here
=== modified file 'packages/company/company-elisp.el'
--- a/packages/company/company-elisp.el 2013-04-04 20:09:23 +0000
+++ b/packages/company/company-elisp.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-elisp.el --- A company-mode completion back-end for
emacs-lisp-mode -*- lexical-binding: t -*-
+;;; company-elisp.el --- company-mode completion back-end for Emacs Lisp -*-
lexical-binding: t -*-
;; Copyright (C) 2009, 2011-2013 Free Software Foundation, Inc.
@@ -30,17 +30,19 @@
(require 'help-mode)
(require 'find-func)
+(defgroup company-elisp nil
+ "Completion back-end for Emacs Lisp."
+ :group 'company)
+
(defcustom company-elisp-detect-function-context t
"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)
(const :tag "On" t)))
(defcustom company-elisp-show-locals-first t
"If enabled, locally bound variables and functions are displayed
first in the candidates list."
- :group 'company
:type '(choice (const :tag "Off" nil)
(const :tag "On" t)))
@@ -191,7 +193,7 @@
;;;###autoload
(defun company-elisp (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for `emacs-lisp-mode'."
+ "`company-mode' completion back-end for Emacs Lisp."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-elisp))
=== modified file 'packages/company/company-etags.el'
--- a/packages/company/company-etags.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-etags.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-etags.el --- A company-mode completion back-end for etags
+;;; company-etags.el --- company-mode completion back-end for etags
;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
@@ -28,11 +28,14 @@
(require 'company)
(require 'etags)
+(defgroup company-etags nil
+ "Completion back-end for etags."
+ :group 'company)
+
(defcustom company-etags-use-main-table-list t
"Always search `tags-table-list' if set.
If this is disabled, `company-etags' will try to find the one table for each
buffer automatically."
- :group 'company-mode
:type '(choice (const :tag "off" nil)
(const :tag "on" t)))
@@ -66,7 +69,7 @@
;;;###autoload
(defun company-etags (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for etags."
+ "`company-mode' completion back-end for etags."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-etags))
=== modified file 'packages/company/company-files.el'
--- a/packages/company/company-files.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-files.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-files.el --- A company-mode completion back-end for file names
+;;; company-files.el --- company-mode completion back-end for file names
;; Copyright (C) 2009-2011, 2013 Free Software Foundation, Inc.
@@ -75,7 +75,7 @@
;;;###autoload
(defun company-files (command &optional arg &rest ignored)
- "A `company-mode' completion back-end existing file names."
+ "`company-mode' completion back-end existing file names."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-files))
=== modified file 'packages/company/company-gtags.el'
--- a/packages/company/company-gtags.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-gtags.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-gtags.el --- A company-mode completion back-end for GNU Global
+;;; company-gtags.el --- company-mode completion back-end for GNU Global
;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
@@ -28,11 +28,14 @@
(require 'company)
(eval-when-compile (require 'cl))
+(defgroup company-gtags nil
+ "Completion back-end for GNU Global."
+ :group 'company)
+
(defcustom company-gtags-executable
(executable-find "global")
"Location of GNU global executable."
- :type 'string
- :group 'company)
+ :type 'string)
(define-obsolete-variable-alias
'company-gtags-gnu-global-program-name
@@ -70,7 +73,7 @@
;;;###autoload
(defun company-gtags (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for GNU Global."
+ "`company-mode' completion back-end for GNU Global."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-gtags))
=== modified file 'packages/company/company-ispell.el'
--- a/packages/company/company-ispell.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-ispell.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-ispell.el --- A company-mode completion back-end using ispell
+;;; company-ispell.el --- company-mode completion back-end using Ispell
;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
@@ -29,10 +29,13 @@
(require 'ispell)
(eval-when-compile (require 'cl))
+(defgroup company-ispell nil
+ "Completion back-end using Ispell."
+ :group 'company)
+
(defcustom company-ispell-dictionary nil
"Dictionary to use for `company-ispell'.
If nil, use `ispell-complete-word-dict'."
- :group 'company
:type '(choice (const :tag "default (nil)" nil)
(file :tag "dictionary" t)))
@@ -51,7 +54,7 @@
;;;###autoload
(defun company-ispell (command &optional arg &rest ignored)
- "A `company-mode' completion back-end using ispell."
+ "`company-mode' completion back-end using Ispell."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-ispell))
=== modified file 'packages/company/company-keywords.el'
--- a/packages/company/company-keywords.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-keywords.el 2013-04-16 11:40:14 +0000
@@ -216,7 +216,7 @@
;;;###autoload
(defun company-keywords (command &optional arg &rest ignored)
- "A `company-mode' back-end for programming language keywords."
+ "`company-mode' back-end for programming language keywords."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-keywords))
=== modified file 'packages/company/company-nxml.el'
--- a/packages/company/company-nxml.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-nxml.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-nxml.el --- A company-mode completion back-end for nxml-mode
+;;; company-nxml.el --- company-mode completion back-end for nxml-mode
;; Copyright (C) 2009-2011, 2013 Free Software Foundation, Inc.
@@ -121,7 +121,7 @@
;;;###autoload
(defun company-nxml (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for `nxml-mode'."
+ "`company-mode' completion back-end for `nxml-mode'."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-nxml))
=== modified file 'packages/company/company-oddmuse.el'
--- a/packages/company/company-oddmuse.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-oddmuse.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-oddmuse.el --- A company-mode completion back-end for oddmuse-mode
+;;; company-oddmuse.el --- company-mode completion back-end for oddmuse-mode
;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
@@ -42,7 +42,7 @@
;;;###autoload
(defun company-oddmuse (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for `oddmuse-mode'."
+ "`company-mode' completion back-end for `oddmuse-mode'."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-oddmuse))
=== modified file 'packages/company/company-pkg.el'
--- a/packages/company/company-pkg.el 2013-04-04 20:09:23 +0000
+++ b/packages/company/company-pkg.el 2013-04-16 11:40:14 +0000
@@ -1,1 +1,1 @@
-(define-package "company" "0.6.7" "Modular in-buffer completion framework")
+(define-package "company" "0.6.8" "Modular in-buffer completion framework")
=== modified file 'packages/company/company-pysmell.el'
--- a/packages/company/company-pysmell.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-pysmell.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-pysmell.el --- A company-mode completion back-end for pysmell.el
+;;; company-pysmell.el --- company-mode completion back-end for pysmell.el
;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
@@ -53,7 +53,7 @@
;;;###autoload
(defun company-pysmell (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for pysmell.
+ "`company-mode' completion back-end for pysmell.
This requires pysmell.el and pymacs.el."
(interactive (list 'interactive))
(case command
=== modified file 'packages/company/company-ropemacs.el'
--- a/packages/company/company-ropemacs.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-ropemacs.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-ropemacs.el --- A company-mode completion back-end for pysmell.el
+;;; company-ropemacs.el --- company-mode completion back-end for ropemacs
;; Copyright (C) 2009-2011, 2013 Free Software Foundation, Inc.
@@ -57,7 +57,7 @@
(cons (elt location 0) (elt location 1)))))
(defun company-ropemacs (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for ropemacs."
+ "`company-mode' completion back-end for ropemacs."
(interactive (list 'interactive))
(case command
(init (when (and (derived-mode-p 'python-mode)
=== modified file 'packages/company/company-semantic.el'
--- a/packages/company/company-semantic.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-semantic.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-semantic.el --- A company-mode back-end using CEDET Semantic
+;;; company-semantic.el --- company-mode completion back-end using Semantic
;; Copyright (C) 2009-2011, 2013 Free Software Foundation, Inc.
@@ -39,9 +39,12 @@
(declare-function semantic-tag-buffer "semantic/tag")
(declare-function semantic-active-p "semantic")
+(defgroup company-semantic nil
+ "Completion back-end using Semantic."
+ :group 'company)
+
(defcustom company-semantic-metadata-function 'company-semantic-summary-and-doc
"The function turning a semantic tag into doc information."
- :group 'company
:type 'function)
(defvar company-semantic-modes '(c-mode c++-mode jde-mode java-mode))
@@ -111,7 +114,7 @@
;;;###autoload
(defun company-semantic (command &optional arg &rest ignored)
- "A `company-mode' completion back-end using CEDET Semantic."
+ "`company-mode' completion back-end using CEDET Semantic."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-semantic))
=== modified file 'packages/company/company-template.el'
--- a/packages/company/company-template.el 2013-04-01 05:30:58 +0000
+++ b/packages/company/company-template.el 2013-04-16 11:40:14 +0000
@@ -47,9 +47,8 @@
(defun company-template-move-to-first (templ)
(interactive)
- (let ((fields (overlay-get templ 'company-template-fields)))
- (push-mark)
- (goto-char (apply 'min (mapcar 'overlay-start fields)))))
+ (goto-char (overlay-start templ))
+ (company-template-forward-field))
(defun company-template-forward-field ()
(interactive)
@@ -65,10 +64,12 @@
(setq minimum pos)))
(push-mark)
(goto-char minimum)
- (let ((field (loop for ovl in (overlays-at start)
- when (overlay-get ovl 'company-template-parent)
- return ovl)))
- (company-template-remove-field field))))
+ (company-template-remove-field (company-template-field-at start))))
+
+(defun company-template-field-at (&optional point)
+ (loop for ovl in (overlays-at (or point (point)))
+ when (overlay-get ovl 'company-template-parent)
+ return ovl))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -92,23 +93,26 @@
(delq templ company-template--buffer-templates))
(delete-overlay templ))
-(defun company-template-add-field (templ pos text)
+(defun company-template-add-field (templ pos text &optional display)
+ "Add new field to template TEMPL at POS, inserting TEXT.
+When DISPLAY is non-nil, set the respective property on the overlay.
+Leave point at the end of the field."
(assert templ)
- (save-excursion
- (save-excursion
- (goto-char pos)
- (insert text)
- (when (> (point) (overlay-end templ))
- (move-overlay templ (overlay-start templ) (point))))
- (let ((ov (make-overlay pos (+ pos (length text))))
- (siblings (overlay-get templ 'company-template-fields)))
- ;; (overlay-put ov 'evaporate t)
- (overlay-put ov 'intangible t)
- (overlay-put ov 'face 'company-template-field)
- (overlay-put ov 'company-template-parent templ)
- (overlay-put ov 'insert-in-front-hooks '(company-template-insert-hook))
- (push ov siblings)
- (overlay-put templ 'company-template-fields siblings))))
+ (goto-char pos)
+ (insert text)
+ (when (> (point) (overlay-end templ))
+ (move-overlay templ (overlay-start templ) (point)))
+ (let ((ov (make-overlay pos (+ pos (length text))))
+ (siblings (overlay-get templ 'company-template-fields)))
+ ;; (overlay-put ov 'evaporate t)
+ (overlay-put ov 'intangible t)
+ (overlay-put ov 'face 'company-template-field)
+ (when display
+ (overlay-put ov 'display display))
+ (overlay-put ov 'company-template-parent templ)
+ (overlay-put ov 'insert-in-front-hooks '(company-template-insert-hook))
+ (push ov siblings)
+ (overlay-put templ 'company-template-fields siblings)))
(defun company-template-remove-field (ovl &optional clear)
(when (overlayp ovl)
@@ -140,5 +144,25 @@
(unless company-template--buffer-templates
(remove-hook 'post-command-hook 'company-template-post-command t)))
+;; common
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun company-template-c-like-templatify (call)
+ (let* ((end (point-marker))
+ (beg (- (point) (length call)))
+ (cnt 0))
+ (goto-char beg)
+ (when (search-forward "(" end 'move)
+ (if (eq (char-after) ?\))
+ (forward-char 1)
+ (let ((templ (company-template-declare-template beg end)))
+ (while (re-search-forward (concat " *\\([^,)]*\\)[,)]") end t)
+ (let ((sig (match-string 1)))
+ (delete-region (match-beginning 1) (match-end 1))
+ (save-excursion
+ (company-template-add-field templ (match-beginning 1)
+ (format "arg%d" cnt) sig))
+ (incf cnt)))
+ (company-template-move-to-first templ))))))
+
(provide 'company-template)
;;; company-template.el ends here
=== modified file 'packages/company/company-tempo.el'
--- a/packages/company/company-tempo.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-tempo.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-tempo.el --- A company-mode completion back-end for tempo
+;;; company-tempo.el --- company-mode completion back-end for tempo
;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
@@ -48,7 +48,7 @@
;;;###autoload
(defun company-tempo (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for tempo."
+ "`company-mode' completion back-end for tempo."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-tempo
=== modified file 'packages/company/company-tests.el'
--- a/packages/company/company-tests.el 2013-04-04 20:09:23 +0000
+++ b/packages/company/company-tests.el 2013-04-16 11:40:14 +0000
@@ -29,6 +29,8 @@
(require 'company)
(require 'company-keywords)
+;;; Core
+
(ert-deftest company-sorted-keywords ()
"Test that keywords in `company-keywords-alist' are in alphabetical order."
(dolist (pair company-keywords-alist)
@@ -173,6 +175,8 @@
(company-call 'open-line 1)
(should (eq 2 (overlay-start company-pseudo-tooltip-overlay)))))))
+;;; Template
+
(ert-deftest company-template-removed-after-the-last-jump ()
(with-temp-buffer
(insert "{ }")
@@ -181,8 +185,7 @@
(save-excursion
(dotimes (i 2)
(insert " ")
- (company-template-add-field tpl (point) "foo")
- (forward-char 3)))
+ (company-template-add-field tpl (point) "foo")))
(company-call 'template-forward-field)
(should (= 3 (point)))
(company-call 'template-forward-field)
@@ -218,6 +221,18 @@
(let ((this-command command))
(run-hooks 'post-command-hook))))
+(ert-deftest company-template-c-like-templatify ()
+ (with-temp-buffer
+ (let ((text "foo(int a, short b)"))
+ (insert text)
+ (company-template-c-like-templatify text)
+ (should (equal "foo(arg0, arg1)" (buffer-string)))
+ (should (looking-at "arg0"))
+ (should (equal "int a"
+ (overlay-get (company-template-field-at) 'display))))))
+
+;;; Elisp
+
(defmacro company-elisp-with-buffer (contents &rest body)
(declare (indent 0))
`(with-temp-buffer
@@ -382,3 +397,14 @@
(company-elisp-with-buffer
"(defun foob ()|)"
(should (equal "" (company-elisp 'prefix)))))
+
+;;; Clang
+
+(ert-deftest company-clang-objc-templatify ()
+ (with-temp-buffer
+ (let ((text "createBookWithTitle:andAuthor:"))
+ (insert text)
+ (company-clang-objc-templatify text)
+ (should (equal "createBookWithTitle:arg0 andAuthor:arg1"
(buffer-string)))
+ (should (looking-at "arg0"))
+ (should (null (overlay-get (company-template-field-at) 'display))))))
=== modified file 'packages/company/company-xcode.el'
--- a/packages/company/company-xcode.el 2013-03-19 03:47:51 +0000
+++ b/packages/company/company-xcode.el 2013-04-16 11:40:14 +0000
@@ -1,4 +1,4 @@
-;;; company-xcode.el --- A company-mode completion back-end for Xcode projects
+;;; company-xcode.el --- company-mode completion back-end for Xcode projects
;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
@@ -28,9 +28,12 @@
(require 'company)
(eval-when-compile (require 'cl))
+(defgroup company-xcode nil
+ "Completion back-end for Xcode projects."
+ :group 'company)
+
(defcustom company-xcode-xcodeindex-executable (executable-find "xcodeindex")
"Location of xcodeindex executable."
- :group 'company-xcode
:type 'file)
(defvar company-xcode-tags nil)
@@ -50,7 +53,6 @@
:set (lambda (variable value)
(set variable value)
(company-xcode-reset))
- :group 'company-xcode
:type '(set (const "Category") (const "Class") (const "Class Method")
(const "Class Variable") (const "Constant") (const "Enum")
(const "Field") (const "Instance Method")
@@ -105,7 +107,7 @@
company-xcode-tags))))))
;;;###autoload
(defun company-xcode (command &optional arg &rest ignored)
- "A `company-mode' completion back-end for Xcode projects."
+ "`company-mode' completion back-end for Xcode projects."
(interactive (list 'interactive))
(case command
(interactive (company-begin-backend 'company-xcode))
=== modified file 'packages/company/company.el'
--- a/packages/company/company.el 2013-04-04 20:09:23 +0000
+++ b/packages/company/company.el 2013-04-16 11:40:14 +0000
@@ -4,7 +4,7 @@
;; Author: Nikolaj Schumacher
;; Maintainer: Dmitry Gutov <address@hidden>
-;; Version: 0.6.7
+;; Version: 0.6.8
;; Keywords: abbrev, convenience, matching
;; URL: http://company-mode.github.com/
;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x, GNU Emacs 24.x
@@ -91,8 +91,7 @@
(:background "cornsilk"))
(((class color) (min-colors 88) (background dark))
(:background "yellow")))
- "Face used for the tool tip."
- :group 'company)
+ "Face used for the tooltip.")
(defface company-tooltip-selection
'((default :inherit company-tooltip)
@@ -101,13 +100,11 @@
(((class color) (min-colors 88) (background dark))
(:background "orange1"))
(t (:background "green")))
- "Face used for the selection in the tool tip."
- :group 'company)
+ "Face used for the selection in the tooltip.")
(defface company-tooltip-mouse
'((default :inherit highlight))
- "Face used for the tool tip item under the mouse."
- :group 'company)
+ "Face used for the tooltip item under the mouse.")
(defface company-tooltip-common
'((default :inherit company-tooltip)
@@ -115,8 +112,7 @@
:foreground "darkred")
(((background dark))
:foreground "red"))
- "Face used for the common completion in the tool tip."
- :group 'company)
+ "Face used for the common completion in the tooltip.")
(defface company-tooltip-common-selection
'((default :inherit company-tooltip-selection)
@@ -124,36 +120,30 @@
:foreground "darkred")
(((background dark))
:foreground "red"))
- "Face used for the selected common completion in the tool tip."
- :group 'company)
+ "Face used for the selected common completion in the tooltip.")
(defface company-preview
'((t :background "blue4"
:foreground "wheat"))
- "Face used for the completion preview."
- :group 'company)
+ "Face used for the completion preview.")
(defface company-preview-common
'((t :inherit company-preview
:foreground "red"))
- "Face used for the common part of the completion preview."
- :group 'company)
+ "Face used for the common part of the completion preview.")
(defface company-preview-search
'((t :inherit company-preview
:background "blue1"))
- "Face used for the search string in the completion preview."
- :group 'company)
+ "Face used for the search string in the completion preview.")
(defface company-echo nil
- "Face used for completions in the echo area."
- :group 'company)
+ "Face used for completions in the echo area.")
(defface company-echo-common
'((((background dark)) (:foreground "firebrick1"))
(((background light)) (:background "firebrick4")))
- "Face used for the common part of completions in the echo area."
- :group 'company)
+ "Face used for the common part of completions in the echo area.")
(defun company-frontends-set (variable value)
;; uniquify
@@ -197,7 +187,6 @@
`company-common', `company-selection', `company-point' and
`company-search-string'."
:set 'company-frontends-set
- :group 'company
:type '(repeat (choice (const :tag "echo" company-echo-frontend)
(const :tag "echo, strip common"
company-echo-strip-common-frontend)
@@ -213,34 +202,32 @@
(function :tag "custom function" nil))))
(defcustom company-tooltip-limit 10
- "The maximum number of candidates in the tool tip"
- :group 'company
+ "The maximum number of candidates in the tooltip"
:type 'integer)
(defcustom company-tooltip-minimum 6
- "The minimum height of the tool tip.
+ "The minimum height of the tooltip.
If this many lines are not available, prefer to display the tooltip above."
- :group 'company
:type 'integer)
(defvar company-safe-backends
'((company-abbrev . "Abbrev")
- (company-clang . "clang")
+ (company-clang . "Clang")
(company-css . "CSS")
(company-dabbrev . "dabbrev for plain text")
(company-dabbrev-code . "dabbrev for code")
- (company-eclim . "eclim (an Eclipse interace)")
+ (company-eclim . "Eclim (an Eclipse interface)")
(company-elisp . "Emacs Lisp")
(company-etags . "etags")
(company-files . "Files")
(company-gtags . "GNU Global")
- (company-ispell . "ispell")
+ (company-ispell . "Ispell")
(company-keywords . "Programming language keywords")
(company-nxml . "nxml")
(company-oddmuse . "Oddmuse")
(company-pysmell . "PySmell")
(company-ropemacs . "ropemacs")
- (company-semantic . "CEDET Semantic")
+ (company-semantic . "Semantic")
(company-tempo . "Tempo templates")
(company-xcode . "Xcode")))
(put 'company-safe-backends 'risky-local-variable t)
@@ -276,7 +263,7 @@
(plist-get (nthcdr 4 res) :predicate)))))))
(defcustom company-backends '(company-elisp company-nxml company-css
- company-clang company-semantic company-eclim
+ company-semantic company-clang company-eclim
company-xcode company-ropemacs
(company-gtags company-etags company-dabbrev-code
company-keywords)
@@ -343,7 +330,6 @@
The back-end should return nil for all commands it does not support or
does not know about. It should also be callable interactively and use
`company-begin-backend' to start itself in that case."
- :group 'company
:type `(repeat
(choice
:tag "Back-end"
@@ -363,14 +349,12 @@
"Hook run when company starts completing.
The hook is called with one argument that is non-nil if the completion was
started manually."
- :group 'company
:type 'hook)
(defcustom company-completion-cancelled-hook nil
"Hook run when company cancels completing.
The hook is called with one argument that is non-nil if the completion was
aborted manually."
- :group 'company
:type 'hook)
(defcustom company-completion-finished-hook nil
@@ -379,12 +363,10 @@
If you indend to use it to post-process candidates from a specific back-end,
consider using the `post-completion' command instead."
- :group 'company
:type 'hook)
(defcustom company-minimum-prefix-length 3
"The minimum prefix length for automatic completion."
- :group 'company
:type '(integer :tag "prefix length"))
(defcustom company-require-match 'company-explicit-action-p
@@ -393,25 +375,23 @@
This can be overridden by the back-end, if it returns t or 'never to
'require-match. `company-auto-complete' also takes precedence over this."
- :group 'company
:type '(choice (const :tag "Off" nil)
(function :tag "Predicate function")
(const :tag "On, if user interaction took place"
'company-explicit-action-p)
(const :tag "On" t)))
-(defcustom company-auto-complete 'company-explicit-action-p
+(defcustom company-auto-complete nil
"Determines when to auto-complete.
If this is enabled, all characters from `company-auto-complete-chars' complete
the selected completion. This can also be a function."
- :group 'company
:type '(choice (const :tag "Off" nil)
(function :tag "Predicate function")
(const :tag "On, if user interaction took place"
'company-explicit-action-p)
(const :tag "On" t)))
-(defcustom company-auto-complete-chars '(?\ ?\( ?\) ?. ?\" ?$ ?\' ?< ?| ?!)
+(defcustom company-auto-complete-chars '(?\ ?\) ?.)
"Determines which characters trigger an automatic completion.
See `company-auto-complete'. If this is a string, each string character causes
completion. If it is a list of syntax description characters (see
@@ -421,7 +401,6 @@
return non-nil if company should auto-complete.
A character that is part of a valid candidate never triggers auto-completion."
- :group 'company
:type '(choice (string :tag "Characters")
(set :tag "Syntax"
(const :tag "Whitespace" ?\ )
@@ -444,7 +423,6 @@
"The idle delay in seconds until automatic completions starts.
A value of nil means never complete automatically, t means complete
immediately when a prefix of `company-minimum-prefix-length' is reached."
- :group 'company
:type '(choice (const :tag "never (nil)" nil)
(const :tag "immediate (t)" t)
(number :tag "seconds")))
@@ -455,14 +433,12 @@
Alternatively any command with a non-nil 'company-begin property is treated as
if it was on this list."
- :group 'company
:type '(choice (const :tag "Any command" t)
(const :tag "Self insert command" '(self-insert-command))
(repeat :tag "Commands" function)))
(defcustom company-show-numbers nil
"If enabled, show quick-access numbers for the first ten candidates."
- :group 'company
:type '(choice (const :tag "off" nil)
(const :tag "on" t)))
@@ -925,10 +901,6 @@
(eq company-require-match t))
(not (eq backend-value 'never))))))
-(defun company-punctuation-p (input)
- "Return non-nil, if input starts with punctuation or parentheses."
- (memq (char-syntax (string-to-char input)) '(?. ?\( ?\))))
-
(defun company-auto-complete-p (input)
"Return non-nil, if input starts with punctuation or parentheses."
(and (if (functionp company-auto-complete)
@@ -1839,7 +1811,7 @@
(point) (overlay-start company-pseudo-tooltip-overlay)))
(defun company-pseudo-tooltip-frontend (command)
- "A `company-mode' front-end similar to a tool-tip but based on overlays."
+ "`company-mode' front-end similar to a tooltip but based on overlays."
(case command
(pre-command (company-pseudo-tooltip-hide-temporarily))
(post-command
@@ -1909,7 +1881,7 @@
(setq company-preview-overlay nil)))
(defun company-preview-frontend (command)
- "A `company-mode' front-end showing the selection as if it had been
inserted."
+ "`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)))
@@ -2013,19 +1985,19 @@
(company-echo-show)))
(defun company-echo-frontend (command)
- "A `company-mode' front-end showing the candidates in the echo area."
+ "`company-mode' front-end showing the candidates in the echo area."
(case command
(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."
+ "`company-mode' front-end showing the candidates in the echo area."
(case command
(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."
+ "`company-mode' front-end showing the documentation in the echo area."
(case command
(post-command (company-echo-show-when-idle 'company-fetch-metadata))
(hide (company-echo-hide))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ELPA-diffs] /srv/bzr/emacs/elpa r389: Release 0.6.8,
Dmitry Gutov <=