From 67e515edbbaa660757ecdcf87bbdfe353eb652f2 Mon Sep 17 00:00:00 2001 From: mousebot Date: Sat, 23 Oct 2021 12:22:39 +0200 Subject: move read-file-as-string --- lisp/mastodon-http.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lisp/mastodon-http.el') diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 95e8bf5..4f4cc3f 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -90,6 +90,12 @@ Message status and JSON error from RESPONSE if unsuccessful." (let ((json-response (mastodon-http--process-json))) (message "Error %s: %s" status (cdr (assoc 'error json-response)))))))) +(defun mastodon-http--read-file-as-string (filename) + "Read a file FILENAME as a string. Used to generate image preview." + (with-temp-buffer + (insert-file-contents filename) + (string-to-unibyte (buffer-string)))) + (defun mastodon-http--post (url args headers &optional unauthenticed-p) "POST synchronously to URL with ARGS and HEADERS. @@ -113,12 +119,6 @@ Authorization header is included by default unless UNAUTHENTICED-P is non-nil." (url-retrieve-synchronously url) (url-retrieve-synchronously url nil nil mastodon-http--timeout))))) -(defun mastodon-http--read-file-as-string (filename) - "Read a file FILENAME as a string. Used to generate image preview." - (with-temp-buffer - (insert-file-contents filename) - (string-to-unibyte (buffer-string)))) - (defun mastodon-http--get (url) "Make synchronous GET request to URL. -- cgit v1.2.3