emacs-emojify icon indicating copy to clipboard operation
emacs-emojify copied to clipboard

Is there a way to exclude individual emojis?

Open arozbiz opened this issue 3 years ago • 3 comments

Is there a way to exclude individual emojis from being displayed? Specifically, I don't want the text D: to ever be displayed as an emojy.

arozbiz avatar Sep 17 '22 17:09 arozbiz

I think you need to remove these emojis from emojify-emojis and emojify-emojis and then call emojify-set-emoji-data

ag91 avatar Nov 25 '24 22:11 ag91

I think you need to remove these emojis from emojify-emojis and emojify-emojis and then call emojify-set-emoji-data

Sorry, but your reply is a little confusing because it names the same variable twice. I have now spent the best part of an hour trying to prevent the ▶ character from being rendered in Unicode.

Could somebody perhaps provide a working solution or a guide for excluding specific single characters from being emojified?

Many thanks!

Keyhabit avatar Sep 05 '25 20:09 Keyhabit

Just found a working solution:

;; Define and install the inhibit function once emojify is loaded:
(with-eval-after-load 'emojify
  (defun my/emojify-inhibit-triangle (text beg end)
    "Inhibit rendering of ▶ by emojify."
    (string= text "▶"))
  (add-to-list 'emojify-inhibit-functions #'my/emojify-inhibit-triangle))

Keyhabit avatar Sep 05 '25 20:09 Keyhabit