From a1989a66eb726c935c51ed50720e8cbee8834cfb Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 7 Dec 2023 23:34:18 -0800 Subject: Fix warnings, mainly about missing docstrings --- tekuti.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tekuti.el b/tekuti.el index ff25a4d..de591b7 100644 --- a/tekuti.el +++ b/tekuti.el @@ -74,7 +74,7 @@ with a ‘/’.") (`("COMMENTS" ,status) (if (string= status "on") pair - (error "Unknown value for comments: %s; Can only be ‘on’ or not present." + (error "Unknown value for comments: %s; Can only be ‘on’ or absent" status))) (_ pair))) @@ -105,9 +105,11 @@ with a ‘/’.") defaults)))) (defun tekuti-form-encode-pair (key value) + "Make sure KEY and VALUE are properly form-encoded." (concat (url-hexify-string key) "=" (url-hexify-string value))) (defun tekuti-form-encode-data (data) + "Convert DATA from an alist to a form-encoded string." (mapconcat (lambda (pair) (tekuti-form-encode-pair (downcase (car pair)) (cadr pair))) @@ -115,6 +117,12 @@ with a ‘/’.") "&")) (defun tekuti--send-finished (status buffer args updatep) + "Callback for when the request to tekuti finishes. +STATUS is the full data structure sent on by ‘url-retrieve’. +BUFFER is the buffer that was published. ARGS is a list +containing the data that was collected from the buffer to make +the request. UPDATEP is a boolean indicating whether a post was +updated or created." (pcase-exhaustive status (`(:redirect ,url . ,_) (save-excursion @@ -143,12 +151,16 @@ with a ‘/’.") (message "Failed to %s post: %d" (if updatep "update" "create") code)))) (defun tekuti--get-update-url () + "Try and get the value of the ‘UPDATE_URL’ property in the current buffer." (save-excursion (goto-char (point-min)) (car (map-elt (org-collect-keywords '("UPDATE_URL")) "UPDATE_URL")))) ;;;###autoload (defun tekuti-send () + "Export and send the current buffer to tekuti. +The current buffer should be an ‘org-mode’ buffer that you wish +to post to your tekuti blog." (interactive) (let* ((data (tekuti-build-data-from-org)) (url-request-method "POST") -- cgit v1.2.3-54-g00ecf