Skip to content

Commit 0a9244e

Browse files
lujun9972claude
andcommitted
Fix PARA config: recursive agenda scan + custom TODO keywords
- org-agenda-files 改用 directory-files-recursively 递归扫描子目录 - 添加 org-todo-keywords 支持 INPROGRESS 等自定义状态 - agenda 自定义命令同步使用递归扫描 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0ff16b3 commit 0a9244e

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

life-hacking/para-test-config.org

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ tree "$PARA_DIR" 2>/dev/null || find "$PARA_DIR" -type f | sort
153153
(defvar org-para-base-dir "~/org"
154154
"PARA 方法的根目录。")
155155

156+
;; ============================================================
157+
;; TODO 关键字:支持 INPROGRESS 等自定义状态
158+
;; ============================================================
159+
160+
(setq org-todo-keywords
161+
'((sequence "TODO(t)" "INPROGRESS(i)" "|" "DONE(d)" "CANCELLED(c)")))
162+
156163
;; ============================================================
157164
;; org-capture 模板:快速捕获到 PARA 各层
158165
;; ============================================================
@@ -208,23 +215,30 @@ tree "$PARA_DIR" 2>/dev/null || find "$PARA_DIR" -type f | sort
208215
;; ============================================================
209216

210217
(setq org-agenda-files
211-
(list (expand-file-name "projects" org-para-base-dir)
212-
(expand-file-name "areas" org-para-base-dir)))
218+
(append
219+
(directory-files-recursively (expand-file-name "projects" org-para-base-dir) "\\.org$")
220+
(directory-files-recursively (expand-file-name "areas" org-para-base-dir) "\\.org$")))
213221

214222
;; 自定义 agenda 视图:按 PARA 层级分组
215223
(setq org-agenda-custom-commands
216224
'(("P" "PARA 视图"
217225
((agenda "" ((org-agenda-span 'week)))
218226
(todo "TODO|INPROGRESS"
219227
((org-agenda-overriding-header "活跃项目任务")
220-
(org-agenda-files (list (expand-file-name "projects" org-para-base-dir)))))
228+
(org-agenda-files
229+
(directory-files-recursively
230+
(expand-file-name "projects" org-para-base-dir) "\\.org$"))))
221231
(todo "TODO"
222232
((org-agenda-overriding-header "领域维护任务")
223-
(org-agenda-files (list (expand-file-name "areas" org-para-base-dir)))))))
233+
(org-agenda-files
234+
(directory-files-recursively
235+
(expand-file-name "areas" org-para-base-dir) "\\.org$"))))))
224236
("p" "仅项目任务"
225237
todo "TODO|INPROGRESS"
226238
((org-agenda-overriding-header "项目任务")
227-
(org-agenda-files (list (expand-file-name "projects" org-para-base-dir)))))))
239+
(org-agenda-files
240+
(directory-files-recursively
241+
(expand-file-name "projects" org-para-base-dir) "\\.org$"))))))
228242

229243
;; ============================================================
230244
;; org-roam 集成(可选,需要安装 org-roam)

0 commit comments

Comments
 (0)