summaryrefslogtreecommitdiff
path: root/gnu/packages/emacs-xyz.scm
diff options
context:
space:
mode:
authorBrian Leung <bkleung89@gmail.com>2019-09-01 19:46:27 +0200
committerOleg Pykhalov <go.wigust@gmail.com>2019-09-03 09:51:53 +0300
commit663bc5ded8eaf397040684440ba51e8b61535a1f (patch)
tree6fc101ddc1e9a8ac09d50c875172e5bd57c40d48 /gnu/packages/emacs-xyz.scm
parent6ec2450f1e1311d13d7f5d84346998b44014d4b3 (diff)
downloadpatches-663bc5ded8eaf397040684440ba51e8b61535a1f.tar
patches-663bc5ded8eaf397040684440ba51e8b61535a1f.tar.gz
gnu: Add emacs-ts.
* gnu/packages/emacs-xyz.scm (emacs-ts): New variable. Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com>
Diffstat (limited to 'gnu/packages/emacs-xyz.scm')
-rw-r--r--gnu/packages/emacs-xyz.scm63
1 files changed, 63 insertions, 0 deletions
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 0c6077770b..f810d2ad8e 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -11113,6 +11113,69 @@ into sections while preserving the structure imposed by any timestamps.")
tables of contents.")
(license license:gpl3+)))
+(define-public emacs-ts
+ (let ((commit "93c074f2895a204e003e8c7f3033c37d6486fac8")
+ (revision "1"))
+ (package
+ (name "emacs-ts")
+ (version (git-version "0.1" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/alphapapa/ts.el")
+ (commit commit)))
+ (sha256
+ (base32
+ "0lpyv78k04vbp9glnv14dawcfgi3m49847wlgwfmkdq5cr3fn735"))
+ (file-name (git-file-name name version))))
+ (build-system emacs-build-system)
+ (propagated-inputs
+ `(("emacs-s" ,emacs-s)
+ ("emacs-dash" ,emacs-dash)))
+ (arguments
+ ;; XXX: Three tests are failing because of a timezone-related issue
+ ;; with how they're written. On my machine, all the failing test
+ ;; results are 18000 seconds (5 hours) off.
+
+ ;; The ts-parse-org function accepts a string without any timezone
+ ;; info, not assumed to be in Unix time, and converts it to a so-called
+ ;; ts struct. The ts-unix function (accessor) accepts a ts struct,
+ ;; then seems to assume the struct's corresponding time is in terms of
+ ;; the user's current time zone, before returning a Unix time in
+ ;; seconds.
+
+ ;; The failing tests all have similar problems, but nothing else about
+ ;; the library seems particularly off.
+
+ `(#:tests? #t
+ #:test-command '("emacs" "--batch"
+ "-l" "test/test.el"
+ "-f" "ert-run-tests-batch-and-exit")
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'check 'make-tests-writable
+ (lambda _
+ (make-file-writable "test/test.el")
+ #t))
+ (add-before 'check 'delete-failing-tests
+ (lambda _
+ (emacs-batch-edit-file "test/test.el"
+ `(progn (progn
+ (goto-char (point-min))
+ (dolist (test-regexp '("ert-deftest ts-format"
+ "ert-deftest ts-parse-org\\_>"
+ "ert-deftest ts-parse-org-element"))
+ (re-search-forward test-regexp)
+ (beginning-of-line)
+ (kill-sexp)))
+ (basic-save-buffer)))
+ #t)))))
+ (home-page "https://github.com/alphapapa/ts.el")
+ (synopsis "Timestamp and date/time library")
+ (description "This package facilitates manipulating dates, times, and
+timestamps by providing a @code{ts} struct.")
+ (license license:gpl3+))))
+
(define-public emacs-org-ql
(package
(name "emacs-org-ql")