Fix checkdoc errors

This commit is contained in:
contrapunctus 2019-10-31 20:43:50 +05:30
parent f91dc2ef76
commit 4e89836aaa
9 changed files with 66 additions and 21 deletions

View File

@ -64,8 +64,9 @@ This is distinct from `chronometrist-time-re-ui' (which see).")
(if result t nil)))
(defun chronometrist-get-end-time (target-date)
"Return the date and time of the next clock-out event after
point in the file `timeclock-file'.
"Return the timestamp of the next clock-out event after point.
This is meant to be run in `timeclock-file'.
If there is no clock-out event after point, return the current
date and time.
@ -129,6 +130,10 @@ SECONDS] or (HOURS MINUTES SECONDS)."
(concat h m s)))))
(defun chronometrist-open-file (&optional button)
"Open `chronometrist-file' in another window.
Argument BUTTON is for the purpose of using this command as a
button action."
(interactive)
(find-file-other-window chronometrist-file)
(goto-char (point-max)))
@ -145,6 +150,7 @@ SECONDS] or (HOURS MINUTES SECONDS)."
(if (zerop size) t nil)))
(defun chronometrist-common-clear-buffer (buffer)
"Clear the contents of BUFFER."
(with-current-buffer buffer
(goto-char (point-min))
(delete-region (point-min) (point-max))))

View File

