From 97812583f075a159e251f040cac0c1c5ceb86f1f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 22 Apr 2018 23:41:53 -0400 Subject: [PATCH] completion/company: add company-box config & +childframe flag --- modules/completion/company/config.el | 26 ++++++++++++++++++-------- modules/ui/posframe/config.el | 15 --------------- modules/ui/posframe/packages.el | 2 -- 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/modules/completion/company/config.el b/modules/completion/company/config.el index c74963b4b..842e42e97 100644 --- a/modules/completion/company/config.el +++ b/modules/completion/company/config.el @@ -50,18 +50,28 @@ MODES should be one major-mode symbol or a list of them." (def-package! company-statistics - :after company - :config - (setq company-statistics-file (concat doom-cache-dir "company-stats-cache.el")) - (quiet! (company-statistics-mode +1))) + :hook (company-mode . company-statistics-mode) + :config (setq company-statistics-file (concat doom-cache-dir "company-stats-cache.el"))) -;; Looks ugly on OSX without emacs-mac build (def-package! company-quickhelp - :after company + :unless (and EMACS26+ (featurep! +childframe)) + :hook (company-mode . company-quickhelp-mode) + :config (setq company-quickhelp-delay nil)) + + +(def-package! company-box + :when (and EMACS26+ (featurep! +childframe)) + :hook (company-mode . company-box-mode) :config - (setq company-quickhelp-delay nil) - (company-quickhelp-mode +1)) + (setq company-box-backends-colors nil + company-box-icons-elisp + (list (concat (all-the-icons-material "functions") " ") + (concat (all-the-icons-material "check_circle") " ") + (concat (all-the-icons-material "stars") " ") + (concat (all-the-icons-material "format_paint") " ")) + company-box-icons-unknown (concat (all-the-icons-material "find_in_page") " ") + company-box-icons-yasnippet (concat (all-the-icons-material "short_text") " "))) (def-package! company-dict diff --git a/modules/ui/posframe/config.el b/modules/ui/posframe/config.el index 92ef72d3b..5dd7af23d 100644 --- a/modules/ui/posframe/config.el +++ b/modules/ui/posframe/config.el @@ -7,21 +7,6 @@ (add-hook 'doom-escape-hook #'+posframe|delete-on-escape)) -(def-package! company-box - :when EMACS26+ - :hook (company-mode . company-box-mode) - :config - (setq company-frontends (delq 'company-pseudo-tooltip-frontend company-frontends) - company-box-icons-elisp - (list (concat (all-the-icons-material "functions") " ") - (concat (all-the-icons-material "check_circle") " ") - (concat (all-the-icons-material "stars") " ") - (concat (all-the-icons-material "format_paint") " ")) - company-box-icons-unknown (concat (all-the-icons-material "find_in_page") " ") - company-box-backends-colors nil - company-box-icons-yasnippet (concat (all-the-icons-material "short_text") " "))) - - (def-package! ivy-posframe :when EMACS26+ :hook (ivy-mode . ivy-posframe-enable) diff --git a/modules/ui/posframe/packages.el b/modules/ui/posframe/packages.el index 7d57cf40e..b5013939f 100644 --- a/modules/ui/posframe/packages.el +++ b/modules/ui/posframe/packages.el @@ -2,7 +2,5 @@ ;;; ui/posframe/packages.el (when EMACS26+ - (when (featurep! :completion company) - (package! company-box)) (when (featurep! :completion ivy) (package! ivy-posframe)))