Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dotfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tim van Deurzen
dotfiles
Commits
d58a3608
Commit
d58a3608
authored
3 years ago
by
Tim van Deurzen
Browse files
Options
Downloads
Patches
Plain Diff
Got project finding and capturing working as intended.
parent
dac8005c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doom-emacs/config.el
+18
-25
18 additions, 25 deletions
doom-emacs/config.el
with
18 additions
and
25 deletions
doom-emacs/config.el
+
18
−
25
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."
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment