Re: Blocking emoji/grapheme clusters from breaking your terminal

Eli Zaretskii <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
> From: Phillip Susi <[email protected]>
> Cc: [email protected]
> Date: Fri, 06 Mar 2026 14:49:18 -0500
> 
> Eli Zaretskii <[email protected]> writes:
> 
> > "Refuse" and do what instead?  Please be more specific.
> 
> Print some sort of generic ? character instead, kind of like how the GUI
> does when your font doesn't have that glyph.

You could customize glyphless-char-display to tell Emacs to display
Emoji as hex-code or empty-box.  glyphless-char-display is a
char-table which you can customize by using set-char-table-range to
make a range of codepoints display as hex-code \uNNNN or as empty-box
"[  ]".  Here's an example, for one block of Emoji:

  (set-char-table-range glyphless-char-display
                        '(#x1f600 . #x1f6ff)
                        'hex-code)

You will need to do the same for any other range of character
codepoints that Emacs has trouble displaying on your terminal.
If you also sometimes use a GUI Emacs, you could use a cons cell
'(nil . hex-code) instead of 'hex-code, to leave the Emoji display on
GUI frames as usual.  See the node "Glyphless Chars" in the ELisp
manual for more details.

> > Why don't you use GUI Emacs instead?
> 
> I run emacs-notmuch on my mail server via ssh.

Ssh supports X forwarding, so you could use a GUI Emacs even when you
log into a remote server and run Emacs there.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.