emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ELPA-diffs] ELPA branch, master, updated. 7ee028f7e9bb11a80501ed23714cd


From: Stefan Monnier
Subject: [ELPA-diffs] ELPA branch, master, updated. 7ee028f7e9bb11a80501ed23714cd4aeb7116756
Date: Wed, 21 Aug 2013 19:38:18 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "ELPA".

The branch, master has been updated
       via  7ee028f7e9bb11a80501ed23714cd4aeb7116756 (commit)
       via  b9e64ec07adfd8afbaf3fbc6d89a069b012f7ad2 (commit)
       via  85d0fa41222af8413daf4bd2c54d64c8abc2a2f6 (commit)
       via  fac24aa671caabe804a85f00f2030c3b56bec722 (commit)
       via  5726e141d1c2a5c9993cb05561d8358ae7246e30 (commit)
       via  66e9b043b82dc18bf66399812af573375b058cd8 (commit)
       via  b9840a3cd477063193ab89dd807acffb3b2df171 (commit)
       via  15a5062a17805a8d3a7a6b31ce3f3f805ad9b724 (commit)
       via  f23e059ac1dbc663aa03b764bbdbce6b4e8e9cbc (commit)
       via  35e64f3ae391715d9344265c7afc0ac798239f85 (commit)
       via  7c76330fceee2b6901e61ce3bedb5b76b253d828 (commit)
       via  5ad905a6aaf79c4f2a0018cd954e1414e542fff4 (commit)
       via  f6e5180bb1ac5c873885149325e1c63202a26f45 (commit)
      from  d4a3c58f4a518fd11d3d6846d8be14104ee4eeab (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7ee028f7e9bb11a80501ed23714cd4aeb7116756
Author: Stefan Monnier <address@hidden>
Date:   Wed Aug 21 15:38:05 2013 -0400

    * packages/company/company-cmake.el: Fix up copyright.  Require CL.
    * packages/company/company-template.el (company-template--buffer-templates):
    Declare before first use.
    * packages/company/company-eclim.el (json-array-type): Declare 
json-array-type.
    (company-eclim--candidates): Remove unused var `project-name'.

diff --git a/packages/company/company-cmake.el 
b/packages/company/company-cmake.el
index 0c96eb6..34359dc 100644
--- a/packages/company/company-cmake.el
+++ b/packages/company/company-cmake.el
@@ -1,24 +1,22 @@
 ;;; company-cmake.el --- company-mode completion back-end for CMake
 
-;; Copyright (C) 2013  Chen Bin
+;; Copyright (C) 2013  Free Software Foundation, Inc.
 
 ;; Author: Chen Bin <chenbin DOT sh AT gmail>
 ;; Version: 0.1
 
-;; This file is NOT part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
+;; This program is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation, either version 3 of the License, or
 ;; (at your option) any later version.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
+;; This program is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 ;;
@@ -26,6 +24,8 @@
 ;; commands used by CMake.  And their descriptions.
 
 ;;; Code:
+
+(eval-when-compile (require 'cl))
 (require 'company)
 
 (defgroup company-cmake nil
diff --git a/packages/company/company-eclim.el 
b/packages/company/company-eclim.el
index 05e609c..70db7c3 100644
--- a/packages/company/company-eclim.el
+++ b/packages/company/company-eclim.el
@@ -70,6 +70,7 @@ eclim can only complete correctly when the buffer has been 
saved."
 (make-variable-buffer-local 'company-eclim--doc)
 
 (declare-function json-read "json")
+(defvar json-array-type)
 
 (defun company-eclim--call-process (&rest args)
   (let ((coding-system-for-read 'utf-8)
@@ -109,8 +110,7 @@ eclim can only complete correctly when the buffer has been 
saved."
 (defun company-eclim--candidates (prefix)
   (interactive "d")
   (let ((project-file (file-relative-name buffer-file-name
-                                          (company-eclim--project-dir)))
-        (project-name (company-eclim--project-name)))
+                                          (company-eclim--project-dir))))
     (when company-eclim-auto-save
       (when (buffer-modified-p)
         (basic-save-buffer))
diff --git a/packages/company/company-template.el 
b/packages/company/company-template.el
index 5c72ac8..ea1db86 100644
--- a/packages/company/company-template.el
+++ b/packages/company/company-template.el
@@ -1,6 +1,6 @@
 ;;; company-template.el
 
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2010, 2013 Free Software Foundation, Inc.
 
 ;; Author: Nikolaj Schumacher
 
@@ -34,6 +34,9 @@
     (define-key keymap [tab] 'company-template-forward-field)
     keymap))
 
+(defvar company-template--buffer-templates nil)
+(make-variable-buffer-local 'company-template--buffer-templates)
+
 ;; interactive 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defun company-template-templates-at (pos)
@@ -73,9 +76,6 @@
 
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(defvar company-template--buffer-templates nil)
-(make-variable-buffer-local 'company-template--buffer-templates)
-
 (defun company-template-declare-template (beg end)
   (let ((ov (make-overlay beg end)))
     ;; (overlay-put ov 'face 'highlight)
@@ -134,7 +134,7 @@ Leave point at the end of the field."
 
 ;; hooks 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(defun company-template-insert-hook (ovl after-p &rest ignore)
+(defun company-template-insert-hook (ovl after-p &rest _ignore)
   "Called when a snippet input prompt is modified."
   (unless after-p
     (company-template-remove-field ovl t)))

commit b9e64ec07adfd8afbaf3fbc6d89a069b012f7ad2
Merge: d4a3c58 85d0fa4
Author: Stefan Monnier <address@hidden>
Date:   Wed Aug 21 15:29:34 2013 -0400

    Sync from company/master

diff --cc packages/company/company-cmake.el
index 0000000,0c96eb6..0c96eb6
mode 000000,100644..100644
--- a/packages/company/company-cmake.el
+++ b/packages/company/company-cmake.el

commit 85d0fa41222af8413daf4bd2c54d64c8abc2a2f6
Author: Dmitry Gutov <address@hidden>
Date:   Sun Aug 18 23:35:09 2013 +0300

    Release 0.6.11

diff --git a/NEWS.md b/NEWS.md
index 1bc150f..e1874a0 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,7 +1,9 @@
 # History of user-visible changes
 
-## Next
+## 2013-08-18 (0.6.11)
 
+* `company-template-c-like-templatify` removes all text after closing paren, 
for
+  use in backends that display additional info there.
 * `company-cmake` is now bundled.
 * Better `linum` compatibility in Emacs <= 24.2.
 * `company-global-modes`: New option.

commit fac24aa671caabe804a85f00f2030c3b56bec722
Author: Dmitry Gutov <address@hidden>
Date:   Sat Aug 17 15:52:06 2013 +0300

    company-template-c-like-templatify: Remove text after the closing paren
    
    #31

diff --git a/company-template.el b/company-template.el
index 6ffd648..5c72ac8 100644
--- a/company-template.el
+++ b/company-template.el
@@ -150,6 +150,8 @@ Leave point at the end of the field."
   (let* ((end (point-marker))
          (beg (- (point) (length call)))
          (cnt 0))
+    (when (re-search-backward ")" beg t)
+      (delete-region (match-end 0) end))
     (goto-char beg)
     (when (search-forward "(" end 'move)
       (if (eq (char-after) ?\))
diff --git a/company-tests.el b/company-tests.el
index 9f0e70d..79d1f02 100644
--- a/company-tests.el
+++ b/company-tests.el
@@ -281,6 +281,14 @@
       (should (equal "int a"
                      (overlay-get (company-template-field-at) 'display))))))
 
+(ert-deftest company-template-c-like-templatify-trims-after-closing-paren ()
+  (with-temp-buffer
+    (let ((text "foo(int a, short b)!@ #1334 a"))
+      (insert text)
+      (company-template-c-like-templatify text)
+      (should (equal "foo(arg0, arg1)" (buffer-string)))
+      (should (looking-at "arg0")))))
+
 ;;; Elisp
 
 (defmacro company-elisp-with-buffer (contents &rest body)

commit 5726e141d1c2a5c9993cb05561d8358ae7246e30
Author: Dmitry Gutov <address@hidden>
Date:   Fri Aug 16 01:55:21 2013 +0300

    company-backends: Move company-eclim in front of company-semantic
    
    #30

diff --git a/company.el b/company.el
index cd45c08..40fdfa7 100644
--- a/company.el
+++ b/company.el
@@ -244,7 +244,7 @@ If this many lines are not available, prefer to display the 
tooltip above."
                 (return t))))))
 
 (defcustom company-backends '(company-elisp company-nxml company-css
-                              company-semantic company-clang company-eclim
+                              company-eclim company-semantic company-clang
                               company-xcode company-ropemacs company-cmake
                               (company-gtags company-etags company-dabbrev-code
                                company-keywords)

commit 66e9b043b82dc18bf66399812af573375b058cd8
Author: Dmitry Gutov <address@hidden>
Date:   Sat Aug 10 01:12:09 2013 +0300

    company-eclim: Omit starting '@'
    
    #30

diff --git a/company-eclim.el b/company-eclim.el
index ea0b73e..05e609c 100644
--- a/company-eclim.el
+++ b/company-eclim.el
@@ -144,6 +144,14 @@ eclim can only complete correctly when the buffer has been 
saved."
 (defun company-eclim--meta (candidate)
   (gethash candidate company-eclim--doc))
 
+(defun company-eclim--prefix ()
+  (let ((prefix (company-grab-symbol)))
+    (when prefix
+      ;; Completion candidates for annotations don't include '@'.
+      (when (eq ?@ (string-to-char prefix))
+        (setq prefix (substring prefix 1)))
+      prefix)))
+
 (defun company-eclim (command &optional arg &rest ignored)
   "`company-mode' completion back-end for Eclim.
 Eclim provides access to Eclipse Java IDE features for other editors.
@@ -160,7 +168,7 @@ Completions only work correctly when the buffer has been 
saved.
                  company-eclim-executable
                  (company-eclim--project-name)
                  (not (company-in-string-or-comment))
-                 (or (company-grab-symbol) 'stop)))
+                 (or (company-eclim--prefix) 'stop)))
     (candidates (company-eclim--candidates arg))
     (meta (company-eclim--meta arg))
     ;; because "" doesn't return everything

commit b9840a3cd477063193ab89dd807acffb3b2df171
Author: Dmitry Gutov <address@hidden>
Date:   Fri Aug 9 23:56:47 2013 +0300

    Rename company-cmake-doc-buffer to make it private

diff --git a/company-cmake.el b/company-cmake.el
index cf3ff23..0c96eb6 100644
--- a/company-cmake.el
+++ b/company-cmake.el
@@ -96,7 +96,7 @@ They affect which types of symbols we get completion 
candidates for.")
       (setq result (replace-regexp-in-string "^[ \t\n\r]+" "" result))
       result)))
 
