-
Notifications
You must be signed in to change notification settings - Fork 51
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
Allow customizing faces for queries and non-highlighted channels #384
base: master
Are you sure you want to change the base?
Conversation
41b2f63
to
087025c
Compare
6d07fda
to
5aaa756
Compare
I updated the PR, so now tracking uses
I understand, that it would be ideal if circe picked the fancy one but I am not sure how to do so. Also, I guess the custom faces |
5aaa756
to
a140036
Compare
FTR we discussed this PR and made the first round of a review on Thank you for all the feedback |
bump, PTAL :-) |
circe.el
Outdated
on this." | ||
(with-current-buffer buffer | ||
(cond ((get-text-property 0 'face buffer) | ||
(get-text-property 0 'face buffer)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can elide this line, if there's only a truthy condition, it evaluates to its result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I wasn't aware that it is possible. Updated.
circe.el
Outdated
'circe-tracking-channel-face) | ||
((eq major-mode 'circe-query-mode) | ||
'circe-tracking-query-face) | ||
(tracking-get-facet nil)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo. It's unclear how this is supposed to work as there's no such variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry. It was supposed to be tracking-get-face
from tracking.el
. Updated.
a140036
to
a02e49e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand correctly, that tracking-get-face-function
defaults to tracking-get-face
, but can also be set to circe-tracking-get-face
? If yes, it might make sense to mention that in the circe-tracking-get-face
docstring, otherwise people will customize circe-tracking-*-face
and won't see any effects from that.
I seem to recall from my original suggestion that tracking-get-face-function
should be turned into a buffer-local variable and set from the various circe mode functions to circe-tracking-get-face
. That way changes to the aforementioned faces would have immediate effect.
decide whether the buffer is for a channel, query or else and use a face based | ||
on this." | ||
(with-current-buffer buffer | ||
(cond ((get-text-property 0 'face buffer)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems redundant to specify buffer
when buffer
is current. Especially if the tracking-get-face
call exploits that fact.
a02e49e
to
4f56d58
Compare
Thank you for another round of the review @wasamasa. Sorry it requires so much babysitting, I am not that proficient in lisp.
That is true, and you have a good point, thank you. Updated.
The face changes have an immediate effect even now. Or is it possible that each one of us thinks something different by it? I can randomly evaluate these lines and the colors in my modeline immediately change
The reason why I do |
4f56d58
to
4cc3f0d
Compare
That's fine then.
I don't mean with |
Thank you @wasamasa, I understand what you are saying and it makes sense. Basically, these four options should all be equivalent in this context, right? (get-text-property 0 'face buffer)
(get-text-property 0 'face (current-buffer))
(get-text-property 0 'face nil)
(get-text-property 0 'face) Unfortunately only the first one works as expected, others give me
Which I don't really understand. I tried checking whether the current buffer is really changed to the (print (format "%s vs %s" (current-buffer) buffer)) but yes, the values are equal. Do you understand why it behaves like this? |
Correct. According to the docstring:
Please check whether this only happens with spaceline. If yes, then it might be an issue specific to it and you might need to dig into what exactly |
4cc3f0d
to
78d4fef
Compare
78d4fef
to
c765a6c
Compare
c765a6c
to
97f30ff
Compare
97f30ff
to
91c4732
Compare
At this point, we have a possibility to customize the color of a channel (in the tracking segment of a modeline) where somebody mentioned our name. We use the same face as for printing our name in the message itself (`circe-highlight-nick-face`). This is IMHO not sufficient because new personal messages are as important as mentions in a channel and they can be easily missed when shown in the default (for me gray) color. I am adding a support for this. While I am at it, I am adding a possibility to customize a color of a channel, that doesn't mention our name but has some new activity in it. I understand that `tracking-add-buffer` allows adding buffers to `tracking-buffers` with face and we may utilize this feature. I believe it makes sense for what whatever it is currently used but I would prefer to have a possibility to apply faces when rendering (in opposite to assigning a face when some activity happens), hence `tracking-get-face`. By default, I am setting the `circe-tracking-channel-face` and `circe-tracking-query-face` to `nil` and therefore they are not going to be customized and a backward-compatibility is going to be kept for everybody who doesn't care about this feature. Personally, I am putting the following lines to my config. (setq tracking-get-face-function #'circe-tracking-get-face) (set-face-attribute 'circe-tracking-channel-face nil :foreground my/white) (set-face-attribute 'circe-tracking-query-face nil :foreground my/blue)
91c4732
to
104e863
Compare
At this point, we have a possibility to customize the color of a channel (in the
tracking segment of a modeline) where somebody mentioned our name. We use the
same face as for printing our name in the message itself
(
circe-highlight-nick-face
).This is IMHO not sufficient because new personal messages are as important as
mentions in a channel and they can be easily missed when shown in the
default (for me gray) color. I am adding a support for this.
While I am at it, I am adding a possibility to customize the color of a channel,
that doesn't mention our name but has some new activity in it.
I understand that
tracking-add-buffer
allows adding buffers totracking-buffers
with face and we may utilize this feature. I believe it makessense for what whatever it is currently used but I would prefer to have a
possibility to apply faces when rendering (in opposite to assigning a face when
some activity happens), hence
tracking-get-face
.By default, I am setting the
tracking-channel-face
andtracking-query-face
to
nil
and therefore they are not going to be customized and abackward-compatibility is going to be kept for everybody who doesn't care about
this feature. Personally, I am putting the following lines to my config.