[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 9727f7c 288/316: Simplify Lisp -> Texinfo printing
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash 9727f7c 288/316: Simplify Lisp -> Texinfo printing |
Date: |
Mon, 15 Feb 2021 15:58:19 -0500 (EST) |
branch: externals/dash
commit 9727f7c38c0997d574e73a8d75b783cc76d81c7d
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
Simplify Lisp -> Texinfo printing
* dev/examples-to-info.el (dash--print-lisp-as-texi): Use
print-escape-control-characters instead of emulating it.
* dash.texi: Regenerate.
---
dash.texi | 2 +-
dev/examples-to-info.el | 27 +++++++++------------------
2 files changed, 10 insertions(+), 19 deletions(-)
diff --git a/dash.texi b/dash.texi
index f6149b5..aae4f9f 100644
--- a/dash.texi
+++ b/dash.texi
@@ -4345,7 +4345,7 @@ See @var{srfi-26} for detailed description.
@end group
@group
(-map (-cut <> 1 2 3) '(list vector string))
- @result{} '((1 2 3) [1 2 3] "\^A\^B\^C")
+ @result{} '((1 2 3) [1 2 3] "\1\2\3")
@end group
@end example
@end defmac
diff --git a/dev/examples-to-info.el b/dev/examples-to-info.el
index da5da5d..1730a46 100644
--- a/dev/examples-to-info.el
+++ b/dev/examples-to-info.el
@@ -30,25 +30,16 @@
(defun dash--print-lisp-as-texi (obj)
"Print Lisp OBJ suitably for Texinfo."
- (save-excursion (let ((print-quoted t)) (prin1 obj)))
- (while (re-search-forward (rx (| (group "\\?")
- (group (in "{}"))
- (group ?\' symbol-start "nil" symbol-end)
- (not (in ?\n print))))
+ (let ((print-quoted t)
+ (print-escape-control-characters t))
+ (save-excursion (prin1 obj)))
+ (while (re-search-forward (rx (| (group ?\' symbol-start "nil" symbol-end)
+ (group "\\?") (in "{}")))
nil 'move)
- (cond ((match-beginning 1)
- ;; Unescape `-any\?' -> `-any?'.
- (delete-region (- (point) 2) (1- (point))))
- ((match-beginning 2)
- ;; Escape braces with @.
- (backward-char)
- (insert ?@)
- (forward-char))
- ;; Don't let '() be printed as 'nil.
- ((match-beginning 3) (replace-match "'()" t t))
- ;; Translate unprintable characters such as ?\^A.
- ((let ((desc (text-char-description (preceding-char))))
- (replace-match (concat "\\" desc) t t))))))
+ (replace-match (cond ((match-beginning 1) "'()") ; 'nil -> '().
+ ((match-beginning 2) "?") ; `-any\?' -> `-any?'.
+ ("@\\&")) ; { -> @{.
+ t)))
(defun example-to-string (example)
(pcase-let* ((`(,actual ,err ,expected) example)
- [elpa] externals/dash 5eea156 315/316: Absorb dash-functional into dash, (continued)
- [elpa] externals/dash 5eea156 315/316: Absorb dash-functional into dash, ELPA Syncer, 2021/02/15
- [elpa] externals/dash eaf33b3 226/316: Add info-lookup-symbol support, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 565055e 229/316: * dash.el (---truthy?): Simplify., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 97bd233 231/316: Use lexical binding for -grade-up/down, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1152feb 237/316: Deprecate variadic -list, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 609ac28 245/316: Improve Texinfo markup when documenting errors, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 999cae9 253/316: Fix short-circuiting of --first, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3726eb1 254/316: Improve the examples of -some, ELPA Syncer, 2021/02/15
- [elpa] externals/dash b0bef0f 276/316: Don't set text-quoting-style globally, ELPA Syncer, 2021/02/15
- [elpa] externals/dash bedc804 282/316: Improve function-to-info, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 9727f7c 288/316: Simplify Lisp -> Texinfo printing,
ELPA Syncer <=
- [elpa] externals/dash 7b2584c 294/316: Simplify GitHub link creation, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 7048e68 296/316: Restore some newlines in docstrings, ELPA Syncer, 2021/02/15
- [elpa] externals/dash f6554c3 298/316: Unquote results in README examples, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 39e5b12 306/316: Merge pull request #370 from blc/news, ELPA Syncer, 2021/02/15
- [elpa] externals/dash af21da3 307/316: * dash-functional.el: Fix Author header., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 9c6b979 309/316: Unify dev/examples-to-*.el files, ELPA Syncer, 2021/02/15