diff options
author | Tom Willemse | 2019-05-23 07:57:01 -0700 |
---|---|---|
committer | Tom Willemse | 2019-05-23 07:57:01 -0700 |
commit | 893c9e22492fc2c4a42a433d2cedd97040604965 (patch) | |
tree | 0eab55aad2f6c5ccc08bcb02f5fb58fd911a17af | |
parent | a990b9d4d91107135d40ee85e0d8e8eb07c36e85 (diff) | |
download | emacs-config-893c9e22492fc2c4a42a433d2cedd97040604965.tar.gz emacs-config-893c9e22492fc2c4a42a433d2cedd97040604965.zip |
Enable company-posframe as late as possible
‘company-posframe’ checks to see if posframe can actually work. Unfortunately it
thinks it can’t work when the first frame is created. So instead only enable
‘company-posframe-mode’ when company starts trying to complete something.
-rw-r--r-- | oni-company.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/oni-company.el b/oni-company.el index 74aa826..2153f46 100644 --- a/oni-company.el +++ b/oni-company.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 20190523070353 +;; Version: 20190523075637 ;; Package-Requires: (company company-posframe diminish) ;; This program is free software; you can redistribute it and/or modify @@ -31,6 +31,13 @@ (require 'company-posframe) (require 'diminish) +(defun oni-company--enable-posframe (_) + "Enable posframe and remove this function from the hook." + (when (display-graphic-p) + (company-posframe-mode) + (remove-hook 'company-completion-started-hook + 'oni-company--enable-posframe))) + (setq company-dabbrev-ignore-case nil) (setq company-idle-delay 0.2) (setq company-tooltip-align-annotations t) @@ -40,10 +47,10 @@ company-echo-metadata-frontend company-preview-frontend)) -(company-posframe-mode) +(add-hook 'company-completion-started-hook 'oni-company--enable-posframe) (diminish 'company-mode) -(diminish 'company-posrame-mode) +(diminish 'company-posframe-mode) ;;;###autoload(with-eval-after-load 'company (require 'oni-company)) |