Use company-emoji's setup code

This commit is contained in:
contrapunctus 2022-02-12 17:59:58 +05:30
parent b60870fd37
commit 922fd20f3b
1 changed files with 9 additions and 6 deletions

View File

@ -3383,8 +3383,16 @@ But with =initials=, the desired completion is often buried in the results. That
#+BEGIN_SRC emacs-lisp
(use-package company-emoji
:ensure t
:hook (text-mode . company-emoji-init)
:hook
(text-mode . company-mode)
(text-mode . company-emoji-init)
:init (--set-emoji-font nil) ;; For when Emacs is started in GUI mode:
(add-hook 'after-make-frame-functions '--set-emoji-font) ;; Hook for when a frame is created with emacsclient
:config (add-to-list 'company-backends 'company-emoji))
(defun --set-emoji-font (frame)
"Adjust the font settings of FRAME so Emacs can display emoji properly."
(set-fontset-font t 'symbol (font-spec :family "Symbola") frame 'prepend))
#+END_SRC
** company-prescient
@ -5379,10 +5387,6 @@ nicked from wasamasa's init - https://github.com/wasamasa/dotemacs/blob/934d0b37
#+END_SRC
#+BEGIN_SRC emacs-lisp
(defun my-fix-emojis (&optional frame)
(set-fontset-font "fontset-default" nil "Symbola" frame 'append))
(my-fix-emojis)
(add-hook 'after-make-frame-functions 'my-fix-emojis)
;; (set-face-attribute 'default nil :font "-outline-Bitstream Vera Sans Mono-normal-normal-normal-mono-12-*-*-*-c-*-iso8859-1")
#+END_SRC
@ -5455,7 +5459,6 @@ https://emacs.stackexchange.com/questions/31621/handle-stale-desktop-lock-files-
;; (add-hook 'desktop-save-hook 'cp/backup-desktop-file)
;; ;; not enough space for this - wasteful
;; (add-hook 'kill-emacs-hook 'cp/backup-desktop-file)
#+END_SRC
* The end