[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 28/31: company-semantic: don't try to fetch doc for tag without b
From: |
Dmitry Gutov |
Subject: |
[elpa] 28/31: company-semantic: don't try to fetch doc for tag without buffer |
Date: |
Tue, 18 Mar 2014 05:19:39 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit 6d892691ae5cb3747538930051eea97cc558a750
Author: Dmitry Gutov <address@hidden>
Date: Mon Mar 17 21:17:36 2014 +0200
company-semantic: don't try to fetch doc for tag without buffer
Fixes #74
---
company-semantic.el | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/company-semantic.el b/company-semantic.el
index 4fddf28..617388a 100644
--- a/company-semantic.el
+++ b/company-semantic.el
@@ -53,19 +53,25 @@
"Tags for the current context.")
(make-variable-buffer-local 'company-semantic--current-tags)
+(defun company-semantic-documentation-for-tag (tag)
+ (when (semantic-tag-buffer tag)
+ ;; When TAG's buffer is unknown, the function below raises an error.
+ (semantic-documentation-for-tag tag)))
+
(defun company-semantic-doc-or-summary (tag)
- (or (semantic-documentation-for-tag tag)
+ (or (company-semantic-documentation-for-tag tag)
(and (require 'semantic-idle nil t)
(require 'semantic/idle nil t)
(funcall semantic-idle-summary-function tag nil t))))
(defun company-semantic-summary-and-doc (tag)
- (let ((doc (semantic-documentation-for-tag tag))
+ (debug)
+ (let ((doc (company-semantic-documentation-for-tag tag))
(summary (funcall semantic-idle-summary-function tag nil t)))
(and (stringp doc)
(string-match "\n*\\(.*\\)$" doc)
(setq doc (match-string 1 doc)))
- (concat (funcall semantic-idle-summary-function tag nil t)
+ (concat summary
(when doc
(if (< (+ (length doc) (length summary) 4) (window-width))
" -- "
@@ -73,7 +79,7 @@
doc)))
(defun company-semantic-doc-buffer (tag)
- (let ((doc (semantic-documentation-for-tag tag)))
+ (let ((doc (company-semantic-documentation-for-tag tag)))
(when doc
(company-doc-buffer
(concat (funcall semantic-idle-summary-function tag nil t)
- [elpa] 18/31: company--multi-backend-adapter: noop when arg is empty, (continued)
- [elpa] 18/31: company--multi-backend-adapter: noop when arg is empty, Dmitry Gutov, 2014/03/18
- [elpa] 16/31: Tag candidates from grouped backends, Dmitry Gutov, 2014/03/18
- [elpa] 17/31: Add company-yasnippet, Dmitry Gutov, 2014/03/18
- [elpa] 22/31: company-sort-by-occurrence: do stable sorting, Dmitry Gutov, 2014/03/18
- [elpa] 20/31: Fix company-yasnippet summary, Dmitry Gutov, 2014/03/18
- [elpa] 23/31: Define company-version, Dmitry Gutov, 2014/03/18
- [elpa] 24/31: company-yasnippet: autoload, to make it easy to use separately, Dmitry Gutov, 2014/03/18
- [elpa] 27/31: company-semantic--current-tags: make buffer-local, Dmitry Gutov, 2014/03/18
- [elpa] 25/31: company-keywords-alist: add missing question mark, Dmitry Gutov, 2014/03/18
- [elpa] 29/31: Remove leftover debug statement, Dmitry Gutov, 2014/03/18
- [elpa] 28/31: company-semantic: don't try to fetch doc for tag without buffer,
Dmitry Gutov <=
- [elpa] 08/31: Wrap `company-call-backend' in `condition-case', Dmitry Gutov, 2014/03/18
- [elpa] 26/31: Support the keyword :with, Dmitry Gutov, 2014/03/18
- [elpa] 30/31: Release 0.7.1, Dmitry Gutov, 2014/03/18
- [elpa] 31/31: Merge commit '7be4321260f0c73ef4c3cadc646f6bb496650253' from company, Dmitry Gutov, 2014/03/18
- [elpa] 21/31: company-init-backend: don't try to initialize lambdas, Dmitry Gutov, 2014/03/18
- [elpa] 03/31: Remove company-bbdb-records, it was unused, Dmitry Gutov, 2014/03/18
- [elpa] 02/31: Declare bbdb functions, instead of requiring it, Dmitry Gutov, 2014/03/18
- [elpa] 06/31: Hopefully fix the Emacs 23 breakage, Dmitry Gutov, 2014/03/18