Fix warnings, mainly about missing docstrings

This commit is contained in:
Tom Willemse 2023-12-07 23:34:18 -08:00
parent 4350856f99
commit a1989a66eb

View file

@ -74,7 +74,7 @@ with a /.")
(`("COMMENTS" ,status) (`("COMMENTS" ,status)
(if (string= status "on") (if (string= status "on")
pair 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))) status)))
(_ pair))) (_ pair)))
@ -105,9 +105,11 @@ with a /.")
defaults)))) defaults))))
(defun tekuti-form-encode-pair (key value) (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))) (concat (url-hexify-string key) "=" (url-hexify-string value)))
(defun tekuti-form-encode-data (data) (defun tekuti-form-encode-data (data)
"Convert DATA from an alist to a form-encoded string."
(mapconcat (mapconcat
(lambda (pair) (lambda (pair)
(tekuti-form-encode-pair (downcase (car pair)) (cadr pair))) (tekuti-form-encode-pair (downcase (car pair)) (cadr pair)))
@ -115,6 +117,12 @@ with a /.")
"&")) "&"))
(defun tekuti--send-finished (status buffer args updatep) (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 (pcase-exhaustive status
(`(:redirect ,url . ,_) (`(:redirect ,url . ,_)
(save-excursion (save-excursion
@ -143,12 +151,16 @@ with a /.")
(message "Failed to %s post: %d" (if updatep "update" "create") code)))) (message "Failed to %s post: %d" (if updatep "update" "create") code))))
(defun tekuti--get-update-url () (defun tekuti--get-update-url ()
"Try and get the value of the UPDATE_URL property in the current buffer."
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(car (map-elt (org-collect-keywords '("UPDATE_URL")) "UPDATE_URL")))) (car (map-elt (org-collect-keywords '("UPDATE_URL")) "UPDATE_URL"))))
;;;###autoload ;;;###autoload
(defun tekuti-send () (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) (interactive)
(let* ((data (tekuti-build-data-from-org)) (let* ((data (tekuti-build-data-from-org))
(url-request-method "POST") (url-request-method "POST")