-
Notifications
You must be signed in to change notification settings - Fork 45
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
Support variable-pitch face for plain text messages #245
Conversation
Marking as a draft pending more testing time, in case I spot any additional special cases. |
I wonder whether |
Seems like a good idea. |
Cool, I've now done that. I'll need to deal with 'emote' messages too:
I'm not sure whether to extend the |
I think dropping the test should be fine? Only the body event formatters for (I've now pushed a fixup commit to do this.) |
Ignore the following; it was my own fault. In the notifications buffer
Whereas in the room buffer the same event text is rendered in variable-pitch:
|
Well that last one was my own fault, and local to my config. It occurred to me to check
Which I've fixed via a more specific override:
|
I've tested a bunch of different things and not spotted any more issues, so this PR is no longer a Draft. |
275f7ea
to
61b7945
Compare
Force-pushed to squash the prior fixup commit. |
Bah, and now I spot something else to tidy up... |
61b7945
to
3577c1c
Compare
Have done more testing, and am happy with this now. |
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.
Thanks, I like how simple this patch is. :) How do you think we should describe it in the changelog?
How about: Option: |
Thanks. If you don't mind updating the changelog, then I'll merge this. |
d42477f
to
4a6ced8
Compare
As another micro optimisation, seeing as how the following won't ever vary in a given session: (or (and (facep 'shr-text) 'shr-text)
'variable-pitch)) I thought I might |
Yeah, I think that makes sense. You might need to verify that |
That's all good -- ement-room.el has a |
Edit: Ok, I think I see what's going on, and it's something in my config entirely unconnected to this PR. I just need to do some more testing... |
Yep, that last comment/issue was totally unrelated. Nothing to see here! But in case anyone is interested... I was seeing floods of this in Messages:
And it took me a stupidly long time to recognise the literal-ness of the first message. ;; Bad:
(face-remap-add-relative 'ement-room-mention :background nil)
;; Good:
(face-remap-add-relative 'ement-room-mention :background 'unspecified) Edit: Hmm, in fact that prevented the errors but didn't actually suppress the background colour, so I went with this in the end: (face-remap-add-relative
'ement-room-mention :background (face-attribute 'default :background)) This is happening in Looking at Edit 2: And to demonstrate why setting a specific background is a pain, I subsequently ended up with the following in order to support switching themes (which I do depending on whether I'm working indoors or outdoors): (let ((buf (current-buffer)))
(cl-flet ((update-faces (&optional _theme)
(with-current-buffer buf
(face-remap-add-relative
'ement-room-mention
:background (face-attribute 'default :background)))))
(update-faces)
(add-hook 'enable-theme-functions #'update-faces nil :local))) But then I simplified all that to: Edit 3: Nope, still not right! Latest attempt: (setq-local face-remapping-alist nil)
(face-remap-add-relative 'ement-room-mention
:inherit '(variable-pitch-text default)) |
AFAIK, this one is good to go. |
I'd like to release v0.14 for tomorrow, so I'll merge this for v0.15 afterward, so it can be tested on master for a while. |
e69adfa
to
20e078b
Compare
Rebased over current master. |
20e078b
to
81dc2dd
Compare
Rebased over current master. |
… plain text Closes alphapapa#174.
Minor optimisation; we only need to establish this value once.
81dc2dd
to
3e4e84d
Compare
Merged. Thanks for your work and your patience. |
Closes #174.