Compare commits
5 commits
fb767b3994
...
3a3460b0d7
Author | SHA1 | Date | |
---|---|---|---|
3a3460b0d7 | |||
94a7eeef18 | |||
b468287aa7 | |||
aec7aa6267 | |||
af7ff9343a |
3 changed files with 46 additions and 18 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||
;; Keywords: local
|
||||
;; Version: 2023.0112.144039
|
||||
;; Version: 2023.0227.150230
|
||||
;; 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-related-files
|
||||
:items oni-core-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-related-places-source)))
|
||||
(add-to-list 'consult-buffer-sources 'oni-core-related-places-source)))
|
||||
|
||||
;;; Embark
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||
;; Keywords: local
|
||||
;; Version: 2022.1122.231427
|
||||
;; Version: 2023.0325.115622
|
||||
;; Package-Requires: (oni-org org-roam)
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
|
@ -66,6 +66,27 @@
|
|||
(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
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||
;; Keywords: local
|
||||
;; Version: 2023.0314.013950
|
||||
;; Version: 2023.0325.213834
|
||||
;; 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,6 +777,11 @@ 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.
|
||||
|
@ -791,6 +796,8 @@ 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)
|
||||
|
@ -971,19 +978,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)
|
||||
(if (> (length title) 60)
|
||||
(format "%s..." (substring title 0 57))
|
||||
title)
|
||||
title
|
||||
emphasis
|
||||
(make-string (alist-get 'poms itm) ?X))))
|
||||
info))))
|
||||
(org-table-align)))
|
||||
(org-table-align)
|
||||
(org-table-shrink)))
|
||||
|
||||
(defun oni-org-insert-pomodoro-overview ()
|
||||
"Create a dynamic block showing the Pomodoro overview for today."
|
||||
|
@ -1021,7 +1028,7 @@ placed above TARGET. Otherwise it will be placed below it."
|
|||
(save-excursion
|
||||
(goto-char entry-beginning)
|
||||
(save-match-data
|
||||
(re-search-forward org-logbook-drawer-re entry-end)
|
||||
(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)
|
||||
|
@ -1029,7 +1036,7 @@ placed above TARGET. Otherwise it will be placed below it."
|
|||
(rx "Finished a pomodoro on "
|
||||
(group "[" (one-or-more (not "]")) "]"))
|
||||
logbook-end t)
|
||||
(push (org-parse-time-string (match-string 1)) results)))))
|
||||
(push (org-parse-time-string (match-string 1)) results))))))
|
||||
results))
|
||||
|
||||
(defun oni-org-pomodoro-times-for-date (date)
|
||||
|
|
Loading…
Reference in a new issue