-(defun company-cmake-doc-buffer (prefix)
+(defun company-cmake--doc-buffer (prefix)
   (let ((cmd-opts (gethash prefix company-cmake--meta-command-cache)))
     (with-temp-buffer
       (call-process company-cmake-executable nil t nil cmd-opts prefix)
@@ -122,7 +122,7 @@ CMake is a cross-platform, open-source make system."
                  (company-grab-symbol)))
     (candidates (company-cmake--candidates arg))
     (meta (company-cmake--meta arg))
-    (doc-buffer (company-cmake-doc-buffer arg))
+    (doc-buffer (company-cmake--doc-buffer arg))
     ))
 
 (provide 'company-cmake)

commit 15a5062a17805a8d3a7a6b31ce3f3f805ad9b724
Author: Dmitry Gutov <address@hidden>
Date:   Fri Aug 9 17:16:50 2013 +0300

    Fix company-cmake-doc-buffer

diff --git a/company-cmake.el b/company-cmake.el
index d4f5577..cf3ff23 100644
--- a/company-cmake.el
+++ b/company-cmake.el
@@ -96,18 +96,17 @@ They affect which types of symbols we get completion 
candidates for.")
       (setq result (replace-regexp-in-string "^[ \t\n\r]+" "" result))
       result)))
 
-(defun company-cmake-doc-buffer (candidates)
-  (let ((cmd-opts (gethash prefix company-cmake--meta-command-cache))
-        result)
+(defun company-cmake-doc-buffer (prefix)
+  (let ((cmd-opts (gethash prefix company-cmake--meta-command-cache)))
     (with-temp-buffer
       (call-process company-cmake-executable nil t nil cmd-opts prefix)
-      ;; Go to the third line, trim it and return the result.
+      ;; Go to the third line, trim it and return the doc buffer.
       ;; Tested with cmake 2.8.9.
       (goto-char (point-min))
       (forward-line 2)
-      (setq result (buffer-substring-no-properties (line-beginning-position)
-                                                   (point-max)))
-      result)))
+      (company-doc-buffer
+       (buffer-substring-no-properties (line-beginning-position)
+                                       (point-max))))))
 
 (defun company-cmake (command &optional arg &rest ignored)
   "`company-mode' completion back-end for CMake.

commit f23e059ac1dbc663aa03b764bbdbce6b4e8e9cbc
Author: Dmitry Gutov <address@hidden>
Date:   Fri Aug 9 17:09:29 2013 +0300

    Bundle company-cmake
    
    Fixes #13

diff --git a/NEWS.md b/NEWS.md
index bbbd830..1bc150f 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
 
 ## Next
 
+* `company-cmake` is now bundled.
 * Better `linum` compatibility in Emacs <= 24.2.
 * `company-global-modes`: New option.
 
diff --git a/company-cmake.el b/company-cmake.el
new file mode 100644
index 0000000..d4f5577
--- /dev/null
+++ b/company-cmake.el
@@ -0,0 +1,130 @@
+;;; company-cmake.el --- company-mode completion back-end for CMake
+
+;; Copyright (C) 2013  Chen Bin
+
+;; Author: Chen Bin <chenbin DOT sh AT gmail>
+;; Version: 0.1
+
+;; This file is NOT part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; company-cmake offers completions for module names, variable names and
+;; commands used by CMake.  And their descriptions.
+
+;;; Code:
+(require 'company)
+
+(defgroup company-cmake nil
+  "Completion back-end for CMake."
+  :group 'company)
+
+(defcustom company-cmake-executable
+  (executable-find "cmake")
+  "Location of cmake executable."
+  :type 'file)
+
+(defvar company-cmake-executable-arguments
+  '("--help-command-list"
+    "--help-module-list"
+    "--help-variable-list")
+  "The arguments we pass to cmake, separately.
+They affect which types of symbols we get completion candidates for.")
+
+(defvar company-cmake--completion-pattern
+  "^\\(%s[a-zA-Z0-9_]%s\\)$"
+  "Regexp to match the candidates.")
+
+(defvar company-cmake-modes '(cmake-mode)
+  "Major modes in which cmake may complete.")
+
+(defvar company-cmake--meta-command-cache nil
+  "Cache for command arguments to retrieve descriptions for the candidates.")
+
+(defun company-cmake--parse-output (prefix cmd)
+  "Analyze the temp buffer and collect lines."
+  (goto-char (point-min))
+  (let ((pattern (format company-cmake--completion-pattern
+                         (regexp-quote prefix)
+                         (if (zerop (length prefix)) "+" "*")))
+        (case-fold-search nil)
+        lines match)
+    (while (re-search-forward pattern nil t)
+      (setq match (match-string-no-properties 1))
+      (puthash match cmd company-cmake--meta-command-cache)
+      (push match lines))
+    lines))
+
+(defun company-cmake--candidates (prefix)
+  (let ((res 0)
+        results
+        cmd)
+    (setq company-cmake--meta-command-cache (make-hash-table :test 'equal))
+    (dolist (arg company-cmake-executable-arguments)
+      (with-temp-buffer
+        (setq res (call-process company-cmake-executable nil t nil arg))
+        (unless (eq 0 res)
+          (message "cmake executable exited with error=%d" res))
+        (setq cmd (replace-regexp-in-string "-list$" "" arg) )
+        (setq results (nconc results (company-cmake--parse-output prefix 
cmd)))))
+    results))
+
+(defun company-cmake--meta (prefix)
+  (let ((cmd-opts (gethash prefix company-cmake--meta-command-cache))
+        result)
+    (with-temp-buffer
+      (call-process company-cmake-executable nil t nil cmd-opts prefix)
+      ;; Go to the third line, trim it and return the result.
+      ;; Tested with cmake 2.8.9.
+      (goto-char (point-min))
+      (forward-line 2)
+      (setq result (buffer-substring-no-properties (line-beginning-position)
+                                                   (line-end-position)))
+      (setq result (replace-regexp-in-string "^[ \t\n\r]+" "" result))
+      result)))
+
+(defun company-cmake-doc-buffer (candidates)
+  (let ((cmd-opts (gethash prefix company-cmake--meta-command-cache))
+        result)
+    (with-temp-buffer
+      (call-process company-cmake-executable nil t nil cmd-opts prefix)
+      ;; Go to the third line, trim it and return the result.
+      ;; Tested with cmake 2.8.9.
+      (goto-char (point-min))
+      (forward-line 2)
+      (setq result (buffer-substring-no-properties (line-beginning-position)
+                                                   (point-max)))
+      result)))
+
+(defun company-cmake (command &optional arg &rest ignored)
+  "`company-mode' completion back-end for CMake.
+CMake is a cross-platform, open-source make system."
+  (interactive (list 'interactive))
+  (case command
+    (interactive (company-begin-backend 'company-cmake))
+    (init (when (memq major-mode company-cmake-modes)
+            (unless company-cmake-executable
+              (error "Company found no cmake executable"))))
+    (prefix (and (memq major-mode company-cmake-modes)
+                 (not (company-in-string-or-comment))
+                 (company-grab-symbol)))
+    (candidates (company-cmake--candidates arg))
+    (meta (company-cmake--meta arg))
+    (doc-buffer (company-cmake-doc-buffer arg))
+    ))
+
+(provide 'company-cmake)
+;;; company-cmake.el ends here
diff --git a/company.el b/company.el
index f8d4a46..cd45c08 100644
--- a/company.el
+++ b/company.el
@@ -215,6 +215,7 @@ If this many lines are not available, prefer to display the 
tooltip above."
   '((company-abbrev . "Abbrev")
     (company-capf . "completion-at-point-functions")
     (company-clang . "Clang")
+    (company-cmake . "CMake")
     (company-css . "CSS")
     (company-dabbrev . "dabbrev for plain text")
     (company-dabbrev-code . "dabbrev for code")
@@ -244,7 +245,7 @@ If this many lines are not available, prefer to display the 
tooltip above."
 
 (defcustom company-backends '(company-elisp company-nxml company-css
                               company-semantic company-clang company-eclim
-                              company-xcode company-ropemacs
+                              company-xcode company-ropemacs company-cmake
                               (company-gtags company-etags company-dabbrev-code
                                company-keywords)
                               company-oddmuse company-files company-dabbrev)

commit 35e64f3ae391715d9344265c7afc0ac798239f85
Author: Dmitry Gutov <address@hidden>
Date:   Tue Aug 6 20:26:07 2013 +0300

    Use `after-string' instead of `before-string'
    
    Fixes #28

diff --git a/NEWS.md b/NEWS.md
index ec83011..bbbd830 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
 
 ## Next
 
+* Better `linum` compatibility in Emacs <= 24.2.
 * `company-global-modes`: New option.
 
 ## 2013-05-26 (0.6.10)
diff --git a/company-tests.el b/company-tests.el
index 9f837cb..9f0e70d 100644
--- a/company-tests.el
+++ b/company-tests.el
@@ -195,7 +195,7 @@
         ;; FIXME: Make it 2?
         (should (eq (overlay-get ov 'company-height) company-tooltip-limit))
         (should (eq (overlay-get ov 'company-column) col))
-        (should (string= (overlay-get ov 'company-before)
+        (should (string= (overlay-get ov 'company-after)
                          " 123\nc45 c\nddd\n")))))))
 
 (ert-deftest company-column-with-composition ()
diff --git a/company.el b/company.el
index 861b422..f8d4a46 100644
--- a/company.el
+++ b/company.el
@@ -1839,7 +1839,7 @@ Returns a negative number if the tooltip should be 
displayed above point."
         (overlay-put ov 'company-replacement-args args)
 
         (let ((lines (company--create-lines selection (abs height))))
-          (overlay-put ov 'company-before
+          (overlay-put ov 'company-after
                        (apply 'company--replacement-string lines args))
           (overlay-put ov 'company-width (string-width (car lines))))
 
@@ -1853,7 +1853,7 @@ Returns a negative number if the tooltip should be 
displayed above point."
 
 (defun company-pseudo-tooltip-edit (selection)
   (let ((height (overlay-get company-pseudo-tooltip-overlay 'company-height)))
-    (overlay-put company-pseudo-tooltip-overlay 'company-before
+    (overlay-put company-pseudo-tooltip-overlay 'company-after
                  (apply 'company--replacement-string
                         (company--create-lines selection (abs height))
                         (overlay-get company-pseudo-tooltip-overlay
@@ -1868,7 +1868,7 @@ Returns a negative number if the tooltip should be 
displayed above point."
   (when (overlayp company-pseudo-tooltip-overlay)
     (overlay-put company-pseudo-tooltip-overlay 'invisible nil)
     (overlay-put company-pseudo-tooltip-overlay 'line-prefix nil)
-    (overlay-put company-pseudo-tooltip-overlay 'before-string nil)))
+    (overlay-put company-pseudo-tooltip-overlay 'after-string nil)))
 
 (defun company-pseudo-tooltip-unhide ()
   (when company-pseudo-tooltip-overlay
@@ -1877,8 +1877,8 @@ Returns a negative number if the tooltip should be 
displayed above point."
     (overlay-put company-pseudo-tooltip-overlay 'priority 1)
     ;; No (extra) prefix for the first line.
     (overlay-put company-pseudo-tooltip-overlay 'line-prefix "")
-    (overlay-put company-pseudo-tooltip-overlay 'before-string
-                 (overlay-get company-pseudo-tooltip-overlay 'company-before))
+    (overlay-put company-pseudo-tooltip-overlay 'after-string
+                 (overlay-get company-pseudo-tooltip-overlay 'company-after))
     (overlay-put company-pseudo-tooltip-overlay 'window (selected-window))))
 
 (defun company-pseudo-tooltip-guard ()

commit 7c76330fceee2b6901e61ce3bedb5b76b253d828
Author: Dmitry Gutov <address@hidden>
Date:   Tue Aug 6 14:55:08 2013 +0300

    Introduce company-global-modes
    
    Closes #29

diff --git a/NEWS.md b/NEWS.md
index 64860ba..ec83011 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,9 @@
 # History of user-visible changes
 
+## Next
+
+* `company-global-modes`: New option.
+
 ## 2013-05-26 (0.6.10)
 
 * Plays nicer with `org-indent-mode`.
diff --git a/company.el b/company.el
index 46f7c8f..861b422 100644
--- a/company.el
+++ b/company.el
@@ -523,11 +523,33 @@ keymap during active completions (`company-active-map'):
     (company-cancel)
     (kill-local-variable 'company-point)))
 
+(defcustom company-global-modes t
+  "Modes for which `company-mode' mode is turned on by `global-company-mode'.
+If nil, means no modes.  If t, then all major modes have it turned on.
+If a list, it should be a list of `major-mode' symbol names for which
+`company-mode' should be automatically turned on.  The sense of the list is
+negated if it begins with `not'.  For example:
+ (c-mode c++-mode)
+means that `company-mode' is turned on for buffers in C and C++ modes only.
+ (not message-mode)
+means that `company-mode' is always turned on except in `message-mode' 
buffers."
+  :type '(choice (const :tag "none" nil)
+                 (const :tag "all" t)
+                 (set :menu-tag "mode specific" :tag "modes"
+                      :value (not)
+                      (const :tag "Except" not)
+                      (repeat :inline t (symbol :tag "mode")))))
+
 ;;;###autoload
 (define-globalized-minor-mode global-company-mode company-mode company-mode-on)
 
 (defun company-mode-on ()
-  (unless (or noninteractive (eq (aref (buffer-name) 0) ?\s))
+  (when (and (not (or noninteractive (eq (aref (buffer-name) 0) ?\s)))
+             (cond ((eq company-global-modes t)
+                    t)
+                   ((eq (car-safe company-global-modes) 'not)
+                    (not (memq major-mode (cdr company-global-modes))))
+                   (t (memq major-mode company-global-modes))))
     (company-mode 1)))
 
 (defsubst company-assert-enabled ()

commit 5ad905a6aaf79c4f2a0018cd954e1414e542fff4
Author: Chen Bin <address@hidden>
Date:   Sun Jul 28 13:01:51 2013 +0300

    Separate executable from arguments in the error output buffer
    
    Fixes #27

diff --git a/company-clang.el b/company-clang.el
index 52bb6e6..6d1737a 100644
--- a/company-clang.el
+++ b/company-clang.el
@@ -145,7 +145,7 @@ or automatically through a custom 
`company-clang-prefix-guesser'."
 (defun company-clang--handle-error (res args)
   (goto-char (point-min))
   (let* ((buf (get-buffer-create company-clang--error-buffer-name))
-         (cmd (concat company-clang-executable (mapconcat 'identity args " ")))
+         (cmd (concat company-clang-executable " " (mapconcat 'identity args " 
")))
          (pattern (format company-clang--completion-pattern ""))
          (err (if (re-search-forward pattern nil t)
                   (buffer-substring-no-properties (point-min)

commit f6e5180bb1ac5c873885149325e1c63202a26f45
Author: Dmitry Gutov <address@hidden>
Date:   Tue Jun 4 03:16:34 2013 +0400

    Fix #24, take three

diff --git a/company.el b/company.el
index 39a3a17..46f7c8f 100644
--- a/company.el
+++ b/company.el
@@ -1845,6 +1845,7 @@ Returns a negative number if the tooltip should be 
displayed above point."
 (defun company-pseudo-tooltip-hide-temporarily ()
   (when (overlayp company-pseudo-tooltip-overlay)
     (overlay-put company-pseudo-tooltip-overlay 'invisible nil)
+    (overlay-put company-pseudo-tooltip-overlay 'line-prefix nil)
     (overlay-put company-pseudo-tooltip-overlay 'before-string nil)))
 
 (defun company-pseudo-tooltip-unhide ()

-----------------------------------------------------------------------

Summary of changes:
 packages/company/NEWS.md             |    8 ++
 packages/company/company-clang.el    |    2 +-
 packages/company/company-cmake.el    |  129 ++++++++++++++++++++++++++++++++++
 packages/company/company-eclim.el    |   14 +++-
 packages/company/company-template.el |   12 ++--
 packages/company/company-tests.el    |   10 +++-
 packages/company/company.el          |   40 ++++++++--
 7 files changed, 197 insertions(+), 18 deletions(-)
 create mode 100644 packages/company/company-cmake.el


hooks/post-receive
-- 
ELPA



reply via email to

[Prev in Thread] Current Thread [Next in Thread]