1
0
Fork 0

Compare commits

..

No commits in common. "3a3460b0d7283a45c54330f589c52e4c441423e4" and "fb767b39948483fceb8fe83698933f13f79f1a93" have entirely different histories.

3 changed files with 18 additions and 46 deletions

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 2023.0227.150230
;; Version: 2023.0112.144039
;; Package-Requires: (oni-data-dir oni-embrace oni-hydra expand-region multiple-cursors gcmh diminish ws-butler which-key insert-char-preview mixed-pitch ace-window vertico marginalia orderless consult embark docstr)
;; This program is free software; you can redistribute it and/or modify
@ -423,13 +423,13 @@ _s_: String list"
(defvar oni-core-related-places-source
'(:name "Related File"
:category file
:items oni-core-related-files
:items oni-related-files
:enabled buffer-file-name
:action find-file))
(with-eval-after-load 'consult
(with-eval-after-load 'related-files
(add-to-list 'consult-buffer-sources 'oni-core-related-places-source)))
(add-to-list 'consult-buffer-sources 'oni-related-places-source)))
;;; Embark

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 2023.0325.115622
;; Version: 2022.1122.231427
;; Package-Requires: (oni-org org-roam)
;; This program is free software; you can redistribute it and/or modify
@ -66,27 +66,6 @@
(and (not (null state))
(not (string= state "FINISHED")))))
(defun oni-org-roam--books-to-read ()
(seq-filter (lambda (item)
(string= (map-elt (car item) "STATUS") "toread"))
(org-roam-db-query [:select [nodes:properties nodes:file nodes:title]
:from nodes
:left-join tags
:on (= tags:node-id nodes:id)
:where (like tag (quote "%\"book\"%"))])))
(defun oni-org-roam-list-books-to-read ()
(interactive)
(let ((buffer (get-buffer-create "*books-to-read*")))
(with-current-buffer buffer
(erase-buffer)
(mapc (lambda (item) (insert (caddr item) "\n")) (oni-org-roam--books-to-read)))
(switch-to-buffer buffer)))
(defun oni-org-roam-random-book-to-read ()
(interactive)
(find-file (cadr (seq-random-elt (oni-org-roam--books-to-read)))))
(add-to-list 'display-buffer-alist
`(,(rx string-start "*org-roam*" string-end)
display-buffer-in-side-window

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 2023.0325.213834
;; Version: 2023.0314.013950
;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org org-contrib org-bullets org-edna diminish all-the-icons olivetti form-feed)
;; This program is free software; you can redistribute it and/or modify
@ -777,11 +777,6 @@ After running it once remove it from `org-capture-after-finalize-hook'."
;;; Refile
(defun oni-org-refile-to-top ()
(interactive)
(let ((org-reverse-note-order t))
(org-refile)))
;; Set it up so that I can refile easily and still create new nodes when I
;; refile. Include the file in the outline path so that I can refile into them
;; and create top-level headings.
@ -796,8 +791,6 @@ After running it once remove it from `org-capture-after-finalize-hook'."
(oni-org-todo-main-file . (:maxlevel . 10))
(oni-org-todo-someday-file . (:maxlevel . 1))))
(define-key org-mode-map (kbd "C-c C-S-w") #'oni-org-refile-to-top 'remove)
;;; Export
(require 'ox-html)
(require 'nxml-mode)
@ -978,19 +971,19 @@ placed above TARGET. Otherwise it will be placed below it."
(string-trim-right
(apply #'concat "| | Task | Effort |\n"
"|-+------+--------|\n"
"| | <60> | |\n"
(mapcar (lambda (itm)
(let ((emphasis (if (alist-get 'done itm) "+" ""))
(title (alist-get 'title itm)))
(format "| | %s[[id:%s][%s]]%s | %s |\n"
emphasis
(alist-get 'id itm)
title
(if (> (length title) 60)
(format "%s..." (substring title 0 57))
title)
emphasis
(make-string (alist-get 'poms itm) ?X))))
info))))
(org-table-align)
(org-table-shrink)))
(org-table-align)))
(defun oni-org-insert-pomodoro-overview ()
"Create a dynamic block showing the Pomodoro overview for today."
@ -1028,15 +1021,15 @@ placed above TARGET. Otherwise it will be placed below it."
(save-excursion
(goto-char entry-beginning)
(save-match-data
(when (re-search-forward org-logbook-drawer-re entry-end nil)
(let ((logbook-beginning (match-beginning 0))
(logbook-end (match-end 0)))
(goto-char logbook-beginning)
(while (re-search-forward
(rx "Finished a pomodoro on "
(group "[" (one-or-more (not "]")) "]"))
logbook-end t)
(push (org-parse-time-string (match-string 1)) results))))))
(re-search-forward org-logbook-drawer-re entry-end)
(let ((logbook-beginning (match-beginning 0))
(logbook-end (match-end 0)))
(goto-char logbook-beginning)
(while (re-search-forward
(rx "Finished a pomodoro on "
(group "[" (one-or-more (not "]")) "]"))
logbook-end t)
(push (org-parse-time-string (match-string 1)) results)))))
results))
(defun oni-org-pomodoro-times-for-date (date)