Make manual generation more consistent with README

* dev/examples-to-info.el (format-docstring): Remove unneeded
with-output-to-string.
(create-info-file):
* dash-template.texi (Top, Functions): Rename function-nodes to
function-list.
master
Basil L. Contovounesios 5 years ago
parent d76505d4e6
commit 47114ca462
No known key found for this signature in database
GPG Key ID: 205AB54A5D5D8CFF
  1. 4
      dash-template.texi
  2. 50
      dev/examples-to-info.el

@ -68,7 +68,7 @@ Installation
Functions
@c [[ function-nodes ]]
@c [[ function-list ]]
Development
@ -205,7 +205,7 @@ example, which demonstrates the utility of both versions.
@end lisp
@menu
@c [[ function-nodes ]]
@c [[ function-list ]]
@end menu
@c [[ function-docs ]]

@ -86,30 +86,30 @@ Based on `describe-function-1'."
(defun format-docstring (docstring)
(let ((case-fold-search nil))
(with-output-to-string
(with-current-buffer standard-output
(insert docstring)
;; Escape literal ?@.
(dash--replace-all "@" "@@")
(goto-char (point-min))
(while (re-search-forward
(rx (| (group bow (in "A-Z") (* (in "A-Z" ?-)) (* num) eow)
(: ?` (group (+ (not (in ?\s)))) ?\')
(: "..." (? (group eol)))))
nil t)
(cond ((match-beginning 1)
;; Downcase metavariable reference.
(downcase-region (match-beginning 1) (match-end 1))
(replace-match "@var{\\1}" t))
((match-beginning 2)
;; `quoted' symbol.
(replace-match (if (assq (intern (match-string 2)) functions)
"@code{\\2} (@pxref{\\2})"
"@code{\\2}")
t))
;; Ellipses.
((match-beginning 3) (replace-match "@enddots{}" t t))
((replace-match "@dots{}" t t))))))))
(with-temp-buffer
(insert docstring)
;; Escape literal ?@.
(dash--replace-all "@" "@@")
(goto-char (point-min))
(while (re-search-forward
(rx (| (group bow (in "A-Z") (* (in "A-Z" ?-)) (* num) eow)
(: ?` (group (+ (not (in ?\s)))) ?\')
(: "..." (? (group eol)))))
nil t)
(cond ((match-beginning 1)
;; Downcase metavariable reference.
(downcase-region (match-beginning 1) (match-end 1))
(replace-match "@var{\\1}" t))
((match-beginning 2)
;; `quoted' symbol.
(replace-match (if (assq (intern (match-string 2)) functions)
"@code{\\2} (@pxref{\\2})"
"@code{\\2}")
t))
;; Ellipses.
((match-beginning 3) (replace-match "@enddots{}" t t))
((replace-match "@dots{}" t t))))
(buffer-string))))
(defun function-to-info (function)
(pcase function
@ -145,7 +145,7 @@ Based on `describe-function-1'."
(lm-version (format "%s.el" pkg))))
(dash--replace-all
"@c [[ function-nodes ]]"
"@c [[ function-list ]]"
(mapconcat (lambda (s) (concat "* " s "::"))
(-filter (lambda (s)
(and (stringp s)

Loading…
Cancel
Save