[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 7a9c937 250/316: Translate non-printable chars in
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash 7a9c937 250/316: Translate non-printable chars in docs |
Date: |
Mon, 15 Feb 2021 15:58:11 -0500 (EST) |
branch: externals/dash
commit 7a9c9378772b687a452966ce4745c54afb19a2fc
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
Translate non-printable chars in docs
* dev/examples-to-docs.el (example-to-string):
* dev/examples-to-info.el (example-to-string): Translate chars like
\^A to their printable representations.
* dev/examples.el (-cut): Evaluate quoted lambda in example.
* README.md:
* dash.texi: Regenerate docs.
---
README.md | 4 ++--
dash.texi | 6 +++---
dev/examples-to-docs.el | 7 ++++---
dev/examples-to-info.el | 8 ++++++--
dev/examples.el | 4 ++--
5 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index 4310c1a..430e737 100644
--- a/README.md
+++ b/README.md
@@ -2875,8 +2875,8 @@ See `srfi-26` for detailed description.
```el
(funcall (-cut list 1 <> 3 <> 5) 2 4) ;; => '(1 2 3 4 5)
-(-map (-cut funcall <> 5) '(1+ 1- (lambda (x) (/ 1.0 x)))) ;; => '(6 4 0.2)
-(-map (-cut <> 1 2 3) (list 'list 'vector 'string)) ;; => '((1 2 3) [1 2 3]
"")
+(-map (-cut funcall <> 5) `(1+ 1- ,(lambda (x) (/ 1.0 x)))) ;; => '(6 4 0.2)
+(-map (-cut <> 1 2 3) '(list vector string)) ;; => '((1 2 3) [1 2 3]
"\^A\^B\^C")
```
#### -not `(pred)`
diff --git a/dash.texi b/dash.texi
index 97969a6..77ee980 100644
--- a/dash.texi
+++ b/dash.texi
@@ -4383,12 +4383,12 @@ See @var{srfi-26} for detailed description.
@result{} '(1 2 3 4 5)
@end group
@group
-(-map (-cut funcall <> 5) '(1+ 1- (lambda (x) (/ 1.0 x))))
+(-map (-cut funcall <> 5) `(1+ 1- ,(lambda (x) (/ 1.0 x))))
@result{} '(6 4 0.2)
@end group
@group
-(-map (-cut <> 1 2 3) (list 'list 'vector 'string))
- @result{} '((1 2 3) [1 2 3] "")
+(-map (-cut <> 1 2 3) '(list vector string))
+ @result{} '((1 2 3) [1 2 3] "\^A\^B\^C")
@end group
@end example
@end defmac
diff --git a/dev/examples-to-docs.el b/dev/examples-to-docs.el
index fbc65d9..764b002 100644
--- a/dev/examples-to-docs.el
+++ b/dev/examples-to-docs.el
@@ -38,9 +38,10 @@
((error "Invalid test case: %S" example)))
(format "%S ;; %s" actual it)
(replace-regexp-in-string "\\\\\\?" "?" it t t)
- (replace-regexp-in-string "\n" "\\n" it t t)
- (replace-regexp-in-string "\t" "\\t" it t t)
- (replace-regexp-in-string "\r" "\\r" it t t))))
+ (replace-regexp-in-string
+ "[^\n[:print:]]"
+ (lambda (s) (concat "\\" (text-char-description (string-to-char s))))
+ it t t))))
(defun docs--signature (function)
"Given FUNCTION (a symbol), return its argument list.
diff --git a/dev/examples-to-info.el b/dev/examples-to-info.el
index a1460b6..67de701 100644
--- a/dev/examples-to-info.el
+++ b/dev/examples-to-info.el
@@ -38,13 +38,17 @@
(setq expected (error-message-string expected)))
(--> (format "@group\n%S\n %s %S\n@end group"
actual (if err "@error{}" "@result{}") expected)
- (replace-regexp-in-string "\\\\\\?" "?" it)
+ (replace-regexp-in-string "\\\\\\?" "?" it t t)
(replace-regexp-in-string "{\"" "@{\"" it t t)
(replace-regexp-in-string "}\"" "@}\"" it t t)
(replace-regexp-in-string " {" " @{" it t t)
(replace-regexp-in-string "\"{" "\"@{" it t t)
(replace-regexp-in-string "}," "@{," it t t)
- (replace-regexp-in-string "}@}" "@}@}" it t t))))
+ (replace-regexp-in-string "}@}" "@}@}" it t t)
+ (replace-regexp-in-string
+ "[^\n[:print:]]"
+ (lambda (s) (concat "\\" (text-char-description (string-to-char s))))
+ it t t))))
(defun docs--signature (function)
"Given FUNCTION (a symbol), return its argument list.
diff --git a/dev/examples.el b/dev/examples.el
index f298300..27fd012 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -1558,8 +1558,8 @@ value rather than consuming a list to produce a single
value."
(defexamples -cut
(funcall (-cut list 1 <> 3 <> 5) 2 4) => '(1 2 3 4 5)
- (-map (-cut funcall <> 5) '(1+ 1- (lambda (x) (/ 1.0 x)))) => '(6 4 0.2)
- (-map (-cut <> 1 2 3) (list 'list 'vector 'string)) => '((1 2 3) [1 2 3]
"")
+ (-map (-cut funcall <> 5) `(1+ 1- ,(lambda (x) (/ 1.0 x)))) => '(6 4 0.2)
+ (-map (-cut <> 1 2 3) '(list vector string)) => '((1 2 3) [1 2 3] "")
(-filter (-cut < <> 5) '(1 3 5 7 9)) => '(1 3))
(defexamples -not
- [elpa] externals/dash 8f90dd7 121/316: Handle empty list in -reductions[-r], (continued)
- [elpa] externals/dash 8f90dd7 121/316: Handle empty list in -reductions[-r], ELPA Syncer, 2021/02/15
- [elpa] externals/dash 453c775 115/316: Fix -setq docstring fn reference, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 85e8f62 119/316: Merge pull request #274 from magnars/doublep-each-r, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1e22ef6 125/316: Merge pull request #263 from basil-conto/blc/common-suffix, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 78fee36 190/316: * .dir-locals.el (sh-mode): Enforce indentation., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1d897cc 199/316: Simplify examples-to-docs a bit, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3d38fa2 213/316: Use actual dash-functional.el version in manual, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 92393c7 220/316: Clean up core definitions, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3034638 232/316: Tidy up -grade-up and -grade-down a bit, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 9256290 241/316: * dash.el (-->): Indent with 1 distinguished arg., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 7a9c937 250/316: Translate non-printable chars in docs,
ELPA Syncer <=
- [elpa] externals/dash 5d7077a 070/316: Set text-quoting-style, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 322373a 141/316: Remove mention of Marmalade, ELPA Syncer, 2021/02/15
- [elpa] externals/dash a5706bb 144/316: More test to cover cases on different `-compare-fn`, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 25030c9 150/316: Fix test harness in Emacs 27, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 68bd347 160/316: Fix typos, ELPA Syncer, 2021/02/15
- [elpa] externals/dash e85ed7a 163/316: Merge pull request #324 from wbolster/use-bash-for-pre-commit-script, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1db0854 176/316: Add badges to README., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 0517ab1 185/316: Optimize -cycle a bit, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3950c48 189/316: ; Fix typo in version of recent obsoletion, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 8a33835 191/316: .gitignore: Ignore second dir-locals-file., ELPA Syncer, 2021/02/15