|
|
|
@ -31,21 +31,21 @@ |
|
|
|
(defun dash--print-lisp-as-texi (obj) |
|
|
|
(defun dash--print-lisp-as-texi (obj) |
|
|
|
"Print Lisp OBJ suitably for Texinfo." |
|
|
|
"Print Lisp OBJ suitably for Texinfo." |
|
|
|
(let ((print-quoted t) |
|
|
|
(let ((print-quoted t) |
|
|
|
(print-escape-control-characters t)) |
|
|
|
(print-escape-control-characters t) |
|
|
|
(save-excursion (prin1 obj))) |
|
|
|
(case-fold-search nil)) |
|
|
|
(while (re-search-forward (rx (| (group ?\' symbol-start "nil" symbol-end) |
|
|
|
(save-excursion (prin1 obj)) |
|
|
|
(group "\\?") (group "\\00") (in "{}"))) |
|
|
|
(while (re-search-forward (rx (| (group ?\' symbol-start "nil" symbol-end) |
|
|
|
nil 'move) |
|
|
|
(group "\\?") (group "\\00") (in "{}"))) |
|
|
|
(replace-match (cond ((match-beginning 1) "'()") ; 'nil -> '(). |
|
|
|
nil 'move) |
|
|
|
((match-beginning 2) "?") ; `-any\?' -> `-any?'. |
|
|
|
(replace-match (cond ((match-beginning 1) "'()") ; 'nil -> '(). |
|
|
|
((match-beginning 3) "\\\\") ; \00N -> \N. |
|
|
|
((match-beginning 2) "?") ; `-any\?' -> `-any?'. |
|
|
|
("@\\&")) ; { -> @{. |
|
|
|
((match-beginning 3) "\\\\") ; \00N -> \N. |
|
|
|
t))) |
|
|
|
("@\\&")) ; { -> @{. |
|
|
|
|
|
|
|
t)))) |
|
|
|
|
|
|
|
|
|
|
|
(defun example-to-string (example) |
|
|
|
(defun example-to-string (example) |
|
|
|
(pcase-let* ((`(,actual ,err ,expected) example) |
|
|
|
(pcase-let* ((`(,actual ,err ,expected) example) |
|
|
|
(err (eq err '!!>)) |
|
|
|
(err (eq err '!!>))) |
|
|
|
(case-fold-search nil)) |
|
|
|
|
|
|
|
(and err (consp expected) |
|
|
|
(and err (consp expected) |
|
|
|
(setq expected (error-message-string expected))) |
|
|
|
(setq expected (error-message-string expected))) |
|
|
|
(with-output-to-string |
|
|
|
(with-output-to-string |
|
|
|
|