@ -1,4 +1,4 @@
;; -*- lexical-binding: t; -*-
;;; chronometrist-diary-view.el --- A diary-like view for Chronometrist -*- lexical-binding: t; -*-
;; TODO - add forward/backward, current date display (and don't scroll
;; past the actual data)
@ -14,6 +14,12 @@
;; Add variable to store format functions as list (first one is
;; default), command to cycle between them
;;; Commentary:
;;
;;; Code:
(defvar chronometrist-diary-buffer-name "*Chronometrist-Diary*"
"Name for the buffer created by `chronometrist-diary'.")
@ -79,3 +85,7 @@ format returned by `encode-time'."
;; Local Variables:
;; nameless-current-name: "chronometrist-diary"
;; End:
(provide 'chronometrist-diary-view)
;;; chronometrist-diary-view.el ends here

View File

@ -184,7 +184,7 @@ START-DATE and END-DATE must be dates in the form '(YEAR MONTH DAY)."
subset))
(defun chronometrist-events-query-spec-match-p (plist specifiers)
"Return non-nil if PLIST matches SPECIFIERS."
"Return non-nil if SPECIFIERS match PLIST."
(let* ((spec-only-keywords-p (when specifiers
(seq-every-p #'keywordp specifiers)))
(keyword-list (unless spec-only-keywords-p

View File

@ -1,4 +1,4 @@
;;; chronometrist-migrate.el --- Commands to aid in migrating from timeclock to chronometrist s-expr format
;;; chronometrist-migrate.el --- Commands to aid in migrating from timeclock to chronometrist s-expr format -*- lexical-binding: t; -*-
;;; Commentary:
;; TODO - convert project names to tags
@ -10,7 +10,7 @@
;; TODO - support other timeclock codes (currently only "i" and "o"
;; are supported.)
(defun chronometrist-migrate-populate (in-file)
"Read data from IN-FILE to `chronometrist-migrate-table', storing events as plists.
"Read data from IN-FILE to `chronometrist-migrate-table'.
IN-FILE should be a file in the format supported by timeclock.el.
See `timeclock-log-data' for a description."
@ -59,7 +59,10 @@ See `timeclock-log-data' for a description."
nil)))
(defun chronometrist-migrate-timelog-file->sexp-file (&optional in-file out-file)
"Migrate your existing `timeclock-file' to the Chronometrist file format."
"Migrate your existing `timeclock-file' to the Chronometrist file format.
IN-FILE and OUT-FILE, if provided, are used as input and output
file names respectively."
(interactive `(,(if (featurep 'timeclock)
(read-file-name (concat "timeclock file (default: "
timeclock-file "): ")

View File

@ -1,4 +1,4 @@
;;; chronometrist-plist-pp.el --- Functions to pretty print property lists
;;; chronometrist-plist-pp.el --- Functions to pretty print property lists -*- lexical-binding: t; -*-
;;; Commentary:
@ -12,6 +12,9 @@
(defvar chronometrist-plist-pp-whitespace-re "[\t\s]+?")
(defun chronometrist-plist-pp-longest-keyword-length ()
"Find the length of the longest keyword.
This assumes there is a single plist in the current buffer."
(save-excursion
(let ((keyword-lengths-list)
(sexp))
@ -26,7 +29,8 @@
(sort #'>)
(car)))))
(defun chronometrist-plist-pp-buffer-keyword-helper ()
(defun chronometrist-plist-pp-buffer-keyword-helper (indent)
"Indent the keyword after point by INDENT spaces."
(looking-at chronometrist-plist-pp-keyword-re)
(let ((keyword (buffer-substring-no-properties (match-beginning 0)
(match-end 0))))
@ -44,7 +48,7 @@
;; opening paren + first keyword
((looking-at-p (concat "(" chronometrist-plist-pp-keyword-re chronometrist-plist-pp-whitespace-re))
(ignore-errors (down-list 1))
(insert (chronometrist-plist-pp-buffer-keyword-helper))
(insert (chronometrist-plist-pp-buffer-keyword-helper indent))
(forward-sexp 1)
(insert "\n"))
((looking-at chronometrist-plist-pp-whitespace-re)
@ -52,7 +56,7 @@
(match-end 0)))
;; any other keyword
((looking-at chronometrist-plist-pp-keyword-re)
(insert " " (chronometrist-plist-pp-buffer-keyword-helper))
(insert " " (chronometrist-plist-pp-buffer-keyword-helper indent))
(forward-sexp 1)
(when (not (looking-at-p ")"))
(insert "\n")))
@ -62,6 +66,7 @@
(t (forward-char 1))))))
(defun chronometrist-plist-pp-to-string (object)
"Convert OBJECT to a pretty-printed string."
(with-temp-buffer
(lisp-mode-variables nil)
(set-syntax-table emacs-lisp-mode-syntax-table)
@ -72,6 +77,7 @@
(buffer-string)))
(defun chronometrist-plist-pp (object &optional stream)
"Pretty-print OBJECT and output to STREAM (see `princ')."
(princ (chronometrist-plist-pp-to-string object)
(or stream standard-output)))

View File

@ -1,10 +1,12 @@
;;; chronometrist-queries.el --- Functions which query Chronometrist data
;;; chronometrist-queries.el --- Functions which query Chronometrist data -*- lexical-binding: t; -*-
;;; Commentary:
;;
;;; Code:
(defun chronometrist-task-time-one-day (task &optional date-string)
"Return total time spent on PROJECT today or (if supplied) on DATE.
"Return total time spent on TASK today or (if supplied) on DATE.
The data is obtained from `chronometrist-file', via `chronometrist-events'.

View File

@ -1,4 +1,8 @@
;; -*- lexical-binding: t; -*-
;;; chronometrist-report.el --- Report view for Chronometrist -*- lexical-binding: t; -*-
;;; Commentary:
;;
(require 'chronometrist-common)
(require 'chronometrist-timer)
@ -15,6 +19,8 @@
;; ## VARIABLES ##
;;; Code:
(defvar chronometrist-report--ui-date nil
"The first date of the week displayed by `chronometrist-report'.
A value of nil means the current week. Otherwise, it must be a
@ -29,7 +35,9 @@ Each date is a list containing calendrical information (see (info \"(elisp)Time
;; ## FUNCTIONS ##
(defun chronometrist-report-previous-week-start (date-string)
"Return the time value of the previous `chronometrist-report-week-start-day' from DATE-STRING.
"Find the previous `chronometrist-report-week-start-day' from DATE-STRING.
Return the time value of said day's beginning.
If the day of DATE is the same as the
`chronometrist-report-week-start-day', return DATE.
@ -47,8 +55,8 @@ DATE-STRING must be in the form \"YYYY-MM-DD\"."
date-unix)))
(defun chronometrist-report-date ()
"Return the date specified by `chronometrist-report--ui-date'. If
it is nil, return the current date as calendrical
"Return the date specified by `chronometrist-report--ui-date'.
If it is nil, return the current date as calendrical
information (see (info \"(elisp)Time Conversion\"))."
(if chronometrist-report--ui-date chronometrist-report--ui-date (chronometrist-date)))
@ -243,7 +251,7 @@ Argument FS-EVENT is ignored."
(defun chronometrist-report (&optional keep-date)
"Display a weekly report of the data in `chronometrist-file'.
This is the 'listing command' for chronometrist-report-mode.
This is the 'listing command' for chronometrist-report-mode.
If a buffer called `chronometrist-report-buffer-name' already
exists and is visible, kill the buffer.
@ -308,3 +316,7 @@ current week. Otherwise, display data from the week specified by
;; Local Variables:
;; nameless-current-name: "chronometrist-report"
;; End:
(provide 'chronometrist-report)
;;; chronometrist-report.el ends here

View File

@ -1,4 +1,4 @@
;;; chronometrist-sexp.el --- S-expression backend for Chronometrist
;;; chronometrist-sexp.el --- S-expression backend for Chronometrist -*- lexical-binding: t; -*-
(require 'chronometrist-migrate)
(require 'chronometrist-events)

View File

@ -318,7 +318,10 @@ is the name of the project to be clocked out of.")
;; FIXME - there is duplication between this function and `chronometrist-toggle-project's logic
(defun chronometrist-toggle-project-button (button)
"Button action to toggle a project."
"Button action to toggle a project.
Argument BUTTON is for the purpose of using this as a button
action, and is ignored."
(let ((current (chronometrist-current-task))
(at-point (chronometrist-project-at-point)))
;; clocked in + point on current = clock out
@ -331,7 +334,10 @@ is the name of the project to be clocked out of.")
(chronometrist-refresh)))
(defun chronometrist-add-new-project-button (button)
"Button action to add a new project."
"Button action to add a new project.
Argument BUTTON is for the purpose of using this as a button
action, and is ignored."
(let ((current (chronometrist-current-task)))
(when current
(chronometrist-run-functions-and-clock-out current))