diff options
author | Dmitry Osipov <dosipov@microsoft.com> | 2022-11-28 15:33:37 +0100 |
---|---|---|
committer | Dmitry Osipov <dosipov@microsoft.com> | 2022-11-28 15:33:37 +0100 |
commit | 1e4a661df8b3e07847e9d368f41fa775bf3442a7 (patch) | |
tree | d8ecf24bf0ea610b336b7502c10aa93fb6cfe5d5 /lisp/mastodon-toot.el | |
parent | 119d0de0ec1e916fc14a083368ac32e488d1263b (diff) |
Remove double white-space in the reply mode
When you start a reply (to a local user or federated), there's one
extra white-space after the list of mentioned users:
`@user1@host.local @user2@host.federated__` (the underscores represent
white-spaces). This PR removes the extra space.
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r-- | lisp/mastodon-toot.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 121a590..c19f8e3 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -808,10 +808,10 @@ eg. \"user\" -> \"user@local.social \" (when local.social is the domain of the mastodon-instance-url). eg. \"yourusername\" -> \"\" eg. \"feduser@fed.social\" -> \"feduser@fed.social\"." - (cond ((string-match-p "@" acct) (concat "@" acct " ")) ; federated acct + (cond ((string-match-p "@" acct) (concat "@" acct)) ; federated acct ((string= (mastodon-auth--user-acct) acct) "") ; your acct (t (concat "@" acct "@" ; local acct - (cadr (split-string mastodon-instance-url "/" t)) " ")))) + (cadr (split-string mastodon-instance-url "/" t)))))) (defun mastodon-toot--mentions (status) "Extract mentions from STATUS and process them into a string." @@ -821,11 +821,11 @@ eg. \"feduser@fed.social\" -> \"feduser@fed.social\"." (if boosted (alist-get 'mentions (alist-get 'reblog status)) (alist-get 'mentions status)))) - (mapconcat (lambda(x) (mastodon-toot--process-local + (string-trim (mapconcat (lambda(x) (mastodon-toot--process-local (alist-get 'acct x))) ;; reverse does not work on vectors in 24.5 (reverse (append mentions nil)) - ""))) + " ")))) (defun mastodon-toot--get-bounds (regex) "Get bounds of tag or handle before point using REGEX." |