summaryrefslogtreecommitdiff
path: root/emacs-config.org
diff options
context:
space:
mode:
authorBlake Romero <blake@blkrom.com>2025-07-11 14:58:52 +0100
committerBlake Romero <blake@blkrom.com>2025-07-11 14:58:52 +0100
commit7f77be429b0c76bd989e30f22092807b87dec17f (patch)
tree81be042e7b323b1f7d6968ef78682a3cfa9688c6 /emacs-config.org
parent15a8204a9d65ef11b28cdbbdf5999971a5ea6e43 (diff)
Add clock table settings
Diffstat (limited to 'emacs-config.org')
-rw-r--r--emacs-config.org47
1 files changed, 46 insertions, 1 deletions
diff --git a/emacs-config.org b/emacs-config.org
index 410feaa..6bf800f 100644
--- a/emacs-config.org
+++ b/emacs-config.org
@@ -366,7 +366,7 @@ Case-sensitive search by default and show match count in minibuffer.
<<org-speed-command-settings>>)
#+end_src
-#+begin_src elisp
+#+begin_src elisp :noweb yes
(with-eval-after-load 'org-agenda
<<org-agenda-settings>>)
#+end_src
@@ -718,6 +718,51 @@ Set time grid.
"⏰" "——————————————————————————————"))
#+end_src
+** Org Clock-table
+Define a custom clocktable formatter function for ~+org-clocktable-format~.
+#+begin_src elisp
+ (with-eval-after-load 'org-clock
+ (defun +org-clocktable-format (&rest args)
+ "A cleaner Org clocktable format."
+ (apply #'org-clocktable-write-default args)
+ (save-excursion
+ ;; Rename headline
+ (search-forward "Headline")
+ (backward-kill-sexp)
+ (insert "Tasks")
+ (org-table-align)
+
+ ;; Capitalise row
+ (beginning-of-line)
+ (setq this-command-keys-shift-translated t)
+ (call-interactively 'end-of-line)
+ (call-interactively 'capitalize-dwim)
+ (deactivate-mark)
+
+ ;; Remove cookies
+ (org-mark-element)
+ (while (re-search-forward
+ "\\[[0-9]+\\(?:/[0-9]\\|%\\)\\] " nil t)
+ (replace-match ""))
+ (org-table-align)
+ (exchange-point-and-mark t)
+
+ ;; Move total time row to the end of the table
+ (kill-whole-line)
+ (condition-case nil
+ (while t
+ (org-table-move-row-down))
+ (error nil))
+ (org-table-insert-hline t))))
+#+end_src
+
+Set default clocktable parameters.
+#+begin_src elisp :tangle no :noweb-ref org-agenda-settings
+ (setq-default
+ org-agenda-clockreport-parameter-plist
+ '(:link t :fileskip0 t :hidefiles t :formatter +org-clocktable-format))
+#+end_src
+
** Error Checking
Enable flymake for programming modes.
#+begin_src elisp