Custom org layer for category-scoped capture/agenda with a first-class "project" concept, persistent repo/branch → project mappings, auto- switching of the current project based on the selected buffer's git context, and a small interview note-taking mode.
Every file in here defines functions and variables only. All invocation
— requires, keybindings, hooks, refile config, modeline install, state
load, minor-mode enablement — is wired up from ../init.org in the
org-capture / org-agenda section, so the whole shape of the system is
visible in one place.
Shared data and path helpers used by everything else.
my/org-capture-categories— the(KEY NAME SUBDIR)tuples that drive both capture and agenda (work/personal/talos/debate by default).- Project path helpers:
my/org-projects-dir,my/org-project-index-file,my/org-project-root-file,my/org-project-whiteboard-file. my/org-project--read-index— regex walker that parsesprojects/index.orginto plists with:slug :status :created :archived-at :repos. Chosen over real org-mode parsing so the rest of the system can query project metadata without pulling in org at load time.my/org-project-active-slugs— sorted list of active project slugs.my/org-toplevel-file-alist— label → path alist for the category-based top-level org files.my/org-category-files— every file reachable from the capture setup, used as the refile target set.
Project CRUD, current-project state, and the repo/branch → project mapping layer.
- Current project:
my/org-current-project, persisted to~/.emacs.d/my-org-current-project.elviamy/org-current-project-loadandmy/org-current-project-save. - CRUD:
my/org-project-new(seeds bothroot.organdwhiteboard.org),my/org-project-archive(also stamps:ARCHIVED_AT:),my/org-project-list,my/org-project-goto(active only),my/org-project-goto-all(includes archived, with[archived]annotation in the completion list),my/org-project-set-current,my/org-project-clear-current,my/org-goto-toplevel-file. Both goto commands read[r]ootor[w]hiteboardafter picking a slug, sojXw-style capture and direct navigation share one entry point. - Clocking:
my/org-project-clock-in(clocks in on the* <slug>heading inprojects/index.org, defaulting to the current project and prompting if unset),my/org-project-clock-out,my/org-project-clock-goto,my/org-project-clock-in-last. All clock entries accumulate in a single LOGBOOK drawer per project inside index.org, so "time spent on project X" is always one place. The index regex walker tolerates LOGBOOK drawers alongside PROPERTIES. - Letter-key allocation:
my/org-project--allocate-letter-keysis shared by capture and agenda so both surfaces use the same single- letter shortcut for a given slug. - Mapping helpers:
my/org-project-git-context—(REPO . BRANCH)for the current buffer, or nil.my/org-project-find-by-context— look a(repo, branch)up in active projects. Branch-specific mappings outrank any-branch ones.my/org-project-add-mapping/remove-mapping— read/write:REPOS:as an org multi-value property.add-mappingfirst removes any conflicting mapping from other projects so the lookup is unambiguous.my/org-project-mapping-add-here/mapping-remove-here— interactive commands wired into the project transient.
my/org-project-set-currentalso prompts[y]es-this-branch [a]ny-branch [n]oto persist a mapping when invoked inside a git repo.my/org-project-transient— theM-jtransient.
Interview-style note taking. Defines the :INTERVIEW_MODE: subtree
property, the capture template body that embeds it, and the buffer-
local my/org-interview-mode that rebinds C-<return> inside such
subtrees.
my/org-interview-property—"INTERVIEW_MODE".my/org-interview-capture-template-body— consumed bymy-org-capturefor theinterviewkind.my/org-interview-c-return— mode-localC-<return>handler: inserts a timestamped list item (- HH:MM) inside anINTERVIEW_MODEsubtree, falls back toorg-insert-heading-respect-contentelsewhere.my/org-interview-maybe-enable— hook function; turns the mode on whenever the current buffer contains anyINTERVIEW_MODEproperty line. Wired to bothorg-mode-hook(on-disk files) andorg-capture-mode-hook(freshly-captured interviews, since the template is inserted beforeorg-capture-modeactivates).
Capture template builders and the current-project capture entry point.
my/org-capture-category— builds a capture group from a(KEY NAME SUBDIR)tuple plus an optional list ofkinds(deadline,meeting,interview,whiteboard,miscellaneous). Journaling is intentionally not a per-category kind — there is a single top-level~/org/src/orgfiles/journal.orgreached viaJ.my/org-capture-project-templates— generatesj-prefixed templates for every active project, both digit slots (j1…j9) and single- letter shortcuts where available. Each group carries todo/reference/ pointer plus a whiteboard entry into<project>/whiteboard.org.my/org-current-project-capture-templates— generates the.-prefix templates for the current project, if any (includes.wfor whiteboard).my/org-rebuild-capture-templates— rebuildsorg-capture-templatesfrom scratch. Wired as a:beforeadvice onorg-captureand also called fromorg's post-load hook.my/org-project-capture— reads[t]odo [r]eference [p]ointer [w]hiteboardand delegates to(org-capture nil ".<c>"). If no current project is set, runsmy/org-project-set-currentfirst (which may persist a mapping).
Agenda dispatcher scoped to the capture layout.
- Agenda files: the top-level inbox, each
<category>/inbox.org, and every active project'sroot.org. Journals and notes are excluded to keep the view focused on actual tasks. - Commands:
my/org-agenda-everything-week,my/org-agenda-everything-todo,my/org-agenda-dispatch. - Category sub-transient: one dynamic suffix per category entry, in either weekly or TODO mode.
- Project sub-transient: one dynamic suffix per active project, keyed by its letter shortcut (falling back to a digit).
my/org-agenda-transient— theC-c amain transient.
Global minor mode that keeps my/org-current-project in sync with the
selected window's git context, plus the modeline segment and the
minimal modeline format used system-wide.
my/org-project-autoswitch-mode— installs handlers onwindow-buffer-change-functionsandwindow-selection-change-functions. On each buffer change, computes(repo, branch), looks it up viamy/org-project-find-by-context, and sets/clearsmy/org-current-projectaccordingly. Unmapped buffers clear the current project. A cachedlast-contextskips the work when nothing has changed.my/org-current-project-mode-line-segment—[proj: <slug>]segment, risky-local so:evalis allowed.my/projectile-mode-line-segment—<projectile-name>whenprojectile-modeis on and the current buffer is inside a project.my/org-minimal-mode-line-format— the full minimal format installed with(setq-default mode-line-format my/org-minimal-mode-line-format):buffer-id L%l (major-mode) <projectile> [proj: org].
| Binding | Command | What it does |
|---|---|---|
C-c c |
org-capture |
Standard org capture menu. |
C-c a |
my/org-agenda-transient |
Agenda dispatcher (everything / category / project). |
C-c v |
my/org-project-capture |
Capture into the current project; prompts for project and mapping if none is set. |
M-j |
my/org-project-transient |
Project management transient. |
| Column | Key | Command |
|---|---|---|
| Projects | g |
my/org-project-goto (active only, then [r]oot/[w]hiteboard) |
G |
my/org-project-goto-all (incl. archived, same kind prompt) |
|
n |
my/org-project-new |
|
a |
my/org-project-archive |
|
l |
my/org-project-list (open index) |
|
| Current project | s |
my/org-project-set-current |
c |
my/org-project-clear-current |
|
| Clock | i |
my/org-project-clock-in |
o |
my/org-project-clock-out |
|
I |
my/org-project-clock-in-last |
|
j |
my/org-project-clock-goto |
|
| Mappings | M |
my/org-project-mapping-add-here |
R |
my/org-project-mapping-remove-here |
|
T |
my/org-project-autoswitch-mode toggle |
|
| Goto file | f |
my/org-goto-toplevel-file |
| Column | Key | Command |
|---|---|---|
| Everything | a |
my/org-agenda-everything-week |
t |
my/org-agenda-everything-todo |
|
| Filtered | c |
category weekly agenda sub-transient |
C |
category TODO list sub-transient | |
p |
project TODO list sub-transient | |
| Raw | d |
my/org-agenda-dispatch |
| Binding | Command |
|---|---|
C-<return> |
my/org-interview-c-return |
Default categories w/p/t/d (Work/Personal/Talos/Debate), each
carrying the full set of kinds from my/org-capture-category:
| Suffix | Kind | Target |
|---|---|---|
d |
Deadline | <cat>/inbox.org |
m |
Meeting notes | <cat>/notes.org (weekly datetree) |
i |
Interview notes | <cat>/notes.org (weekly datetree) |
w |
Whiteboard | <cat>/whiteboard.org (daily datetree, HH:MM headline, cursor in body) |
x |
Miscellaneous | <cat>/inbox.org under Miscellaneous |
Project-specific keys live under the j prefix:
| Key | What it opens |
|---|---|
j1…j9 |
Digit slot for the N-th active project |
j<letter> |
Letter shortcut for a project that got one |
jXt |
Todo under that project's Tasks |
jXr |
Reference under that project's Reference |
jXp |
Pointer (captures %a link) under Pointers |
jXw |
Whiteboard entry in <project>/whiteboard.org |
The current project is reachable under the . prefix:
| Key | What it opens |
|---|---|
.t |
Todo in the current project |
.r |
Reference in the current project |
.p |
Pointer in the current project |
.w |
Whiteboard entry in the current project |
Top-level catch-alls:
| Key | What it opens |
|---|---|
J |
Journal → ~/org/src/orgfiles/journal.org (daily datetree) |
x |
Miscellaneous → ~/org/src/orgfiles/inbox.org To file |
One level-1 heading per project. Properties used:
:STATUS:—activeorarchived. Defaultactive.:CREATED:— inactive date, set bymy/org-project-new.:ARCHIVED_AT:— inactive timestamp, set bymy/org-project-archive.:REPOS:— space-separated multi-value. Each value isREPOorREPO@BRANCH. BareREPOmatches any branch. Repo paths containing spaces are not supported.
my/org-project-clock-in also clocks on this heading, so each project
accumulates a :LOGBOOK: drawer of CLOCK entries here. The drawer sits
alongside :PROPERTIES: and the index regex walker tolerates it.
Three fixed subtrees: Tasks, Reference, Pointers. Capture
templates under j/. target these by headline.
Freeform scratch file, seeded with just a #+title: line. Capture
templates jXw and .w land in a daily datetree with an auto
HH:MM headline — the cursor starts in the body so you can just
begin typing. Created by my/org-project-new; for projects that
predate the feature, the file is created lazily the first time
something is captured into it.
Analogous freeform scratch file at the category level, reached via the
w suffix under the category prefix (e.g. ww for Work whiteboard).
Same daily-datetree + auto-HH:MM-headline shape as the project
whiteboards. Created lazily by org-capture on first use.
Subtree property :INTERVIEW_MODE: t, written by the interview capture
template onto the Raw notes subheading. Used with org's inherited
property lookup so the mode works inside nested subheadings too.