[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/parseedn 3e74411f89 20/32: Add print handler for #uuid and
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/parseedn 3e74411f89 20/32: Add print handler for #uuid and #inst |
Date: |
Tue, 28 Dec 2021 14:04:42 -0500 (EST) |
branch: elpa/parseedn
commit 3e74411f8944d37ff4300b121b8b0d87771703e8
Author: Arne Brasseur <arne@arnebrasseur.net>
Commit: Arne Brasseur <arne@arnebrasseur.net>
Add print handler for #uuid and #inst
Since we parse these we should also print these.
Printing inst up to the second and without timestamp, since that is the
resolution we get from Emacs' date-to-time.
---
CHANGELOG.md | 2 ++
parseedn.el | 11 +++++++++++
test/parseedn-test-data.el | 12 +++++++++++-
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e5ffcb138c..348305ad5a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
## Added
+- Added print handler for `#uuid` and `#inst`
+
## Fixed
## Changed
diff --git a/parseedn.el b/parseedn.el
index 986b13790b..786231a6ee 100644
--- a/parseedn.el
+++ b/parseedn.el
@@ -162,6 +162,13 @@ TAG-READERS is an optional association list. For more
information, see
(insert ", ")
(parseedn-print-plist next))))
+(defun parseedn-print-inst (time)
+ "Insert an inst value into the current buffer.
+
+Take an encode-time style value and print it as a timestamp
+deliniated by double quotes."
+ (insert (format-time-string "\"%Y-%m-%dT%T\"" time)))
+
(defun parseedn-alist-p (list)
"Non-null if and only if LIST is an alist with simple keys."
(while (consp list)
@@ -224,6 +231,10 @@ DATUM can be any Emacs Lisp value."
(error "Don't know how to print: %s" datum))
((eq 'edn-set (car datum))
(insert "#{") (parseedn-print-seq (cadr datum)) (insert "}"))
+ ((eq 'edn-uuid (car datum))
+ (insert "#uuid ") (parseedn-print-seq (cdr datum)))
+ ((eq 'edn-inst (car datum))
+ (insert "#inst ") (parseedn-print-inst (cdr datum)))
(t (insert "(") (parseedn-print-seq datum) (insert ")"))))
(t (error "Don't know how to print: %s" datum))))
diff --git a/test/parseedn-test-data.el b/test/parseedn-test-data.el
index a862403030..5b029dc03f 100644
--- a/test/parseedn-test-data.el
+++ b/test/parseedn-test-data.el
@@ -340,6 +340,16 @@
"booleans"
(a-list
:source "[nil true false]"
- :edn '([nil t nil]))))
+ :edn '([nil t nil]))
+
+ "uuid"
+ (a-list
+ :source "#uuid \"c9c4eac2-7b23-4d62-a444-41a72dc09039\""
+ :edn '((edn-uuid "c9c4eac2-7b23-4d62-a444-41a72dc09039")))
+
+ "inst"
+ (a-list
+ :source "#inst \"2020-09-09T06:56:04\""
+ :edn '((edn-inst 24408 24676 )))))
;;; parseedn-test-data.el ends here
- [nongnu] branch elpa/parseedn created (now e5ba280d1f), ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn edfee3ae28 26/32: Bump versions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn d6abb3adf7 25/32: Update parseclj dependency to 1.0.2, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn 9c2a37d02c 04/32: Add a missing require, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn 2a30c83198 02/32: Tweak the keywords, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn 3f93aab1ed 23/32: Remove the a.el dependency, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn 876dfead6b 16/32: Fix reference to parseedn-print-kvs -> parseedn-print-hash-or-alist, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn d25ebc5554 18/32: Add CHANGELOG.md, prep for v0.2.0, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn e7ff673cd9 24/32: Release 1.0, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn 3e0b5d729e 09/32: Fix references in tests: s/parseclj/parseedn, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn 3e74411f89 20/32: Add print handler for #uuid and #inst,
ELPA Syncer <=
- [nongnu] elpa/parseedn e1de65e463 30/32: Merge pull request #10 from clojure-emacs/cl-case-to-cond, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn 90cfe3df51 19/32: Add date/sha to CHANGELOG, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn 6d80a59673 14/32: Add support for alist, plist and an explicit error for unsupported dotted pair notation., ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn ff3cb233bc 07/32: Bump the copyright years, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn 5470d4ed67 21/32: Fix the inst parsing test for the case where TZ=UTC, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn acbea6bb1e 03/32: Fix a typo, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn ddf824bc1d 08/32: Update the installation instructions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn 4efa23a851 15/32: oops! fix test., ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn 1a3640d298 29/32: Replace `cl-case` with `cond`, ELPA Syncer, 2021/12/28
- [nongnu] elpa/parseedn b00eb42a1c 28/32: Update the required Emacs version, ELPA Syncer, 2021/12/28