aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2021-10-26 17:51:53 +0200
committermousebot <mousebot@riseup.net>2021-10-26 17:51:53 +0200
commitf9a4bab4a81f96407c38a1a45719d45827b9f585 (patch)
tree6fbdcf348fcc958436c4268d8ad3645cda9f04b4
parentc82399d03e62bc258a7f9c89846f8552f2d2e52b (diff)
toot--enable-completion-for-mentions only if company noerror
- from testing with 'emacs -Q'
-rw-r--r--lisp/mastodon-toot.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 44b0b3b..3e60d2d 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -784,10 +784,11 @@ REPLY-JSON is the full JSON of the toot being replied to."
(mastodon-toot-mode t)
(unless mastodon-toot--max-toot-chars
(mastodon-toot--get-max-toot-chars))
- (when mastodon-toot--enable-completion-for-mentions
- (set (make-local-variable 'company-backends)
- (add-to-list 'company-backends 'mastodon-toot--mentions-completion))
- (company-mode-on))
+ (when (require 'company nil :noerror)
+ (when mastodon-toot--enable-completion-for-mentions
+ (set (make-local-variable 'company-backends)
+ (add-to-list 'company-backends 'mastodon-toot--mentions-completion))
+ (company-mode-on)))
(make-local-variable 'after-change-functions)
(push #'mastodon-toot--update-status-fields after-change-functions)
(mastodon-toot--refresh-attachments-display)