diff options
author | Yuchen Pei <id@ypei.org> | 2023-11-05 01:22:45 +1100 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2023-11-05 01:22:45 +1100 |
commit | bb5b46deff62f7f110684766642ada311db626f4 (patch) | |
tree | 51ecd8af02ae7ead19d6496feda834f56a3fc0be | |
parent | e3202fe6fef0c59efa34594b22d0cde95998394f (diff) |
[emacs] Reset buffer in mastorg-open
-rw-r--r-- | emacs/.emacs.d/lisp/my/mastorg.el | 8 |
1 files changed, 5 insertions, 3 deletions
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) |