(fix): dailies: fix capture changing window configuration (#1314)

`*-captures` commands now maintain window configuration, while the
`*-find` commands change to the file.
This commit is contained in:
Jethro Kuan
2020-11-21 01:27:03 +08:00
committed by GitHub
parent bf41352c1c
commit 3a4ff76508

View File

@ -152,7 +152,6 @@ 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))
(setq org-roam-capture-additional-template-props (list :finalize 'find-file))
(org-roam-capture--capture (when goto '(4))))) (org-roam-capture--capture (when goto '(4)))))
;;;; Commands ;;;; Commands
@ -164,8 +163,7 @@ When GOTO is non-nil, go the note without creating an entry."
(interactive "P") (interactive "P")
(org-roam-dailies--capture (current-time) goto) (org-roam-dailies--capture (current-time) goto)
(when goto (when goto
(run-hooks 'org-roam-dailies-find-file-hook) (run-hooks 'org-roam-dailies-find-file-hook)))
(message "Showing daily-note for today")))
(defun org-roam-dailies-find-today () (defun org-roam-dailies-find-today ()
"Find the daily-note for today, creating it if necessary." "Find the daily-note for today, creating it if necessary."
@ -267,8 +265,7 @@ creating an entry."
(time (org-read-date nil t time-str))) (time (org-read-date nil t time-str)))
(org-roam-dailies--capture time goto) (org-roam-dailies--capture time goto)
(when goto (when goto
(run-hooks 'org-roam-dailies-find-file-hook) (run-hooks 'org-roam-dailies-find-file-hook))))
(message "Showing note for %s" time-str))))
(defun org-roam-dailies-find-date (&optional prefer-future) (defun org-roam-dailies-find-date (&optional prefer-future)
"Find the daily-note for a date using the calendar, creating it if necessary. "Find the daily-note for a date using the calendar, creating it if necessary.