[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a4d0421 05/29: Modified for the original frontends to work
From: |
Dmitry Gutov |
Subject: |
[elpa] master a4d0421 05/29: Modified for the original frontends to work |
Date: |
Tue, 28 Mar 2017 20:50:34 -0400 (EDT) |
branch: master
commit a4d0421d4b13e5d69c3d09c231d494f61c8dd4c2
Author: Kiso Katsuyuki <address@hidden>
Commit: Kiso Katsuyuki <address@hidden>
Modified for the original frontends to work
The preview function company-preview-show-at-point
can take the argument of 'common' flag.
By this change, the following frontends work well.
- company-preview-frontend
- company-preview-if-just-one-frontend (default)
- company-preview-common-frontend (newly added)
In the configuration of customized variable company-frontends
the docstring of company-preview-common-frontend was also modified.
---
company.el | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/company.el b/company.el
index ac96146..d8123d7 100644
--- a/company.el
+++ b/company.el
@@ -242,7 +242,7 @@ The visualized data is stored in `company-prefix',
`company-candidates',
(const :tag "preview" company-preview-frontend)
(const :tag "preview, unique only"
company-preview-if-just-one-frontend)
- (const :tag "preview, unique and common part"
+ (const :tag "preview, common"
company-preview-common-frontend)
(function :tag "custom function" nil))))
@@ -2916,10 +2916,10 @@ Delay is determined by `company-tooltip-idle-delay'."
(defvar-local company-preview-overlay nil)
-(defun company-preview-show-at-point (pos)
+(defun company-preview-show-at-point (pos &optional common)
(company-preview-hide)
- (let ((completion (if (cdr company-candidates) company-common (nth
company-selection company-candidates))))
+ (let ((completion (if common company-common (nth company-selection
company-candidates))))
(setq completion (copy-sequence (company--pre-render completion)))
(font-lock-append-text-property 0 (length completion)
'face 'company-preview
@@ -2967,11 +2967,11 @@ Delay is determined by `company-tooltip-idle-delay'."
(delete-overlay company-preview-overlay)
(setq company-preview-overlay nil)))
-(defun company-preview-frontend (command)
+(defun company-preview-frontend (command &optional common)
"`company-mode' frontend showing the selection as if it had been inserted."
(pcase command
(`pre-command (company-preview-hide))
- (`post-command (company-preview-show-at-point (point)))
+ (`post-command (company-preview-show-at-point (point) common))
(`hide (company-preview-hide))))
(defun company-preview-if-just-one-frontend (command)
@@ -3001,7 +3001,7 @@ Delay is determined by `company-tooltip-idle-delay'."
"`company-preview-frontend', but only shown for single candidates."
(when (or (not (eq command 'post-command))
(company--show-common-inline-p))
- (company-preview-frontend command)))
+ (company-preview-frontend command t)))
;;; echo
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- [elpa] master 0499c02 02/29: company-keywords-alist: add enh-ruby-mode -> ruby-mode alias, (continued)
- [elpa] master 0499c02 02/29: company-keywords-alist: add enh-ruby-mode -> ruby-mode alias, Dmitry Gutov, 2017/03/28
- [elpa] master 92b0bf7 06/29: Use pipes instead of PTYs to receive output from Clang, Dmitry Gutov, 2017/03/28
- [elpa] master 6f2ae7f 09/29: Merge pull request #621 from juergenhoetzel/use-pipes, Dmitry Gutov, 2017/03/28
- [elpa] master 21357f6 11/29: Update NEWS, Dmitry Gutov, 2017/03/28
- [elpa] master bc2ce4e 18/29: Support Tramp in company-gtags, Dmitry Gutov, 2017/03/28
- [elpa] master b1127da 16/29: Don't show (anonymous) as function annotation, or in argument expansions, Dmitry Gutov, 2017/03/28
- [elpa] master 31063e1 20/29: Fix company-auto-complete and electric-pair-mode compatibility, Dmitry Gutov, 2017/03/28
- [elpa] master cf98238 04/29: Preview the common part of completion candidates, Dmitry Gutov, 2017/03/28
- [elpa] master 40e2200 07/29: Preview func take the exact common part, Dmitry Gutov, 2017/03/28
- [elpa] master a2ec806 12/29: Use tramp-aware `start-file-process' to start completion process, Dmitry Gutov, 2017/03/28
- [elpa] master a4d0421 05/29: Modified for the original frontends to work,
Dmitry Gutov <=
- [elpa] master 1c516df 01/29: Increase the minimum Emacs version dependency, Dmitry Gutov, 2017/03/28
- [elpa] master c494fc6 17/29: Fix a failing test, Dmitry Gutov, 2017/03/28
- [elpa] master ec12e27 27/29: Merge branch 'master' of github.com:company-mode/company-mode, Dmitry Gutov, 2017/03/28
- [elpa] master f149940 28/29: Release 0.9.3, Dmitry Gutov, 2017/03/28
- [elpa] master ce42fcf 23/29: Update copyright years, Dmitry Gutov, 2017/03/28
- [elpa] master 7bd93b8 15/29: Merge pull request #629 from juergenhoetzel/tramp-aware-clang, Dmitry Gutov, 2017/03/28
- [elpa] master 51f3885 10/29: Merge pull request #618 from kkatsuyuki/preview-common, Dmitry Gutov, 2017/03/28
- [elpa] master b74f329 22/29: Track the changes in window width, Dmitry Gutov, 2017/03/28
- [elpa] master 0affd93 21/29: Fix the new test to work in Emacs 24, Dmitry Gutov, 2017/03/28
- [elpa] master f0ff54e 13/29: company-diag: Also show completions if prefix is a cons, Dmitry Gutov, 2017/03/28