diff --git a/config.el b/config.el index b4af14f..0b6c1ba 100644 --- a/config.el +++ b/config.el @@ -1598,6 +1598,15 @@ Skip for beamer exports — beamer uses adjustbox on plain tabular." :demand t :config ;; org-capture integration: "a" to add event on selected date + ;; Store date from calfw before capture starts + (defvar my/calfw-capture-date nil "Date selected in calfw for capture.") + + (defun my/calfw-capture () + "Start org-capture with calfw date context." + (interactive) + (setq my/calfw-capture-date (calfw-cursor-to-nearest-date)) + (org-capture nil "c")) + ;; Prompts for start/end time; empty = all-day event ;; Uses active timestamp with time range for timed events, ;; or date-range (-->--) for multi-day events. @@ -1608,7 +1617,7 @@ Formats matching what org-caldav/ox-icalendar export correctly: - Timed single day: <2026-02-26 Thu 14:00-15:30> - All-day multi: <2026-02-26 Thu>--<2026-02-28 Sat> - Timed multi-day: <2026-02-26 Thu 15:00>--<2026-02-28 Sat 22:00>" - (let* ((date (calfw-cursor-to-nearest-date)) + (let* ((date (or my/calfw-capture-date (calendar-current-date))) (y (calendar-extract-year date)) (m (calendar-extract-month date)) (d (calendar-extract-day date)) @@ -1669,7 +1678,7 @@ Formats matching what org-caldav/ox-icalendar export correctly: "M" #'calfw-change-view-month "D" #'calfw-change-view-day "TAB" #'calfw-navi-next-item-command - "a" #'org-capture + "a" #'my/calfw-capture "q" #'bury-buffer "x" #'calfw-org-clean-exit "RET" #'calfw-org-open-agenda-day