Hey Prot! How's it going? Hope you had a great end of the year.
I was trying to configure my 'whitespace-line face to have an
unspecified background, in order to make it keep syntax highlighting but
highlight the background with the appropriate color. Problem is, doing
the following
(set-face-attribute 'whitespace-line nil :foreground 'unspecified)
won't work because it is inheriting from a modus-themes face, which
specifies a foreground color. That said, I came up with the following
ad-hoc solution
(let* ((inherit-face (face-attribute 'whitespace-line :inherit))
(attrs (map-filter
(lambda (_k v) (not (eq 'unspecified v)))
(face-all-attributes inherit-face (selected-frame)))))
(map-put! attrs :foreground 'unspecified)
(apply #'set-face-attribute 'whitespace-line (selected-frame)
(append (flatten-list attrs)
(list :inverse-video 'unspecified
:slant 'unspecified
:weight 'unspecified
:inherit 'unspecified))))
which basically copies all attributes from the inherited face for
'whitespace-line and sets :foreground to 'unspecified, removing the
inherited face. Is this really the best way of doing it with
modus-themes? I couldn't find a way to do it with palette overrides,
similarly to how it can be done for region, setting
(setq modus-themes-common-palette-overrides '((fg-region unspecified)))
All the best,
--
João Pedro de A. Paula
IT undergraduate at Universidade Federal do Rio Grande do Norte (UFRN)
> From: João Pedro <jpedrodeamorim@gmail.com>
> Date: Wed, 4 Jan 2023 13:33:48 -0300
>
> Hey Prot!
Hello João Pedro,
> How's it going? Hope you had a great end of the year.
Personally I am fine. We'll see how the rest goes. I hope you are
doing well.
> I was trying to configure my 'whitespace-line face to have an
> unspecified background, in order to make it keep syntax highlighting but
> highlight the background with the appropriate color.
> [... 30 lines elided]
You are the first to comment on those faces. I simply tried to retain
their default style, though I find 'whitespace-line' to be hard to use
right now. I think what you suggest is a better default. This diff:
modus-themes.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modus-themes.el b/modus-themes.el
index 057ee54..4eb84b7 100644
--- a/modus-themes.el+++ b/modus-themes.el
@@ -3634,7 +3634,7 @@ ;;;;; whitespace-mode
`(whitespace-empty ((,c :inherit modus-themes-intense-magenta)))
`(whitespace-hspace ((,c :background ,bg-dim :foreground ,fg-dim)))
`(whitespace-indentation ((,c :background ,bg-dim :foreground ,fg-dim)))
- `(whitespace-line ((,c :inherit modus-themes-subtle-yellow)))+ `(whitespace-line ((,c :background ,bg-yellow-subtle))) `(whitespace-newline ((,c :background ,bg-dim :foreground ,fg-dim)))
`(whitespace-space ((,c :background ,bg-dim :foreground ,fg-dim)))
`(whitespace-space-after-tab ((,c :inherit modus-themes-subtle-magenta)))
Note that there is potential to introduce semantic colour mappings for:
- bg-err- br-warning- bg-info
The reason I did not add them yet is because I try not to expand the
palette too eagerly. Better have a clear idea of the requirements.
What do you think?
All the best,
Prot
--
Protesilaos Stavrou
https://protesilaos.com
Em quarta, 04/01/2023 às 18:56, Protesilaos Stavrou <info@protesilaos.com> escreveu:
> Personally I am fine. We'll see how the rest goes. I hope you are> doing well.
Seems like it is a end/start-of-the-year tradition for me to mail you
regarding some faces in Modus Themes! :P
I'm so incredibly sorry I had not replied to you on this, I completely
forgot about it and might've hit my shortcut to tag it as read without
actually reading it thoroughly...
> - `(whitespace-line ((,c :inherit modus-themes-subtle-yellow)))> + `(whitespace-line ((,c :background ,bg-yellow-subtle)))> Note that there is potential to introduce semantic colour mappings for:>> - bg-err> - br-warning> - bg-info
This is a bit outdated now, given that you've indeed added some semantic
mappings for it. Although you've chosen to set `whitespace-line''s
foreground to be `warning', instead of `fg-space', which seems to be the
default value for the other `whitespace' related faces. Was it on
purpose?
I promise I'll be more careful upon reading and replying to e-mails this
time around! Merry Christmas to you and, if you don't reply by the end
of the year (which I wouldn't be surprised if you didn't), happy New
Year as well!!
Best regards,
--
João Pedro de A. Paula
IT bachelors at Universidade Federal do Rio Grande do Norte (UFRN)
> From: João Pedro <jpedrodeamorim@gmail.com>> Date: Mon, 25 Dec 2023 22:53:19 -0300>> Em quarta, 04/01/2023 às 18:56, Protesilaos Stavrou <info@protesilaos.com> escreveu:>>> Personally I am fine. We'll see how the rest goes. I hope you are>> doing well.>> Seems like it is a end/start-of-the-year tradition for me to mail you> regarding some faces in Modus Themes! :P>> I'm so incredibly sorry I had not replied to you on this, I completely> forgot about it and might've hit my shortcut to tag it as read without> actually reading it thoroughly...
Haha, no worries!
>> - `(whitespace-line ((,c :inherit modus-themes-subtle-yellow)))>> + `(whitespace-line ((,c :background ,bg-yellow-subtle)))>>> Note that there is potential to introduce semantic colour mappings for:>>>> - bg-err>> - br-warning>> - bg-info>> This is a bit outdated now, given that you've indeed added some semantic> mappings for it. Although you've chosen to set `whitespace-line''s> foreground to be `warning', instead of `fg-space', which seems to be the> default value for the other `whitespace' related faces. Was it on> purpose?
It is on purpose because the mode does have those warnings. I don't know
if they are needed, but I guess someone has a use for them. Do you think
they should be different?
> I promise I'll be more careful upon reading and replying to e-mails this> time around! Merry Christmas to you and, if you don't reply by the end> of the year (which I wouldn't be surprised if you didn't), happy New> Year as well!!
Thank you! As I noted in another mail to you, I am slow to respond due
to my limited typing time. I am going though all my messages, but it is
hard to cover them all because of the injury.
--
Protesilaos Stavrou
https://protesilaos.com
Em quinta, 08/02/2024 às 11:27 (+02), Protesilaos Stavrou <info@protesilaos.com> escreveu:
> It is on purpose because the mode does have those warnings. I don't know> if they are needed, but I guess someone has a use for them. Do you think> they should be different?
It might be personal preference, but I'd rather face whitespace
indication as just that, an indication that there is whitespace there,
instead of it being a 'warning'. But that's just me, it indeed does seem
like whitespace-mode tends to treat them as warnings by default. The
semantic highlights seem to have solved it, I just added
;; whitespace
(bg-space bg-dim)
(fg-space unspecified)
to my palette overrides! Thank you!
--
João Pedro de A. Paula
IT bachelors at Universidade Federal do Rio Grande do Norte (UFRN)
> From: João Pedro <jpedrodeamorim@gmail.com>> Date: Sat, 9 Mar 2024 15:41:33 -0300>> Em quinta, 08/02/2024 às 11:27 (+02), Protesilaos Stavrou <info@protesilaos.com> escreveu:>>> It is on purpose because the mode does have those warnings. I don't know>> if they are needed, but I guess someone has a use for them. Do you think>> they should be different?>> It might be personal preference, but I'd rather face whitespace> indication as just that, an indication that there is whitespace there,> instead of it being a 'warning'. But that's just me, it indeed does seem> like whitespace-mode tends to treat them as warnings by default. The> semantic highlights seem to have solved it, I just added>> ;; whitespace> (bg-space bg-dim)> (fg-space unspecified)>> to my palette overrides! Thank you!
Very well! I agree with you, by the way. For actual warnings, I
expect the linter to do its job.
--
Protesilaos Stavrou
https://protesilaos.com