diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-27 15:08:52 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-27 15:08:52 -0500 |
| commit | f4d6346e16bd71b17c5f0f3a1e2f780fdf619558 (patch) | |
| tree | 3497757b89cbf5195c711aeb1ac8b2bad866c579 /modules | |
| parent | 188faac19515f5a72433140ec0d628f1decf443a (diff) | |
| download | dotemacs-f4d6346e16bd71b17c5f0f3a1e2f780fdf619558.tar.gz dotemacs-f4d6346e16bd71b17c5f0f3a1e2f780fdf619558.zip | |
refactor(prog): open daily-prep respecting the window split
C-c p d (cj/open-project-daily-prep) always forced the prep doc into another window. I switched it to cj/--find-file-respecting-split, the same helper the sibling C-c p t (project todo) uses: it opens the other window when the frame is split and reuses the current window when it isn't. The two project-open commands now behave the same way.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/prog-general.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/prog-general.el b/modules/prog-general.el index e8d48b707..e09c3f40b 100644 --- a/modules/prog-general.el +++ b/modules/prog-general.el @@ -146,15 +146,16 @@ buffer the user is looking at." (find-file-other-window file))) (defun cj/open-project-daily-prep () - "Open the current Projectile project's daily prep in another window. + "Open the current Projectile project's daily prep, respecting the split. The prep file is inbox/today-prep.org under the project root (a stable symlink to the dated prep doc). Project-scoped: a project without one gets a -message. Opens in another window so it sits beside the current work." +message. Opens in the other window when the frame is split and reuses the +current window otherwise, matching `cj/open-project-root-todo'." (interactive) (if-let ((root (projectile-project-root))) (let ((file (expand-file-name "inbox/today-prep.org" root))) (if (file-exists-p file) - (find-file-other-window file) + (cj/--find-file-respecting-split file) (message "No inbox/today-prep.org in project: %s" root))) (message "Not in a Projectile project"))) |
