From bb5b46deff62f7f110684766642ada311db626f4 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sun, 5 Nov 2023 01:22:45 +1100 Subject: [emacs] Reset buffer in mastorg-open --- emacs/.emacs.d/lisp/my/mastorg.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'emacs') diff --git a/emacs/.emacs.d/lisp/my/mastorg.el b/emacs/.emacs.d/lisp/my/mastorg.el index 61bc027..3544b2e 100644 --- a/emacs/.emacs.d/lisp/my/mastorg.el +++ b/emacs/.emacs.d/lisp/my/mastorg.el @@ -196,9 +196,11 @@ Including ancestors and descendants, if any." Including the context, i.e. ancestors and descendant toots." (interactive "sToot URL: ") (with-current-buffer (get-buffer-create mastorg-buffer) - (insert (mastorg-format-toot-tree url)) - (org-mode) - (goto-char (point-min))) + (let ((inhibit-read-only t)) + (erase-buffer) + (insert (mastorg-format-toot-tree url)) + (org-mode) + (goto-char (point-min)))) (switch-to-buffer mastorg-buffer)) (provide 'mastorg) -- cgit v1.2.3