[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ement baff5886fb 11/15: Change: (ement-room--event-body
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ement baff5886fb 11/15: Change: (ement-room--event-body-face) Support variable-pitch face for plain text |
Date: |
Tue, 19 Mar 2024 21:57:59 -0400 (EDT) |
branch: externals/ement
commit baff5886fba2f8a2837d462b600e85c438e11a76
Author: Phil Sainty <phil@catalyst.net.nz>
Commit: Adam Porter <adam@alphapapa.net>
Change: (ement-room--event-body-face) Support variable-pitch face for plain
text
Closes #174.
---
ement-room.el | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/ement-room.el b/ement-room.el
index e50ae7efb7..2a55893c5b 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -870,10 +870,10 @@ the original messages visible."
:type 'boolean)
(defcustom ement-room-shr-use-fonts nil
- "Enable `shr' variable-pitch fonts for formatted bodies.
-If non-nil, `shr' may use variable-pitch fonts for formatted
-bodies (which include most replies), which means that some
-messages won't display in the same font as others."
+ "Enable `shr' variable-pitch fonts for message bodies.
+If non-nil, `shr' may selectively use variable-pitch fonts for
+formatted message bodies (which includes most replies), and plain
+text messages will also be displayed in a variable-pitch font."
:type '(choice (const :tag "Disable variable-pitch fonts" nil)
(const :tag "Enable variable-pitch fonts" t)))
@@ -1309,7 +1309,7 @@ spec) without requiring all events to use the same margin
width."
;; This used to be a macro in --format-message, which is probably better for
;; performance, but using a function is clearer, and avoids premature
optimization.
(pcase-let* (((cl-struct ement-event sender
- (content (map msgtype))
+ (content (map msgtype format ('m.new_content
new-content)))
(unsigned (map ('redacted_by unsigned-redacted-by)))
(local (map ('redacted-by local-redacted-by))))
event)
@@ -1336,7 +1336,16 @@ spec) without requiring all events to use the same
margin width."
(color-darken-name message-color
ement-room-prism-message-lightening))))))))
(redacted-face (when (or local-redacted-by unsigned-redacted-by)
'ement-room-redacted))
- (body-face (list :inherit (delq nil (list redacted-face
context-face type-face)))))
+ ;; For visual consistency, apply the variable-pitch `shr-text'
face to
+ ;; non-HTML messages when `ement-room-shr-use-fonts' is non-nil
(HTML
+ ;; messages are fontified by shr itself).
+ (shr-text-face (when (and ement-room-shr-use-fonts
+ (not (equal (or format (alist-get
'format new-content))
+
"org.matrix.custom.html")))
+ ;; The `shr-text' face was added in Emacs 29.1.
+ (or (and (facep 'shr-text) 'shr-text)
+ 'variable-pitch)))
+ (body-face (list :inherit (delq nil (list redacted-face
context-face type-face shr-text-face)))))
(if prism-color
(plist-put body-face :foreground prism-color)
body-face)))
- [elpa] externals/ement updated (e4512f410d -> 7fbbb065a8), ELPA Syncer, 2024/03/19
- [elpa] externals/ement dd9b65410d 01/15: Fix: (ement-room-transient) Respect `ement-room-compose-method', ELPA Syncer, 2024/03/19
- [elpa] externals/ement 755020c256 03/15: Change: Make compose buffer windows dedicated by default, ELPA Syncer, 2024/03/19
- [elpa] externals/ement b6e41cf0ca 07/15: Merge: Fix recognition of mentions after a newline, ELPA Syncer, 2024/03/19
- [elpa] externals/ement d3faf84445 05/15: Fix: (ement--format-body-mentions) Link usernames following newlines, ELPA Syncer, 2024/03/19
- [elpa] externals/ement df75e74f94 06/15: Docs: Update changelog, ELPA Syncer, 2024/03/19
- [elpa] externals/ement 60d1dc96fb 10/15: Docs: Tidy changelog, ELPA Syncer, 2024/03/19
- [elpa] externals/ement baff5886fb 11/15: Change: (ement-room--event-body-face) Support variable-pitch face for plain text,
ELPA Syncer <=
- [elpa] externals/ement a20ea4c2b3 13/15: Docs: Update changelog, ELPA Syncer, 2024/03/19
- [elpa] externals/ement c9ae65021a 12/15: Change: (ement-room-shr-use-fonts) Rename option to: ement-room-use-variable-pitch, ELPA Syncer, 2024/03/19
- [elpa] externals/ement 3e4e84d7a9 14/15: Add: (defconst ement-room-variable-pitch-face), ELPA Syncer, 2024/03/19
- [elpa] externals/ement 7fbbb065a8 15/15: Merge branch 'phil-s/variable-pitch' [#245], ELPA Syncer, 2024/03/19
- [elpa] externals/ement 7418626abe 02/15: Fix: More robust auto-height behaviour for compose buffer windows, ELPA Syncer, 2024/03/19
- [elpa] externals/ement 639665fc14 04/15: Merge: Improvements and bug fixes for compose buffer enhancements, ELPA Syncer, 2024/03/19
- [elpa] externals/ement 7ae4b3b359 08/15: Fix: (ement-room--format-message) %W considers only the current line, ELPA Syncer, 2024/03/19
- [elpa] externals/ement 3d60568260 09/15: Merge: Consider newlines in message format for wrap-prefix, ELPA Syncer, 2024/03/19