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 Functions
@c [[ function-nodes ]] @c [[ function-list ]]
Development Development
@ -205,7 +205,7 @@ example, which demonstrates the utility of both versions.
@end lisp @end lisp
@menu @menu
@c [[ function-nodes ]] @c [[ function-list ]]
@end menu @end menu
@c [[ function-docs ]] @c [[ function-docs ]]

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

Loading…
Cancel
Save