From a79210d516d59d4603f243299cc0f313200d91f4 Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 25 Oct 2021 16:37:03 +0200 Subject: declare company-mode functions --- lisp/mastodon-toot.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 983515e..178df56 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -34,7 +34,11 @@ (declare-function emojify-insert-emoji "emojify")) (require 'cl-lib) -(require 'company nil :noerror) + +(when (require 'company nil :noerror) + (declare-function company-mode-on "company") + (declare-function company-begin-backend "company") + (declare-function company-grab-symbol "company")) (defvar mastodon-instance-url) (autoload 'mastodon-auth--user-acct "mastodon-auth") -- cgit v1.2.3 From 3a892a4caa8b77c7f634f192ea22620af6506877 Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 25 Oct 2021 16:37:29 +0200 Subject: _args for update-status-fields --- lisp/mastodon-toot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 178df56..44b0b3b 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -731,7 +731,7 @@ REPLY-JSON is the full JSON of the toot being replied to." (setq mastodon-toot--content-warning t) (setq mastodon-toot--content-warning-from-reply-or-redraft reply-cw))))) -(defun mastodon-toot--update-status-fields (&rest args) +(defun mastodon-toot--update-status-fields (&rest _args) "Update the status fields in the header based on the current state." (ignore-errors ;; called from after-change-functions so let's not leak errors (let ((inhibit-read-only t) -- cgit v1.2.3 From f9a4bab4a81f96407c38a1a45719d45827b9f585 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 26 Oct 2021 17:51:53 +0200 Subject: toot--enable-completion-for-mentions only if company noerror - from testing with 'emacs -Q' --- lisp/mastodon-toot.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lisp/mastodon-toot.el') 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) -- cgit v1.2.3 From c60eb355232e57fec9fe97f366a3a2176f8c4110 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 26 Oct 2021 18:28:50 +0200 Subject: api/v2 for media attachment uploads --- lisp/mastodon-toot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 3e60d2d..14dcc29 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -567,7 +567,7 @@ It adds the items' ids to `mastodon-toot--media-attachment-ids', which is used t (mapcar (lambda (attachment) (let* ((filename (cdr (assoc :filename attachment))) (caption (cdr (assoc :description attachment))) - (url (concat mastodon-instance-url "/api/v1/media"))) + (url (concat mastodon-instance-url "/api/v2/media"))) (message "Uploading %s..." (file-name-nondirectory filename)) (mastodon-http--post-media-attachment url filename caption))) mastodon-toot--media-attachments)) -- cgit v1.2.3