[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 5f25ce1 40/46: tiny.el: handle quotes in FMT part
From: |
Oleh Krehel |
Subject: |
[elpa] master 5f25ce1 40/46: tiny.el: handle quotes in FMT part |
Date: |
Sun, 22 Mar 2015 17:42:39 +0000 |
branch: master
commit 5f25ce1eaedafdde1b61922b9354ccf836469d0d
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
tiny.el: handle quotes in FMT part
* tiny-test.el: Update tests.
* tiny.el (tiny-mapconcat): Use %S instead of \"%s\".
---
tiny-test.el | 28 ++++++++++++++--------------
tiny.el | 13 +++++++------
2 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/tiny-test.el b/tiny-test.el
index 9a47a97..05cfcfc 100644
--- a/tiny-test.el
+++ b/tiny-test.el
@@ -127,35 +127,35 @@ convert img10.jpg -monochrome -resize 50% -rotate 180
img10_mono.pdf"))
(should (equal (with-text-value "m\\n8|**** TODO Learning from Data Week %(+
x 2)\\nSCHEDULED: <%(date \"Oct 7\" (* x 7))> DEADLINE: <%(date \"Oct 14\" (* x
7))>"
(lambda()(eval (read (tiny-mapconcat)))))
"**** TODO Learning from Data Week 2
-SCHEDULED: <2014-10-07 Tue> DEADLINE: <2014-10-14 Tue>
+SCHEDULED: <2015-10-07 Wed> DEADLINE: <2015-10-14 Wed>
**** TODO Learning from Data Week 3
-SCHEDULED: <2014-10-14 Tue> DEADLINE: <2014-10-21 Tue>
+SCHEDULED: <2015-10-14 Wed> DEADLINE: <2015-10-21 Wed>
**** TODO Learning from Data Week 4
-SCHEDULED: <2014-10-21 Tue> DEADLINE: <2014-10-28 Tue>
+SCHEDULED: <2015-10-21 Wed> DEADLINE: <2015-10-28 Wed>
**** TODO Learning from Data Week 5
-SCHEDULED: <2014-10-28 Tue> DEADLINE: <2014-11-04 Tue>
+SCHEDULED: <2015-10-28 Wed> DEADLINE: <2015-11-04 Wed>
**** TODO Learning from Data Week 6
-SCHEDULED: <2014-11-04 Tue> DEADLINE: <2014-11-11 Tue>
+SCHEDULED: <2015-11-04 Wed> DEADLINE: <2015-11-11 Wed>
**** TODO Learning from Data Week 7
-SCHEDULED: <2014-11-11 Tue> DEADLINE: <2014-11-18 Tue>
+SCHEDULED: <2015-11-11 Wed> DEADLINE: <2015-11-18 Wed>
**** TODO Learning from Data Week 8
-SCHEDULED: <2014-11-18 Tue> DEADLINE: <2014-11-25 Tue>
+SCHEDULED: <2015-11-18 Wed> DEADLINE: <2015-11-25 Wed>
**** TODO Learning from Data Week 9
-SCHEDULED: <2014-11-25 Tue> DEADLINE: <2014-12-02 Tue>
+SCHEDULED: <2015-11-25 Wed> DEADLINE: <2015-12-02 Wed>
**** TODO Learning from Data Week 10
-SCHEDULED: <2014-12-02 Tue> DEADLINE: <2014-12-09 Tue>"))
+SCHEDULED: <2015-12-02 Wed> DEADLINE: <2015-12-09 Wed>"))
(should (string= (with-text-value "m\\n4|**** TODO Classical Mechanics Week
%(+ x 5)\\nSCHEDULED: <%(date \"Oct 15\" (* x 7))> DEADLINE: <%(date \"Oct 23\"
(* x 7))>"
(lambda()(eval (read (tiny-mapconcat)))))
"**** TODO Classical Mechanics Week 5
-SCHEDULED: <2014-10-15 Wed> DEADLINE: <2014-10-23 Thu>
+SCHEDULED: <2015-10-15 Thu> DEADLINE: <2015-10-23 Fri>
**** TODO Classical Mechanics Week 6
-SCHEDULED: <2014-10-22 Wed> DEADLINE: <2014-10-30 Thu>
+SCHEDULED: <2015-10-22 Thu> DEADLINE: <2015-10-30 Fri>
**** TODO Classical Mechanics Week 7
-SCHEDULED: <2014-10-29 Wed> DEADLINE: <2014-11-06 Thu>
+SCHEDULED: <2015-10-29 Thu> DEADLINE: <2015-11-06 Fri>
**** TODO Classical Mechanics Week 8
-SCHEDULED: <2014-11-05 Wed> DEADLINE: <2014-11-13 Thu>
+SCHEDULED: <2015-11-05 Thu> DEADLINE: <2015-11-13 Fri>
**** TODO Classical Mechanics Week 9
-SCHEDULED: <2014-11-12 Wed> DEADLINE: <2014-11-20 Thu>"))
+SCHEDULED: <2015-11-12 Thu> DEADLINE: <2015-11-20 Fri>"))
(should (string= (with-text-value "m7|%(expt 2 x)"
(lambda()(eval (read (tiny-mapconcat)))))
"1 2 4 8 16 32 64 128")))
diff --git a/tiny.el b/tiny.el
index 4d95438..5629251 100644
--- a/tiny.el
+++ b/tiny.el
@@ -182,11 +182,12 @@ Defaults are used in place of null values."
(n-need (cl-count nil (cdr tes)))
(idx -1)
(format-expression
- (concat "(mapconcat (lambda(x) (let ((lst %s)) (format \"%s\" "
- (mapconcat (lambda (x) (or x
- (if (>= (1+ idx) n-have)
- "x"
- (format "(nth %d lst)"
(incf idx)))))
+ (concat "(mapconcat (lambda(x) (let ((lst %s)) (format %S "
+ (mapconcat (lambda (x)
+ (or x
+ (if (>= (1+ idx) n-have)
+ "x"
+ (format "(nth %d lst)" (incf idx)))))
(cdr tes)
" ")
")))(number-sequence %s %s) \"%s\")")))
@@ -194,7 +195,7 @@ Defaults are used in place of null values."
(format
format-expression
expr
- fmt
+ (replace-regexp-in-string "\\\\n" "\n" fmt)
n1
n2
s1))))))
- [elpa] master cf74dd1 34/46: tiny.el: fix docs, (continued)
- [elpa] master cf74dd1 34/46: tiny.el: fix docs, Oleh Krehel, 2015/03/22
- [elpa] master b843226 26/46: tiny.el: removed `tiny-replace-sexp-desperately', Oleh Krehel, 2015/03/22
- [elpa] master 7893a02 35/46: tiny.el: add autoload to `tiny-expand', Oleh Krehel, 2015/03/22
- [elpa] master 075e4d0 33/46: Fix "m10|%0.2f", Oleh Krehel, 2015/03/22
- [elpa] master 4eef4e6 37/46: tiny.el: add a test case, Oleh Krehel, 2015/03/22
- [elpa] master 3a56283 38/46: tiny.el (tiny-mapconcat-parse): case-sensitive, Oleh Krehel, 2015/03/22
- [elpa] master dea7748 39/46: tiny.el (tiny-date): improve, Oleh Krehel, 2015/03/22
- [elpa] master ea7a184 42/46: tiny-test.el (tiny-mapconcat): Add test., Oleh Krehel, 2015/03/22
- [elpa] master d37646a 41/46: Add Travis CI testing and Coveralls.io reporting, Oleh Krehel, 2015/03/22
- [elpa] master fe0bade 43/46: tiny-test.el: Update, Oleh Krehel, 2015/03/22
- [elpa] master 5f25ce1 40/46: tiny.el: handle quotes in FMT part,
Oleh Krehel <=
- [elpa] master fa90c2f 44/46: README.md: Add badges, Oleh Krehel, 2015/03/22
- [elpa] master 6719ab2 32/46: README.md: updated., Oleh Krehel, 2015/03/22
- [elpa] master 159c3f7 45/46: tiny.el: Update Copyright, Oleh Krehel, 2015/03/22
- [elpa] master 3f035ad 46/46: Add 'packages/tiny/' from commit '159c3f74e75970808b83fe4b732f180cb76872a3', Oleh Krehel, 2015/03/22