diff options
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r-- | lisp/mastodon-toot.el | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 9e8a2cc..0d733bd 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -113,7 +113,6 @@ Used for completion in toot compose buffer." (defcustom mastodon-toot--use-company-for-completion nil "Whether to enable company for completion. - When non-nil, `company-mode' is enabled in the toot compose buffer, and mastodon completion backends are added to `company-capf'. @@ -170,7 +169,6 @@ If the original toot visibility is different we use the more restricted one." (defvar-local mastodon-toot--visibility nil "A string indicating the visibility of the toot being composed. - Valid values are \"direct\", \"private\" (followers-only), \"unlisted\", and \"public\". @@ -289,13 +287,13 @@ NO-TOOT means we are not calling from a toot buffer." (defun mastodon-toot--action-success (marker byline-region remove) "Insert/remove the text MARKER with 'success face in byline. - BYLINE-REGION is a cons of start and end pos of the byline to be modified. Remove MARKER if REMOVE is non-nil, otherwise add it." (let ((inhibit-read-only t) (bol (car byline-region)) - (eol (cdr byline-region))) + (eol (cdr byline-region)) + (at-byline-p (eq (get-text-property (point) 'byline) t))) (save-excursion (when remove (goto-char bol) @@ -307,9 +305,10 @@ Remove MARKER if REMOVE is non-nil, otherwise add it." (goto-char bol) (insert (format "(%s) " (propertize marker 'face 'success))))) - ;; leave point after the marker: - (unless remove - (mastodon-tl--goto-next-toot)))) + (when at-byline-p + ;; leave point after the marker: + (unless remove + (mastodon-tl--goto-next-toot))))) (defun mastodon-toot--action (action callback) "Take ACTION on toot at point, then execute CALLBACK. @@ -854,8 +853,8 @@ Buffer-local variable `mastodon-toot-previous-window-config' holds the config." (goto-char (cadr config))) (defun mastodon-toot--mentions-to-string (mentions) - "Applies mastodon-toot--process-local function to each mention, -removes empty string (self) from result and joins the sequence with whitespace \" \"." + "Apply `mastodon-toot--process-local' function to each mention in MENTIONS. +Remove empty string (self) from result and joins the sequence with whitespace." (mapconcat (lambda(mention) mention) (remove "" (mapcar (lambda(x) (mastodon-toot--process-local x)) mentions)) @@ -863,7 +862,6 @@ removes empty string (self) from result and joins the sequence with whitespace \ (defun mastodon-toot--process-local (acct) "Add domain to local ACCT and replace the curent user name with \"\". - Mastodon requires the full @user@domain, even in the case of local accts. eg. \"user\" -> \"@user@local.social\" (when local.social is the domain of the mastodon-instance-url). |