aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-26 17:01:03 -0500
committerCraig Jennings <c@cjennings.net>2026-05-26 17:01:03 -0500
commit8e5efcab4043ef9824456e96f056bb99440b3ec4 (patch)
treeb8798bdd43ee924d427a0519e84ad2161ff8fcbf /modules
parent93dba546208d0e0889ef97d93de7943eb3c8e912 (diff)
downloaddotemacs-8e5efcab4043ef9824456e96f056bb99440b3ec4.tar.gz
dotemacs-8e5efcab4043ef9824456e96f056bb99440b3ec4.zip
feat(projectile): open the project daily prep on C-c p d
I added cj/open-project-daily-prep on C-c p d. It opens inbox/today-prep.org under the Projectile project root in another window, project-scoped, so a project without a prep file just reports it rather than erroring. The binding had only ever been eval'd live into the daemon in a past session and vanished on the next restart, so this persists it to the module. Freeing d meant reworking the deadgrep bindings. deadgrep-in-dir moves to C-c p G (replacing plain deadgrep, which stays M-x-callable), and deadgrep-here keeps C-c p g. Plain project-wide deadgrep dropped off the projectile prefix because it overlapped the context-aware and arbitrary-directory variants. Tests cover the open, missing-file, and not-in-a-project paths.
Diffstat (limited to 'modules')
-rw-r--r--modules/prog-general.el21
1 files changed, 17 insertions, 4 deletions
diff --git a/modules/prog-general.el b/modules/prog-general.el
index 93a3a95c..369a8b08 100644
--- a/modules/prog-general.el
+++ b/modules/prog-general.el
@@ -146,13 +146,27 @@ buffer the user is looking at."
(find-file file)
(find-file-other-window file)))
+(defun cj/open-project-daily-prep ()
+ "Open the current Projectile project's daily prep in another window.
+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."
+ (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)
+ (message "No inbox/today-prep.org in project: %s" root)))
+ (message "Not in a Projectile project")))
+
(use-package projectile
:bind-keymap
("C-c p" . projectile-command-map)
:bind
(:map projectile-command-map
("r" . projectile-replace-regexp)
- ("t" . cj/open-project-root-todo))
+ ("t" . cj/open-project-root-todo)
+ ("d" . cj/open-project-daily-prep))
:custom
(projectile-auto-discover nil)
(projectile-project-search-path `(,code-dir ,projects-dir))
@@ -219,9 +233,8 @@ If no such file exists there, display a message."
:after projectile
:bind
(:map projectile-command-map
- ("G" . deadgrep) ;; project-wide search
- ("g" . cj/deadgrep-here) ;; search in context directory
- ("d" . cj/deadgrep-in-dir)) ;; prompt for directory
+ ("G" . cj/deadgrep-in-dir) ;; prompt for any directory
+ ("g" . cj/deadgrep-here)) ;; search in context directory
:config
(require 'thingatpt)