Fix warnings, mainly about missing docstrings
This commit is contained in:
parent
4350856f99
commit
a1989a66eb
1 changed files with 13 additions and 1 deletions
14
tekuti.el
14
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")
|
||||
|
|
Loading…
Reference in a new issue