Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load-theme-buffer-local generating log errors on emacs 24 themes adwaita, whiteboard, and manoj-dark #7

Open
vt5491 opened this issue Mar 14, 2015 · 0 comments

Comments

@vt5491
Copy link

vt5491 commented Mar 14, 2015

There are certain keywords in the theme faces.el files (e.g under '/usr/share/emacs/24.3/etc/themes' ) that cause 'load-theme-buffer-local to spit out tons of messages to the Messages buffer (it's a small number of messages for each event, but there are a lot of events). This is a problem I've had for a while, as reported under item 5 in my previous ticket (#5):

  1. After invoking the theme at the buffer level, I did observe a lot of message on the Messages buffer that look like the following. You basically get these every time you move the cursor in the buffer:
    Invalid face reference: mode-line-buffer-id
    Invalid face attribute :background nil
    Invalid face reference: mode-line-buffer-id

I don't know if this is existing behavior, or it's somehow an effect of how I did it. I suppose I could use my Ubuntu as a control, since it doesn't seem to have a problem with 'flet'. In other words, I need to do more testing.

Well, since then I've been able to determine that this is pre-existing behavior of load-theme-buffer-local. It has nothing to do with the noflet change I submitted, as I am running mint 17.1, which does not have the "flet loss of dynamic binding" problem. I've also been able to determine that 'load-theme' (as opposed to 'load-theme-buffer-local') does not generate these messages on any of the indicated themes.

The affected themes are "adwaita", "manoj-dark", and 'whiteboard". Here is a list of the property and the keyword it doesn't like for each:

adwaita: font-lock-keyword-face :bold t
manoj-dark: font-lock-comment-face :italic
                    mode-line-buffer-id :bold t
whiteboard: mode-line-buffer-id background :nil

On my system, I manually edited the faces file like so, and after cycling emacs and re-establishing the buffer level themes, I no longer get the messages (original is commented out with ;;vt followed by the new line:

adwaita-theme.el
   ;;vt`(font-lock-keyword-face ((,class (:bold t :foreground "#A52A2A"))))
    ;; drop ':bold t'
   `(font-lock-keyword-face ((,class (:foreground "#A52A2A"))))

manoj-dark-theme.el
 ;;vt'(font-lock-comment-face       ((t (:italic t :slant oblique :foreground "chocolate1"))))
 ;; drop ':italic'
 '(font-lock-comment-face       ((t (:slant oblique :foreground "chocolate1"))))

 ;;vt'(mode-line-buffer-id ((t (:background "grey65" :foreground "red"
 ;;vt                                       :bold t :weight bold :height 0.9))))
 ;; drop ':bold t'
 '(mode-line-buffer-id ((t (:background "grey65" :foreground "red"
                                        :weight bold :height 0.9))))

whiteboard-theme.el
   ;; don't let background be nil..default to something like 'coral2'
   ;;vt`(mode-line-buffer-id ((,class (:weight bold :background nil :foreground "blue4"))))
   `(mode-line-buffer-id ((,class (:weight bold :background "coral2" :foreground "blue4"))))

Most load-theme-buffer-local users are probably unaware of this problem as the themes works fine, and if you never look at your Messages buffer you'll never see the warnings.

I was able to mostly avoid the problem by avoiding certain emacs24 themes. It was always hard to exactly nail down which were causing the problem, since if you ever started getting the problem, it never went away, even if you swtiched off the "bad" themes. I always knew that adwaita had the problem though.

It was really aggrevating to me because when writing elisp code, I like to use the Messages buffer for debugging. There were so many messages (thousands per minute as every keystroke generated mesages), I effectively lost the ability to use the Messages buffer. And the only way I knew to fix it was to cycle emacs -- an expensive propostion for most emacs users.

Anyway, I'm not necesarrily saying the problem is on your end. Maybe the problem is with the themes themselves. Maybe these are old keywords and shouldn't be used. However, the 'load-theme (frame-level and system-wide) does not generate the error messages, which suggest they might be valid (or possibly that load-theme ignores them, or somehow does not generate error messages).

I'm just bring the problem to your attention. It would be nice to not need to edit these files on any future unix system I want to use, so if there is something that you can do to prevent the messages that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant