aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-toot.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r--lisp/mastodon-toot.el33
1 files changed, 18 insertions, 15 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 474337b..e77ddf3 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1415,6 +1415,19 @@ LONGEST is the length of the longest binding."
longest-kbind)
nil))))
+(defun mastodon-toot--format-reply-in-compose-string (reply-text)
+ "Format a REPLY-TEXT for display in compose buffer docs."
+ (let* ((rendered (mastodon-tl--render-text reply-text))
+ (no-newlines (replace-regexp-in-string "\n\n" "\n" rendered)))
+ (concat " Reply to:\n\""
+ ;; (propertize
+ (truncate-string-to-width
+ no-newlines
+ mastodon-toot-orig-in-reply-length)
+ ;; overridden by containing propertize call:
+ ;; 'face 'mastodon-toot-docs-reply-text-face)
+ "...\"\n")))
+
(defun mastodon-toot--display-docs-and-status-fields (&optional reply-text)
"Insert propertized text with documentation about `mastodon-toot-mode'.
Also includes and the status fields which will get updated based
@@ -1449,22 +1462,12 @@ REPLY-TEXT is the text of the toot being replied to."
" Attachments: "
(propertize "None "
'toot-attachments t)
+ "\n"
+ (if reply-text
+ (mastodon-toot--format-reply-in-compose-string reply-text)
+ "")
+ divider
"\n")
- 'face font-lock-comment-face
- 'read-only "Edit your message below."
- 'toot-post-header t)
- (if reply-text
- (concat
- (propertize (truncate-string-to-width
- (mastodon-tl--render-text reply-text)
- mastodon-toot-orig-in-reply-length)
- 'read-only "Edit your message below."
- 'toot-post-header t
- 'face '(variable-pitch :foreground "#7c6f64"))
- "\n")
- "")
- (propertize
- (concat divider "\n")
'rear-nonsticky t
'face font-lock-comment-face
'read-only "Edit your message below."