Add scratch code

This commit is contained in:
contrapunctus 2022-02-10 17:03:08 +05:30
parent 409aa0337e
commit f94ab9643b
3 changed files with 134 additions and 0 deletions

76
Makefile Normal file
View File

@ -0,0 +1,76 @@
.phony: all setup tangle compile lint
all: clean-elc manual.md setup tangle compile lint
setup:
emacs --batch --eval="(package-initialize)" \
--eval="(mapcar #'package-install '(indent-lint package-lint relint))"
manual.md:
emacs -q -Q --batch --eval="(require 'ox-md)" \
"manual.org" -f 'org-md-export-to-markdown'
# No -q or -Q without ORG_PATH - if the user has a newer version of
# Org, we want to use it.
tangle:
cd elisp/ && \
emacs --batch \
--eval="(progn (package-initialize) (require 'ob-tangle))" \
--eval='(org-babel-tangle-file "chronometrist.org")' \
--eval='(org-babel-tangle-file "chronometrist-key-values.org")' \
--eval='(org-babel-tangle-file "chronometrist-spark.org")' \
--eval='(org-babel-tangle-file "chronometrist-third.org")' ; \
cd ..
compile: tangle
cd elisp/ && \
emacs --batch \
--eval="(progn (package-initialize) (require 'dash) (require 'ts))" \
--eval='(byte-compile-file "chronometrist.el")' \
--eval='(byte-compile-file "chronometrist-key-values.el")' \
--eval='(byte-compile-file "chronometrist-spark.el")' \
--eval='(byte-compile-file "chronometrist-third.el")' ; \
cd ..
lint-check-declare: tangle
cd elisp/ && \
emacs -q --batch \
--eval='(check-declare-file "chronometrist.el")' \
--eval='(check-declare-file "chronometrist-key-values.el")' \
--eval='(check-declare-file "chronometrist-spark.el")' \
--eval='(check-declare-file "chronometrist-third.el")' ; \
cd ..
lint-checkdoc: tangle
cd elisp/ && \
emacs -q -Q --batch \
--eval='(checkdoc-file "chronometrist.el")' \
--eval='(checkdoc-file "chronometrist-key-values.el")' \
--eval='(checkdoc-file "chronometrist-spark.el")' \
--eval='(checkdoc-file "chronometrist-third.el")' ; \
cd ..
lint-package-lint: setup tangle
cd elisp/ && \
emacs --batch \
--eval="(progn (package-initialize) (require 'dash) (require 'ts) (require 'package-lint))" \
-f 'package-lint-batch-and-exit' chronometrist.el \
-f 'package-lint-batch-and-exit' chronometrist-key-values.el \
-f 'package-lint-batch-and-exit' chronometrist-spark.el \
-f 'package-lint-batch-and-exit' chronometrist-third.el ; \
cd ..
lint-relint: setup tangle
cd elisp/ && \
emacs --batch \
--eval="(progn (package-initialize) (require 'relint))" \
--eval='(relint-file "chronometrist.el")' \
--eval='(relint-file "chronometrist-key-values.el")' \
--eval='(relint-file "chronometrist-spark.el")' \
--eval='(relint-file "chronometrist-third.el")' ; \
cd ..
lint: lint-check-declare lint-checkdoc lint-package-lint lint-relint
clean-elc:
rm elisp/*.elc

View File

@ -0,0 +1,22 @@
;; [[file:chronometrist-third.org::*fraction][fraction:1]]
(defcustom chronometrist-third-divisor 3
"Number to determine accumulation of break time relative to work time.")
;; fraction:1 ends here
;; [[file:chronometrist-third.org::*break-time][break-time:1]]
(defvar chronometrist-third-break-time 0
"Accumulated break time in seconds.")
;; break-time:1 ends here
;; [[file:chronometrist-third.org::*clock-in][clock-in:1]]
(defun chronometrist-third-clock-in ()
(let ((latest-break-duration ))
))
;; (chronometrist-interval (chronometrist-latest-record (chronometrist-active-backend)))
;; clock-in:1 ends here
;; [[file:chronometrist-third.org::*clock-out][clock-out:1]]
(defun chronometrist-third-clock-out ()
(let ((latest-work-duration ))))
;; clock-out:1 ends here

View File

@ -0,0 +1,36 @@
#+TITLE: chronometrist-third
#+SUBTITLE: Third Time System extension for Chronometrist
#+PROPERTY: header-args :tangle yes :load yes :comments link
* Program source
** fraction
#+BEGIN_SRC emacs-lisp
(defcustom chronometrist-third-divisor 3
"Number to determine accumulation of break time relative to work time.")
#+END_SRC
** break-time
#+BEGIN_SRC emacs-lisp
(defvar chronometrist-third-break-time 0
"Accumulated break time in seconds.")
#+END_SRC
** clock-in
#+BEGIN_SRC emacs-lisp
(defun chronometrist-third-clock-in ()
(let ((latest-break-duration ))
))
;; (chronometrist-interval (chronometrist-latest-record (chronometrist-active-backend)))
#+END_SRC
** clock-out
#+BEGIN_SRC emacs-lisp
(defun chronometrist-third-clock-out ()
(let ((latest-work-duration ))))
#+END_SRC
* Local variables :NOEXPORT:
# Local Variables:
# my-org-src-default-lang: "emacs-lisp"
# End: