Create on-file-change generic

This commit is contained in:
contrapunctus 2021-09-04 20:25:18 +05:30
parent 083a2f4d8e
commit 3e7c41c9f7
2 changed files with 8 additions and 0 deletions

View File

@ -420,6 +420,9 @@ Hash table keys are ISO-8601 date strings. Hash table values are lists of record
(cl-defgeneric chronometrist-list-records (backend)
"Return all records in BACKEND as a list of plists, in reverse chronological order.")
(cl-defgeneric chronometrist-on-file-change (backend)
"Function to be run when file for BACKEND changes.")
(defclass chronometrist-plist-backend (chronometrist-backend) ())
(add-to-list 'chronometrist-backends-alist

View File

@ -1035,6 +1035,11 @@ Hash table keys are ISO-8601 date strings. Hash table values are lists of record
(cl-defgeneric chronometrist-list-records (backend)
"Return all records in BACKEND as a list of plists, in reverse chronological order.")
#+END_SRC
**** on-file-change :generic:function:
#+BEGIN_SRC emacs-lisp
(cl-defgeneric chronometrist-on-file-change (backend)
"Function to be run when file for BACKEND changes.")
#+END_SRC
*** plist backend
In this format, user data is stored as Elisp plists in a plain text file. A basic plist in this file looks like this -