aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-toot.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-29 12:02:00 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-29 13:00:00 +0200
commit7bc512d546477d8399208fcdf9fa53540fb5cdae (patch)
tree73962f874f60b11a002e3e1a4b623c7dda83cfa1 /lisp/mastodon-toot.el
parentbec7a01c1fe63fdb9ca45602ec71315514b4572d (diff)
variable pitch for toot compose buffer, but not for docs
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r--lisp/mastodon-toot.el22
1 files changed, 19 insertions, 3 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index a3f337d..1a2a3cd 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -147,6 +147,12 @@ If the original toot visibility is different we use the more restricted one."
"Whether to enable your instance's custom emoji by default."
:type 'boolean)
+(defcustom mastodon-toot--enable-proportional-fonts-compose-buffer nil
+ "Nonnil to enable using proportional fonts in the compose buffer.
+By default fixed width fonts are used."
+ :type '(boolean :tag "Enable using proportional rather than fixed \
+width fonts"))
+
(defvar-local mastodon-toot--content-warning nil
"A flag whether the toot should be marked with a content warning.")
@@ -1452,7 +1458,7 @@ REPLY-TEXT is the text of the toot being replied to."
(propertize "None "
'toot-attachments t)
"\n")
- 'face font-lock-comment-face
+ 'face 'mastodon-toot-docs-face
'read-only "Edit your message below."
'toot-post-header t)
(if reply-text
@@ -1461,12 +1467,12 @@ REPLY-TEXT is the text of the toot being replied to."
mastodon-toot-orig-in-reply-length)
'read-only "Edit your message below."
'toot-post-header t
- 'face '(variable-pitch :foreground "#7c6f64"))
+ 'face 'mastodon-toot-docs-reply-text-face)
"")
(propertize
(concat divider "\n")
'rear-nonsticky t
- 'face font-lock-comment-face
+ 'face 'mastodon-toot-docs-face
'read-only "Edit your message below."
'toot-post-header t))))
@@ -1680,6 +1686,8 @@ EDIT means we are editing an existing toot, not composing a new one."
(point-marker))))
(switch-to-buffer-other-window buffer)
(text-mode)
+ (when mastodon-toot--enable-proportional-fonts-compose-buffer
+ (variable-pitch-mode))
(mastodon-toot-mode t)
(setq mastodon-toot--visibility
(or (plist-get mastodon-profile-account-settings 'privacy)
@@ -1738,6 +1746,14 @@ EDIT means we are editing an existing toot, not composing a new one."
(lambda ()
(auto-fill-mode -1)))
+;; scale fixed-pitch docs relative to any possible variable pitch scaling set:
+(add-hook 'mastodon-toot-mode-hook
+ (lambda ()
+ (when mastodon-toot--enable-proportional-fonts-compose-buffer
+ (let ((height (/ 1 (face-attribute 'variable-pitch :height))))
+ (set-face-attribute 'mastodon-toot-docs-face nil
+ :height height)))))
+
(define-minor-mode mastodon-toot-mode
"Minor mode to capture Mastodon toots."
:keymap mastodon-toot-mode-map