Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dotfiles
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tim van Deurzen
dotfiles
Commits
d58a3608
Commit
d58a3608
authored
Dec 09, 2021
by
Tim van Deurzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got project finding and capturing working as intended.
parent
dac8005c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
25 deletions
+18
-25
doom-emacs/config.el
doom-emacs/config.el
+18
-25
No files found.
doom-emacs/config.el
View file @
d58a3608
...
...
@@ -112,37 +112,31 @@
(
setq
org-roam-directory
"~/org/roam/"
org-roam-v2-ack
t
)
;; (setq org-roam-dailies-capture-templates)
(
setq
deft-directory
"~/org/roam"
)
(
setq
deft-extensions
'
(
"org"
))
(
org-roam-db-autosync-mode
))
(
defun
tim/capture-project
()
"Select or capture project within a particular workspace."
(
require
'vulpea-select
)
(
defun
tim/find-project
()
"Select or capture project within a particular."
(
interactive
)
(
let*
((
workspace
(
completing-read
"workspace: "
(
tim/org-roam-workspaces
)))
(
workspace-path
(
expand-file-name
workspace
org-roam-directory
))
(
template-path
(
format
"%s/templates/"
workspace-path
))
(
node-path-format
(
concat
workspace-path
"/%<%Y%m%d%H%M%S>-${slug}.org"
)))
(
org-roam-capture-
:node
(
org-roam-node-read
nil
(
tim/org-roam-filter-by-tag
workspace
))
:templates
`
(
(
"p"
"project"
plain
(
file
,
(
concat
template-path
"project.org"
))
:if-new
(
file+head
,
node-path-format
"#+title: ${title}"
)
:unnarrowed
t
)
(
"m"
"monthly report"
plain
(
file
,
(
concat
template-path
"monthly-report.org"
))
:if-new
(
file+head
,
(
concat
workspace-path
"/%<%Y-%m>-report.org"
)
"#+title: %<%B %Y> report"
)
:unnarrowed
t
)
(
let*
((
workspace
(
completing-read
"workspace: "
(
tim/org-roam-workspaces
)))
(
org-roam-directory
(
expand-file-name
workspace
org-roam-directory
))
(
node
(
vulpea-select-from
"project: "
(
vulpea-db-query-by-tags-every
(
list
workspace
"project"
)))))
))))
(
if
(
vulpea-note-id
node
)
(
org-roam-node-visit
(
org-roam-node-from-id
(
vulpea-note-id
node
)))
(
org-roam-capture-
:node
(
org-roam-node-create
:title
(
vulpea-note-title
node
))
:props
'
(
:finalize
find-file
)
:templates
`
((
"p"
"project"
plain
(
file
,
(
concat
org-roam-directory
"/templates/project.org"
))
:target
(
file+head
"%<%Y%m%d%H%M%S>-${slug}.org"
"#+title: ${title}"
)
:unnarrowed
t
))))))
;; TODO Create something similar to vulpea-find by first querying for the node and running org-roam-capture- if nothing is found.
(
defun
tim/capture-report
()
...
...
@@ -164,9 +158,8 @@
;; TODO Use vulpea-select-from to find the right node, extended with the workspace, and open it if the filter matches.
(
require
'vulpea-select
)
(
vulpea-select-from
"report"
(
vulpea-db-query-by-tags-every
(
list
"report"
)))
(
vulpea-db-qu
)
;; (vulpea-select-from "report" (vulpea-db-query-by-tags-every (list "report")))
;; (vulpea-db-qu)
(
defun
tim/org-roam-filter-by-tag
(
tag
)
"Return a lambda to select nodes with a particular tag TAG."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment