protesilaos / modus-themes

Highly accessible themes for GNU Emacs, conforming with the highest standard for colour contrast between background and foreground values (WCAG AAA).
https://protesilaos.com/emacs/modus-themes
GNU General Public License v3.0
553 stars 30 forks source link

Elfeed-Goodies powerline separators: graphical bug #64

Closed TitusMu closed 1 year ago

TitusMu commented 1 year ago

Dear Prot,

I use elfeed-goodies to make elfeed look nicer (and better sorted). Elfeed-goodies requires powerline. Now modus operandi somehow gives the separators of powerline a bug. (See attached screenshot.)

Elfeed_Header

When I load the themes wheatgrass or solo-jazz or leuven, the powerline separators look fine. But I found out that a similar graphical bug happens when loading more than one of those (I know the themes stack in emacs). Maybe this helps in finding the reason. With modus operandi the graphical bug happens when I just load this single theme through my init.el, I double checked with custom-enabled-themes, it only says modus operandi.

Do you know of any solution?

All the best! I am still very happy with your themes and am using them for long hours every day. I love the high contrast that helps me read and comprehend faster.

Titus

EDIT: I am not using a Mac, just plain Linux Kubuntu 22.04.

protesilaos commented 1 year ago

Hello @TitusMu! This is a powerline bug. It happens when you switch themes. It also happens when the powerline style is applied to the mode line. Try M-x powerline-reset.

TitusMu commented 1 year ago

Hm. M-x powerline-reset didn't help. Can't it be some face-setting problem? The other emacs-included themes do not have the graphical bug.

I looked at list-faces-display and compared. In solo-jazz, wich works fine, all three powerline-inactive0, powerline-inactive1 and powerline-inactive2 inherit from mode-line-inactive. And all three powerline-active0, powerline-active1 and powerline-active2 inherit from mode-line-active.

In modus-operandi, both powerline-inactive0 and powerline-inactive1 do not inherit. Powerline-inactive2 inherits from mode-line-inactive. Powerline-active0 does not inherit, powerline-active2 inherits from mode-line-inactive (!).

But what is really interesting: I cannot change powerline-active1 through M-x list-faces-display. It just says there:

powerline-active1 Lisp expression: ((t (:inherit (mode-line-active))))

Could that be a trace to the solution?

protesilaos commented 1 year ago

Hm. M-x powerline-reset didn't help. Can't it be some face-setting problem? The other emacs-included themes do not have the graphical bug.

Okay, this is strange. The M-x powerline-reset works on my end. Can you tell me more about your setup?

In modus-operandi, both powerline-inactive0 and powerline-inactive1 do not inherit. Powerline-inactive2 inherits from mode-line-inactive. Powerline-active0 does not inherit, powerline-active2 inherits from mode-line-inactive (!).

The exact inheritance should not matter, as those are stylistic: they basically get different shades of grey.

But what is really interesting: I cannot change powerline-active1 through M-x list-faces-display.

Maybe you need to click on the "State" button and select "For Current Display"?

TitusMu commented 1 year ago

How do you load the theme?

(use-package modus-themes
      :load-path "~/.emacs.neu/themes/"
      :pin manual
      :demand t
      :bind ("<f3>" . modus-themes-toggle)
      :config
      (setq modus-themes-headings
        '((1 . (medium background overline rainbow 1.25))
          (2 . (medium background overline rainbow 1.15))
          (3 . (medium background overline rainbow 1.09))
          (4 . (medium background overline rainbow 1.09))
          (5 . (medium rainbow 1.06))
          (6 . (medium rainbow 1.03))
          (t . (medium rainbow))))
      (customize-set-variable 'modus-themes-common-palette-overrides
                          '((fg-heading-1 rust)  
                            (bg-heading-1 bg-red-nuanced)
                            (overline-heading-1 red-cooler)))
      (setq modus-themes-to-toggle '(modus-vivendi modus-operandi))
      (load-theme 'modus-operandi))

Do you have any custom faces that could be affecting this?

(custom-set-faces '(escape-glyph ((t (:family "Source Sans Pro" :foreground "gray86")))))
(set-display-table-slot outline-display-table 'selective-display
                        (vconcat (mapcar (lambda (c)
                                          (make-glyph-code c 'escape-glyph)) " ▾")))
(defun set-outline-display-table ()
  (setf buffer-display-table outline-display-table))
(add-hook 'outline-mode-hook 'set-outline-display-table)
(add-hook 'outline-minor-mode-hook 'set-outline-display-table)

But I took this out of the init.el to try whether it could be the reason, and nothing changed. Also I have a few mu4e-faces and I use the package mu4e-column-faces, but this I also commented out to try, and it didn't change anything.

Other than that I have some cfw:...-faces for Calfw and the following:

    (set-face-attribute 'bookmark-menu-bookmark nil :family "IBM Plex Mono" :height 145)

    (set-face-attribute 'org-agenda-diary nil :foreground "AntiqueWhite3" :slant 'italic)
    (set-face-attribute 'org-super-agenda-header nil :foreground "AntiqueWhite4" :weight 'normal :underline t)

    (set-face-attribute 'default nil :family "IBM Plex Mono" :height 145)
    (set-face-attribute 'fixed-pitch nil :family "Minion Pro" :height 145)
    (set-face-attribute 'variable-pitch nil :family "Source Serif Pro" :height 145)

    (set-face-attribute 'org-superstar-item nil :foreground "#8a290f")

    (set-face-attribute 'iflipb-current-buffer-face nil
                        :inherit 'minibuffer-prompt
                        :weight 'bold
                        :underline t)

    (set-face-attribute 'dired-directory nil :foreground "#268bd2")
    (set-face-attribute 'diredfl-number nil :foreground "darkgray")
    (set-face-attribute 'diredfl-date-time nil :foreground "SteelBlue")

What are your configurations for elfeed-goodies?

(use-package elfeed
    :after elfeed-org
    :load-path "/home/titus/.emacs.neu/lisp/elfeed/"
    :pin manual
    :commands elfeed
    :bind ("s-n" . elfeed)
    :config
    (elfeed-goodies/setup)
    (setq elfeed-goodies/entry-pane-size 0.6)  ;; Fenster mit RSS soll beim öffnen 60 % der Fensterbreite einnehmen
    (setq elfeed-goodies/tag-column-width 26)  ;; Breite der Spalte für Tags

    (setq elfeed-db-directory "/home/titus/.emacs.neu/elfeed-datenbank/")
    (setq elfeed-enclosure-default-dir "/home/titus/.emacs.neu/elfeed-datenbank/enclosures/")

    (setq elfeed-search-filter "@2-week-ago +unread")

    (defface Eintrag-zu-emacs-elfeed
      '((t :foreground "Steelblue4"))
      "Markiert einen Elfeed-Eintrag zum Thema Emacs.")
    (defface Eintrag-zu-buchmarkt-elfeed
      '((t :foreground "#d33682"))
      "Markiert einen Elfeed-Eintrag zum Thema Buchmarkt.")

    (push '(Emacs Eintrag-zu-emacs-elfeed)
          elfeed-search-face-alist)
    (push '(Buchmarkt Eintrag-zu-buchmarkt-elfeed)
          elfeed-search-face-alist))

(use-package elfeed-org
    :load-path "/home/titus/.emacs.neu/lisp/elfeed-org/"
    :pin manual
    :config
       (elfeed-org)
       (setq rmh-elfeed-org-files '("/home/titus/Writer/Org/RSS_Feeds.org")))

(use-package powerline)

(use-package elfeed-goodies
    :after powerline elfeed
    :commands elfeed-goodies/setup)

Do you set up elfeed-goodies before or after loading the theme?

I tried both (with an after-init-hook for the theme). But it doesn't seem to be the reason for the issue.

Is modus-operandi the only loaded theme or M-x disable-theme shows others as well?

M-x disable-theme shows it as the only one.

Maybe you need to click on the "State" button and select "For Current Display"?

I tried. If I change the state, everything looks the same, only instead of THEMED it says now SET for current session only. But still I cannot get a list of attributes and cannot change anything.

Such a long message. Thank you very much, Prot, for reading it. Maybe I use a different version? My elfeed is version 3.4.1, elfeed-org is version 20170423.1, elfeed-goodies doesn't have a version, it just says Copyright (c) 2015, 2016.

I'll try out a little bit more. If we don't find the reason, it's a graphical bug I can live with, I think. Thank you for all your time and effort!

TitusMu commented 1 year ago

I took out the :pin manual for elfeed and elfeed-org, but with the version loaded by package.el the issue persists. In case that trace is helpful, here a screenshot of the powerline-active1 in M-x list-faces-display.

powerline-face-bug

protesilaos commented 1 year ago

Thank you @TitusMu for sharing those! I am trying to reproduce the problem, but I cannot. Notice my screenshot of the face customisation:

Screenshot from 2023-01-19 14-29-22

The [sample] text is different. Also, I get a THEMED. (lisp) indication, whereas yours does not have the parentheses.

I am trying to figure out what is going on.

In the meantime, note that elfeed-goodies upsets the expectations of powerline. I configured the faces of the latter to work for the modeline (i.e. the original purpose of powerline). They do not look nice as a header bar and are not in the same order they appear on the modeline. Put differently, I would not design it this way.

I did M-x powerline-default-theme to show you what I mean. Check the modeline at the bottom and compare it with the previous screenshot:

Screenshot from 2023-01-19 14-33-52

protesilaos commented 1 year ago

And here is what happens when I do M-x powerline-reset, otherwise I get visual glitches when I switch themes, which is a known powerline issue (hence the reset command it provides).

Screenshot from 2023-01-19 14-50-05

Screenshot from 2023-01-19 14-50-10

TitusMu commented 1 year ago

Thank you for following this, Prot. I wish elfeed-goodies would work without powerline. I really do not need the separators or a beautiful heading, I mostly need the better structure and order of the feeds. If my programming skills were better, I'd try to take out the needed parts of elfeed-goodies and dump the rest.

You are right, the sample differs. That's strange.

Oh, and how well M-x powerline-reset works at your side!

Probably it's all just a misconfiguration over here, and a single case. Really, don't waste time on it if it just bothers me as a single person. I'll go on and try some more. As soon as I find something, I'll let you know.

protesilaos commented 1 year ago

This is such a weird bug. I will keep exploring it and report any further findings.

Last thing to note: do you have a custom-file and/or the Custom snippet that is appended to the end of the init.el file? That could hold some variable that is causing the problem.

I think elfeed-goodies should drop the needless powerline dependency (or at least make it opt-in) though I understand this is easier said than done.

TitusMu commented 1 year ago

I have a custom-file, it just contains custom-safe-themes and some org-tag-faces I had added to an org-file. I removed it to try it out, but it doesn't change the bug.

I would give up, the only thing that lets me wonder, why the difference between the other themes and the (wonderful!) modus themes?

Look, this is exactly the same init.el, just loading Solo-Jazz:

SoloJazz

And this, same init.el, with Wheatgrass:

Wheatgrass

I am asking myself, what is difference to Modus-Operandi?

ModusOperandi

Maybe it's that the Modus Themes have an own Modus-Themes.el above the single theme files? I know so little about Themes and Faces, regrettably. But if a new idea comes up, I'll write it down here. And if there is anything else I can try out that you can think of, please let me know. And thanks for even taking time at all for such a niche graphical bug.

protesilaos commented 1 year ago

why the difference between the other themes and the (wonderful!) modus themes?

I believe this is because Modus covers the powerline faces for their intended purpose as a mode line customisation. Then elfeed-goodies rearranges those faces for an unforeseen and contradictory purpose. Compare the sequence of background colours in my screenshots between the mode lines and the elfeed-goodies header.

This explains why the different themes behave differently. What it does not explain is why I do not get the same results as you do when I use modus-operandi. I have no explanation for this discrepancy. Also, M-x powerline-reset works on my end, whereas it does not on yours.

TitusMu commented 1 year ago

If I load modus-operandi first and then solo-jazz on top and then tango on top of it, and I do M-x powerline-reset, it repairs part of the tohuwabohu, but the strange glitches stay. When I then M-x disable-theme modus-operandi, and do M-x powerline-reset again, everything is repaired. So it does do something, but it doesn't get over the obstacle my strange combination of computer hardware, linux build and init.el has piled up.

Maybe it really is different because we use different versions of Emacs. My version is 28.1.91.

TitusMu commented 1 year ago

Hi Prot,

I found a solution. It has to do with mode-line-active. This face doesn't exist when I look at M-x list-faces-display. Maybe it was introduced later, with Emacs 29? Anyhow, in modus-themes, powerline-active1 inherits from it. So I tried changing it in modus-themes.el to something crazy, like this:

 `(mode-line-active ((,c 
                              :background "red"
                              :foreground "blue")))

To my wonder, nothing changed by this, and nothing in my setup had these colors (red and blue).

Normally, mode-line-active inherits from mode-line in modus-themes.el, so I tried skipping this step and letting powerline-active1 not inherit from mode-line-active (and thus indirectly from mode-line), but directly from mode-line:

`(powerline-active1 ((,c :inherit mode-line)))

Now everything looks fine.

protesilaos commented 1 year ago

You are right @TitusMu! I just made the change. Please try the updated package and let me know how it works for you.

[ I still think elfeed-goodies should make the powerline optional, but that is another issue. ]

TitusMu commented 1 year ago

Thank you, Prot, with the updated package everything works great!

And I also think elfeed-goodies should make the powerline optional.

protesilaos commented 1 year ago

Very well! We can safely close this now. Thank you for your time!