From 9c816bcecf46554f29600590f72fafc0ed001d6d Mon Sep 17 00:00:00 2001 From: clarkenciel Date: Thu, 27 Apr 2017 20:30:22 -0700 Subject: changing creation of toot buffer so that we don't duplicate docs --- lisp/mastodon-toot.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index af86b5f..5131191 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -186,10 +186,12 @@ If REPLY-TO-ID is provided, set the MASTODON-TOOT--REPLY-TO-ID var." "Create a new buffer to capture text for a new toot. If REPLY-TO-USER is provided, inject their handle into the message. If REPLY-TO-ID is provided, set the MASTODON-TOOT--REPLY-TO-ID var." - (let ((buffer (get-buffer-create "*new toot*"))) + (let* ((buffer-exists (get-buffer "*new toot*")) + (buffer (or buffer-exists (get-buffer-create "*new toot*")))) (switch-to-buffer-other-window buffer) - (mastodon-toot--display-docs) - (mastodon-toot--setup-as-reply reply-to-user reply-to-id) + (when (not buffer-exists) + (mastodon-toot--display-docs) + (mastodon-toot--setup-as-reply reply-to-user reply-to-id)) (mastodon-toot-mode t))) (defvar mastodon-toot-mode-map -- cgit v1.2.3