2

There is a strange icon appearing in place of colons (:) in my Python buffers. I cannot identify it easily using C-x = or any other command to inspect the character at the point because the icon switches back to a colon when the cursor is on the same line, or when the region containing the icon is selected. I've got some screenshots.

Here you can see all the :'s have been replaced with flying trashcans.

enter image description here

When I move the cursor to line 46, highlighting that line:

enter image description here

the symbol is no longer displayed.

I am using eglot, Fira Code font, ligatures using prettify-symbols as documented here. I'm on Spacemacs develop, emacs 27.0.50, OSX Catalina. I have been using this configuration for quite some time and these symbols only just appeared this morning. I'm not aware of having updated anything.

Restarting emacs resolved the issue, but I'm still curious if anyone has ideas about:

1) What happened here?

2) If restarting hadn't worked, how could I go about identifying the face or symbol being displayed for a character that only appears when the point isn't on it?

Metropolis
  • 529
  • 2
  • 16

1 Answers1

0

This is due to either not having the proper font installed, or having another font with ligatures being loaded instead of the expected font.

Using Fira Code Mode is one possible resolution that works for me with the following use-package config:

(use-package fira-code-mode
    :config (fira-code-mode-set-font)
    :custom (fira-code-mode-disabled-ligatures '("[]" "x"))  ; ligatures you don't want
    :hook prog-mode) 

And to download the fonts, run M-x fira-code-mode-install-fonts

This replaces the prettify-symbols approach described in the link in the question (and is in fact now referenced in that link).

Metropolis
  • 529
  • 2
  • 16