[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 3a56283 38/46: tiny.el (tiny-mapconcat-parse): case-sensit
From: |
Oleh Krehel |
Subject: |
[elpa] master 3a56283 38/46: tiny.el (tiny-mapconcat-parse): case-sensitive |
Date: |
Sun, 22 Mar 2015 17:42:38 +0000 |
branch: master
commit 3a56283120d01f2fc13ef05c884a9b466644c1c8
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
tiny.el (tiny-mapconcat-parse): case-sensitive
---
tiny.el | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/tiny.el b/tiny.el
index 0fed2f2..339389c 100644
--- a/tiny.el
+++ b/tiny.el
@@ -120,6 +120,7 @@ At the moment, only `tiny-mapconcat' is supported.
"Setup shortcuts."
(global-set-key (kbd "C-;") 'tiny-expand))
+;;;###autoload
(defun tiny-replace-this-sexp ()
"Eval and replace the current sexp.
On error go up list and try again."
@@ -166,26 +167,26 @@ Must throw an error when can't go up further."
Defaults are used in place of null values."
(let ((parsed (tiny-mapconcat-parse)))
(when parsed
- (let* ((n1 (or (nth 0 parsed) "0"))
- (s1 (or (nth 1 parsed) " "))
- (n2 (nth 2 parsed))
- (expr (or (nth 3 parsed) "x"))
- (lexpr (read expr))
+ (let* ((n1 (or (nth 0 parsed) "0"))
+ (s1 (or (nth 1 parsed) " "))
+ (n2 (nth 2 parsed))
+ (expr (or (nth 3 parsed) "x"))
+ (lexpr (read expr))
(n-have (if (and (listp lexpr) (eq (car lexpr) 'list))
(1- (length lexpr))
0))
(expr (if (zerop n-have) `(list ,lexpr) lexpr))
(n-have (if (zerop n-have) 1 n-have))
- (tes (tiny-extract-sexps (or (nth 4 parsed) "%s")))
- (fmt (car tes))
+ (tes (tiny-extract-sexps (or (nth 4 parsed) "%s")))
+ (fmt (car tes))
(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)))))
+ (if (>= (1+ idx) n-have)
+ "x"
+ (format "(nth %d lst)"
(incf idx)))))
(cdr tes)
" ")
")))(number-sequence %s %s) \"%s\")")))
@@ -256,7 +257,9 @@ m[START][SEPARATOR]END[EXPR]|[FORMAT]
Return nil if nothing was matched, otherwise
(START SEPARATOR END EXPR FORMAT)"
- (let (n1 s1 n2 expr fmt str n-uses)
+ (let ((case-fold-search nil)
+ n1 s1 n2 expr fmt str
+ n-uses)
(when (catch 'done
(cond
;; either start with a number
@@ -283,7 +286,7 @@ Return nil if nothing was matched, otherwise
;; First, try to match [expr][fmt]
(string-match "^\\(.*?\\)|?\\(%.*\\)?$" str)
(setq expr (match-string-no-properties 1 str))
- (setq fmt (match-string-no-properties 2 str))
+ (setq fmt (match-string-no-properties 2 str))
;; If it's a valid expression, we're done
(when (setq expr (tiny-tokenize expr))
(setq n2 n1
- [elpa] master a6e4144 30/46: tiny.el (tiny-extract-sexps): can handle e.g. %0.1f(...) style formatting., (continued)
- [elpa] master a6e4144 30/46: tiny.el (tiny-extract-sexps): can handle e.g. %0.1f(...) style formatting., Oleh Krehel, 2015/03/22
- [elpa] master 80cd28f 28/46: tiny-test.el: added a test for `tiny-replace-this-sexp', Oleh Krehel, 2015/03/22
- [elpa] master 08ba593 24/46: tiny.el: fixed `tiny-tokenize', Oleh Krehel, 2015/03/22
- [elpa] master e6abbc6 31/46: tiny.el (tiny-date): renamed from t-date. In format string it's just "date", Oleh Krehel, 2015/03/22
- [elpa] master c59bc94 36/46: tiny.el (tiny-extract-sexps): add missing let binding, Oleh Krehel, 2015/03/22
- [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 <=
- [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, 2015/03/22
- [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