emacs-circe / circe

Circe, a Client for IRC in Emacs
GNU General Public License v3.0
390 stars 51 forks source link

Support Emacs 28's emojis #395

Closed dertuxmalwieder closed 3 years ago

dertuxmalwieder commented 3 years ago

From the NEWS file:

Smileys can now be rendered with emojis instead of small images when using the new 'emoji' value in 'smiley-style'.

As smiley.el seems to be - per Gnus - a part of GNU Emacs these days, it might be a not entirely bad idea to integrate it in Circe?

wasamasa commented 3 years ago

This feature is part of a yet to be released Emacs version, so no. Circe supports Emacs 24.4 and above.

Thaodan commented 2 years ago

Would it be worth to reopen this now that Emacs 28.1 has been released?

Note this can be achieved by doing this:

;; Use "C-x 8 RET <type name>"
(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 "Noto Color Emoji") frame)
  (set-fontset-font t 'symbol (font-spec :family "Segoe UI Emoji") frame 'append)
  (set-fontset-font t 'symbol (font-spec :family "Symbola") frame 'append))
;; For when Emacs is started in GUI mode:
(--set-emoji-font nil)
;; Hook for when a frame is created with emacsclient
;; see https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Frames.html
(add-hook 'after-make-frame-functions '--set-emoji-font)

source: dmacs/emacs/init.org#emoji-font

Enabling Unicode icons in emoji mode also helps (emojify-display-style -> unicode).

wasamasa commented 2 years ago

I've looked at smiley.el again and all it does is replacing smileys like :-) with a small image or emoji. That's different from what I've expected (turning emoji glyphs into pretty pictures) and unrelated to the other suggestion (using a supported emoji color font to automatically turn all emoji glyphs into pretty pictures).

In Emacs 28.1, Noto Color Emoji and Symbola are already used, so unless you're on a Win32 system (which might only have Segoe UI), the above customization should not be needed.