From e620ef7cd4ff10a78334cd5e4293756e33f58f71 Mon Sep 17 00:00:00 2001
From: marty hiatt <martianhiatus [a t] riseup [d o t] net>
Date: Fri, 26 Aug 2022 18:01:48 +0200
Subject: completion customizes edit for handling tags completion

---
 lisp/mastodon-search.el |  2 +-
 lisp/mastodon-toot.el   | 12 +++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el
index 5756ae4..89df311 100644
--- a/lisp/mastodon-search.el
+++ b/lisp/mastodon-search.el
@@ -59,7 +59,7 @@
 Returns a nested list containing user handle, display name, and URL."
   (interactive "sSearch mastodon for: ")
   (let* ((url (mastodon-http--api "accounts/search"))
-         (response (if (equal mastodon-toot--enable-completion-for-mentions "following")
+         (response (if (equal mastodon-toot--completion-style-for-mentions "following")
                        (mastodon-http--get-search-json url query "following=true")
                      (mastodon-http--get-search-json url query))))
     (mapcar #'mastodon-search--get-user-info-@ response)))
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index b3de461..b33350d 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -103,13 +103,19 @@ followers-only), or \"direct\"."
   :group 'mastodon-toot
   :type 'integer)
 
-(defcustom mastodon-toot--enable-completion-for-mentions
-  (if (require 'company nil :noerror) "following" "off")
-  "Whether to enable company completion for mentions.
+(defcustom mastodon-toot--enable-completion
+  (if (require 'company nil :noerror) t nil)
+  "Whether to enable completion of mentions and hashtags.
 
 Used for completion in toot compose buffer.
 
 This is only used if company mode is installed."
+  :group 'mastodon-toot
+  :type 'boolean)
+
+(defcustom mastodon-toot--completion-style-for-mentions
+  (if (require 'company nil :noerror) "following" "off")
+  "The company completion style to use for mentions."
   :group 'mastodon-toot
   :type '(choice
           (const :tag "off" nil)
-- 
cgit v1.2.3