domtronn / all-the-icons.el

A utility package to collect various Icon Fonts and propertize them within Emacs.
MIT License
1.46k stars 177 forks source link

Issue with file-icons #326

Open derinsh0 opened 2 years ago

derinsh0 commented 2 years ago

For some reason, file-icons font will not show sometimes. xE296 is the icon for emacs. In emacs-lisp-mode it will show up fine. In spacemacs home-buffer it will not. In apropos and some assorted help buffers it will not.

There are two emacs icons for some reason, one called "elisp" the other "emacs" with identical hex. When doing describe-char on either of them, on the second line the first character is unrendered but the character in (displayed as ..) is visible.


             position: 10481 of 14343 (73%), column: 0
             character:  (displayed as ) (codepoint 59686, #o164446, #xe926)
             charset: unicode (Unicode (ISO10646))
             code point in charset: 0xE926
             syntax: w  which means: word
             category: L:Strong L2R
             to input: type "C-x 8 RET e926"
          buffer code: #xEE #xA4 #xA6
            file code: #xEE #xA4 #xA6 (encoded by coding system utf-8)
              display: by this font (glyph code):
    harfbuzz:-outline-file-icons-regular-normal-normal-*-41-*-*-*-p-*-iso8859-1 (#xA3)

Character code properties: customize what to show
  general-category: Co (Other, Private Use)
  decomposition: (59686) ('')

There are text properties here:
  display              (raise -0.24)
  font-lock-face       (:family "file-icons" :height 2.4)
  fontified            t
  rear-nonsticky       t

In ielm, (all-the-icons-insert-icons-for 'fileicon) will give you a list of working icons in your input field, but when you send it for evaluation the printed list has many non-working icons.

all-the-icons-icon-for-file and all-the-icons-icon-for-mode will return unrendered icons as well in the minibuffer or ielm.

I have taken screenshots of ielm, first as input to repl, then as a returned output.

input output

derinsh0 commented 2 years ago

Okay I have realized the problem (partly).

The issue is that all-the-icons assigns the file-icon xE296 to the buffer, but not the font-family. Running (all-the-icons-icon-family-for-mode major-mode) gives nil in spacemacs-buffer, even though it will try to give you the icon when you run "icon-for-mode".

I manually added spacemacs-buffer-mode to all-the-icons-mode-icon-alist in all-the-icons.el and the icon is showing.

But I consider this a bug. If all-the-icons insists on a file icon, it should also insist on the file-icons font.

wyuenho commented 2 years ago

Sounds good, care to open a PR?