From 26d0c9af7e9154e2ba1e9fbc0322d3679d07f4f1 Mon Sep 17 00:00:00 2001 From: Holger Dürer Date: Thu, 21 Feb 2019 20:15:07 +0000 Subject: Fix: make after-change-functions buffer local. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See issue #218 — we mistakenly modified the global value and `mastodon-toot--update-status-fields` makes no sense outside the toot compose buffer. --- lisp/mastodon-toot.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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))) -- cgit v1.2.3