aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Dürer <me@hdurer.net>2019-02-21 20:15:07 +0000
committermousebot <mousebot@riseup.net>2021-10-03 20:38:05 +0200
commit26d0c9af7e9154e2ba1e9fbc0322d3679d07f4f1 (patch)
tree6a9185370faf7fd9169247dde9a945b2239f1ff1
parent8477f3aa37f2145a16e6aa627de92844094c2453 (diff)
Fix: make after-change-functions buffer local.
See issue #218 — we mistakenly modified the global value and `mastodon-toot--update-status-fields` makes no sense outside the toot compose buffer.
-rw-r--r--lisp/mastodon-toot.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index c28bcb1..16eae12 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -514,7 +514,7 @@ If REPLY-TO-ID is provided, set the MASTODON-TOOT--REPLY-TO-ID var."
(insert (format "%s " reply-to-user))
(setq mastodon-toot--reply-to-id reply-to-id)))
-(defun mastodon-toot--update-status-fields () ;(&rest args)
+(defun mastodon-toot--update-status-fields (&rest args)
"Update the status fields in the header based on the current state."
(let ((inhibit-read-only t)
(header-region (mastodon-tl--find-property-range 'toot-post-header
@@ -566,6 +566,7 @@ If REPLY-TO-ID is provided, set the MASTODON-TOOT--REPLY-TO-ID var."
(mastodon-toot--display-docs-and-status-fields)
(mastodon-toot--setup-as-reply reply-to-user reply-to-id))
(mastodon-toot-mode t)
+ (make-local-variable 'after-change-functions)
(push #'mastodon-toot--update-status-fields after-change-functions)
(mastodon-toot--update-status-fields)))