Compare commits
2 Commits
620c1f6d8d
...
33b7d5d8d3
| Author | SHA1 | Date | |
|---|---|---|---|
| 33b7d5d8d3 | |||
| 1ef71f02b8 |
12
init.el
12
init.el
@ -3172,6 +3172,18 @@ eventuelly be set to nil, however)."
|
|||||||
((nil) (warn "Server not running, check logs and restart manually."))
|
((nil) (warn "Server not running, check logs and restart manually."))
|
||||||
(t (warn "`server-running-p' returned neither nil nor t. Check and restart server manually if required."))))))
|
(t (warn "`server-running-p' returned neither nil nor t. Check and restart server manually if required."))))))
|
||||||
|
|
||||||
|
;; Warn of Windows pecularitites
|
||||||
|
|
||||||
|
(when on-windows
|
||||||
|
;; Warn if `grep-find-template' or `grep-find-command' are undefined in `grep.el', because then
|
||||||
|
;; they would be set by `grep-compute-defaults', which in turn uses `find-program', which is set
|
||||||
|
;; to "find", which on Windows might be CMD's FIND, which does something else (it's more akin to
|
||||||
|
;; grep).
|
||||||
|
(when (and (require 'grep nil t)
|
||||||
|
(or (null grep-find-template)
|
||||||
|
(null grep-find-command)))
|
||||||
|
(warn (concat "`grep-find-template' or `grep-find-command' are undefined, please customize these to use the right version of `find'"))))
|
||||||
|
|
||||||
;; Load custom code
|
;; Load custom code
|
||||||
|
|
||||||
(dolist (file db/after-init-load-files)
|
(dolist (file db/after-init-load-files)
|
||||||
|
|||||||
@ -708,7 +708,17 @@ PARAMS is a property list of the following parameters:
|
|||||||
`:org-ql-match'
|
`:org-ql-match'
|
||||||
|
|
||||||
`org-ql' expression (in sexp syntax) to filter the list of
|
`org-ql' expression (in sexp syntax) to filter the list of
|
||||||
tasks to consider. Defaults to (todo)."
|
tasks to consider. Defaults to (todo).
|
||||||
|
|
||||||
|
`:skip-matches'
|
||||||
|
|
||||||
|
Regular expression to skip certain interval end dates that are
|
||||||
|
not of interest. The regular expression will be matched
|
||||||
|
against the formatted timestamp. For example, to skip
|
||||||
|
weekends, use \"Sat\\|Sun\" as regular expression.
|
||||||
|
|
||||||
|
This can also be a function taking a formatted timestamp as
|
||||||
|
argument and returning non-nil when the date should be skipped."
|
||||||
(let* ((start-date (org-read-date t t
|
(let* ((start-date (org-read-date t t
|
||||||
(or (plist-get params :start-date)
|
(or (plist-get params :start-date)
|
||||||
"00:00")))
|
"00:00")))
|
||||||
@ -720,6 +730,12 @@ PARAMS is a property list of the following parameters:
|
|||||||
(org-ql-match (or (plist-get params :org-ql-match)
|
(org-ql-match (or (plist-get params :org-ql-match)
|
||||||
'(todo)))
|
'(todo)))
|
||||||
(timestamp-format "%Y-%m-%d %a %H:%M")
|
(timestamp-format "%Y-%m-%d %a %H:%M")
|
||||||
|
(skipper (pcase (plist-get params :skip-matches)
|
||||||
|
((pred null) #'(lambda (_) nil))
|
||||||
|
((and (pred stringp) arg)
|
||||||
|
#'(lambda (x) (string-match arg x)))
|
||||||
|
((and (pred functionp) fun) fun)
|
||||||
|
(_ (user-error "Invalid argument to :skip-matches: %s" arg))))
|
||||||
date-range)
|
date-range)
|
||||||
|
|
||||||
;; Check input
|
;; Check input
|
||||||
@ -758,9 +774,9 @@ PARAMS is a property list of the following parameters:
|
|||||||
nil
|
nil
|
||||||
(format-time-string timestamp-format interval-end-date)
|
(format-time-string timestamp-format interval-end-date)
|
||||||
org-ql-match))))
|
org-ql-match))))
|
||||||
(insert (format "| [%s] | %s |\n"
|
(let ((interval-end-date (format-time-string timestamp-format interval-end-date)))
|
||||||
(format-time-string timestamp-format interval-end-date)
|
(unless (funcall skipper interval-end-date)
|
||||||
total-time))))
|
(insert (format "| [%s] | %s |\n" interval-end-date total-time))))))
|
||||||
(insert "|--|")
|
(insert "|--|")
|
||||||
(org-table-align)))
|
(org-table-align)))
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user