mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
implement correct fix for org-roam-dailies
This commit is contained in:
@ -278,11 +278,13 @@ This function is to be called in the org-capture finalization process."
|
|||||||
|
|
||||||
(defun org-roam-capture--finalize ()
|
(defun org-roam-capture--finalize ()
|
||||||
"Finalize the `org-roam-capture' process."
|
"Finalize the `org-roam-capture' process."
|
||||||
(let ((region (org-roam-capture--get :region)))
|
(let ((region (org-roam-capture--get :region))
|
||||||
|
id)
|
||||||
(when region
|
(when region
|
||||||
(org-roam-unshield-region (car region) (cdr region)))
|
(org-roam-unshield-region (car region) (cdr region)))
|
||||||
(unless org-note-abort
|
(unless org-note-abort
|
||||||
(let ((id (org-roam-capture--finalize-create-id)))
|
(setq id (org-roam-capture--finalize-create-id))
|
||||||
|
(when-let ((finalize (org-roam-capture--get :finalize)))
|
||||||
(funcall (intern (concat "org-roam-capture--finalize-"
|
(funcall (intern (concat "org-roam-capture--finalize-"
|
||||||
(symbol-name (org-roam-capture--get :finalize))))
|
(symbol-name (org-roam-capture--get :finalize))))
|
||||||
:id id)))
|
:id id)))
|
||||||
@ -514,7 +516,7 @@ This function is used solely in Org-roam's capture templates: see
|
|||||||
(append converted options `(:org-roam ,org-roam-plist))))
|
(append converted options `(:org-roam ,org-roam-plist))))
|
||||||
(_ (user-error "Invalid capture template format: %s" template))))
|
(_ (user-error "Invalid capture template format: %s" template))))
|
||||||
|
|
||||||
(cl-defun org-roam-capture--capture (&optional goto &key keys info context)
|
(cl-defun org-roam-capture--capture (&key goto keys info context)
|
||||||
(let* ((org-capture-templates
|
(let* ((org-capture-templates
|
||||||
(mapcar #'org-roam-capture--convert-template org-roam-capture-templates))
|
(mapcar #'org-roam-capture--convert-template org-roam-capture-templates))
|
||||||
(org-roam-capture--info info)
|
(org-roam-capture--info info)
|
||||||
@ -522,7 +524,6 @@ This function is used solely in Org-roam's capture templates: see
|
|||||||
(one-template-p (= (length org-capture-templates) 1)))
|
(one-template-p (= (length org-capture-templates) 1)))
|
||||||
(when one-template-p
|
(when one-template-p
|
||||||
(setq keys (caar org-capture-templates)))
|
(setq keys (caar org-capture-templates)))
|
||||||
(setq org-roam-capture-additional-template-props (list :finalize 'find-file))
|
|
||||||
(org-capture goto keys)))
|
(org-capture goto keys)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
@ -154,7 +154,7 @@ When GOTO is non-nil, go the note without creating an entry."
|
|||||||
(if goto (list (car it)) it)))
|
(if goto (list (car it)) it)))
|
||||||
(org-roam-capture--info (list (cons 'time time)))
|
(org-roam-capture--info (list (cons 'time time)))
|
||||||
(org-roam-capture--context 'dailies))
|
(org-roam-capture--context 'dailies))
|
||||||
(org-roam-capture--capture (when goto '(4))
|
(org-roam-capture--capture :goto (when goto '(4))
|
||||||
:info (list (cons 'time time))
|
:info (list (cons 'time time))
|
||||||
:context 'dailies)))
|
:context 'dailies)))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user