X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Frstdoc.el;h=63fa2794c08c176ef116611e5d4d8fca0cda9a86;hb=a1b757c1ca111b25d3ce981942cdace04ee90429;hp=2225aefc023a2a1776f31c53332551965952a91e;hpb=6682b4e686b7972883626c9b0f941ae4bf02dedb;p=notmuch diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el index 2225aefc..63fa2794 100644 --- a/emacs/rstdoc.el +++ b/emacs/rstdoc.el @@ -24,7 +24,6 @@ ;; ;;; Commentary: -;; ;; Rstdoc provides a facility to extract all of the docstrings defined in ;; an elisp source file. Usage: @@ -33,14 +32,12 @@ ;;; Code: -(provide 'rstdoc) - (defun rstdoc-batch-extract () - "Extract docstrings to and from the files on the command line" + "Extract docstrings to and from the files on the command line." (apply #'rstdoc-extract command-line-args-left)) (defun rstdoc-extract (in-file out-file) - "Write docstrings from IN-FILE to OUT-FILE" + "Write docstrings from IN-FILE to OUT-FILE." (load-file in-file) (let* ((definitions (cdr (assoc (expand-file-name in-file) load-history))) (doc-hash (make-hash-table :test 'eq))) @@ -63,15 +60,16 @@ (defun rstdoc--insert-docstring (symbol docstring) (insert (format "\n.. |docstring::%s| replace::\n" symbol)) - (insert (replace-regexp-in-string "^" " " (rstdoc--rst-quote-string docstring))) + (insert (replace-regexp-in-string "^" " " + (rstdoc--rst-quote-string docstring))) (insert "\n")) (defvar rst--escape-alist - '( ("\\\\='" . "\\\\'") - ("\\([^\\]\\)'" . "\\1`") - ("^[[:space:]\t]*$" . "|br|") - ("^[[:space:]\t]" . "|indent| ")) - "list of (regex . replacement) pairs") + '(("\\\\='" . "\\\\'") + ("\\([^\\]\\)'" . "\\1`") + ("^[[:space:]\t]*$" . "|br|") + ("^[[:space:]\t]" . "|indent| ")) + "List of (regex . replacement) pairs.") (defun rstdoc--rst-quote-string (str) (with-temp-buffer @@ -82,4 +80,6 @@ (replace-match (cdr pair)))) (buffer-substring (point-min) (point-max)))) +(provide 'rstdoc) + ;;; rstdoc.el ends here