oneKelvinSmith / monokai-emacs

Monokai for Emacs is a port of the popular TextMate theme Monokai by Wimer Hazenberg.
GNU General Public License v3.0
459 stars 119 forks source link

'Invalid face box' with emacs trunk on xterm-256color #118

Open asurati opened 10 months ago

asurati commented 10 months ago

Based on the emacs source code within the file xfaces.c around the error Invalid face box, and on the documentation of :box, the attribute :style does not accept an unspecified value. That value causes the enclosing loop to terminate prematurely, thereby setting valid_p to false, causing the error.

The diff that fixes the issue for xterm-256color is attached. It is based on commit 4a09c59. The attributes affected belong to the class monokai-256-class.

Although I have not tested with the X11 GUI emacs, the monokai-class, which seems to be applicable to GUI, is likely to be affected too; that class also contains instances of :style attributes with unspecified value that may need fixing.

With TERM=xterm, the error does not occur.

Edit: For some reason, the text file containing the diff does not attach. The elements that are affected by this issue are mode-line, mode-line-inactive and header-line.

Thank you.

jamesmatanle commented 6 months ago

Reproduced on startup of emacs on mac, opened a PR that fixes it https://github.com/oneKelvinSmith/monokai-emacs/pull/120

Warning (initialization): An error occurred while loading ‘~/.emacs.d/init.el’:

error: Invalid face box, :color, #64645E, :line-width, 1, :style, unspecified