Fix docstring Texinfo generation

* dev/examples-to-info.el (format-docstring): Generalize @-quoting
by doing it first.  Use \< and \> in place of \b for better word
boundary detection.  Mark all replacements as fixed and literal.
* dash.texi: Regenerate.
master
Basil L. Contovounesios 5 years ago
parent 65eeaf6f8b
commit eedc2affad
No known key found for this signature in database
GPG Key ID: 205AB54A5D5D8CFF
  1. 12
      dash.texi
  2. 9
      dev/examples-to-info.el

@ -2064,8 +2064,8 @@ Return a list of ((-filter @var{pred} @var{list}) (-remove @var{pred} @var{list}
@anchor{-partition}
@defun -partition (n list)
Return a new list with the items in @var{list} grouped into @var{n-}sized sublists.
If there are not enough items to make the last group @var{n-}sized,
Return a new list with the items in @var{list} grouped into @var{n}-sized sublists.
If there are not enough items to make the last group @var{n}-sized,
those items are discarded.
@example
@ -2086,7 +2086,7 @@ those items are discarded.
@anchor{-partition-all}
@defun -partition-all (n list)
Return a new list with the items in @var{list} grouped into @var{n-}sized sublists.
Return a new list with the items in @var{list} grouped into @var{n}-sized sublists.
The last group may contain less than @var{n} items.
@example
@ -2107,8 +2107,8 @@ The last group may contain less than @var{n} items.
@anchor{-partition-in-steps}
@defun -partition-in-steps (n step list)
Return a new list with the items in @var{list} grouped into @var{n-}sized sublists at offsets @var{step} apart.
If there are not enough items to make the last group @var{n-}sized,
Return a new list with the items in @var{list} grouped into @var{n}-sized sublists at offsets @var{step} apart.
If there are not enough items to make the last group @var{n}-sized,
those items are discarded.
@example
@ -2129,7 +2129,7 @@ those items are discarded.
@anchor{-partition-all-in-steps}
@defun -partition-all-in-steps (n step list)
Return a new list with the items in @var{list} grouped into @var{n-}sized sublists at offsets @var{step} apart.
Return a new list with the items in @var{list} grouped into @var{n}-sized sublists at offsets @var{step} apart.
The last groups may contain less than @var{n} items.
@example

@ -94,10 +94,11 @@ Based on `describe-function-1'."
(defun format-docstring (docstring)
(let (case-fold-search)
(--> docstring
(replace-regexp-in-string "\\b\\([A-Z][A-Z-]*[0-9]*\\)\\b" 'quote-and-downcase it t)
(replace-regexp-in-string "`\\([^ ]+\\)'" 'unquote-and-link it t)
(replace-regexp-in-string "{,@}" "{,@@}" it t)
(replace-regexp-in-string "^ " " " it)
(replace-regexp-in-string "@" "@@" it t t)
(replace-regexp-in-string "\\<\\([A-Z][A-Z-]*[0-9]*\\)\\>"
#'quote-and-downcase it t t)
(replace-regexp-in-string "`\\([^ ]+\\)'" #'unquote-and-link it t t)
(replace-regexp-in-string "^ " " " it t t)
(replace-regexp-in-string
"\\.\\.\\.\\($\\)?"
(lambda (_) (if (match-beginning 1) "@enddots{}" "@dots{}"))

Loading…
Cancel
Save