aboutsummaryrefslogtreecommitdiff
path: root/assets/outbox/2026-06-12-2006-from-.emacs.d-quick-capture-script-change.org
blob: fbaf5fe52457483442ff85fadc3cddd403b615c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#+TITLE: Follow-up: point quick-capture at cj/quick-capture (one-line script change)

* Why a follow-up

The single-window fix from the last note is live and stands on its own. But reviewing it surfaced more: the popup's =*Org Select*= menu shows all ten capture templates, and most make no sense launched from the desktop — Link / Link-with-Selection are browser (org-protocol) captures, Epub/PDF need a document buffer (the PDF ones error outright), mu4e Email needs a message. Worse, aborting the menu (q / C-g) or an erroring template leaves the frame orphaned, because Emacs only closes it on a *completed* capture.

So there's now a dedicated entry point that fixes both.

* What changed in .emacs.d

New command =cj/quick-capture= in =modules/org-capture-config.el= (live in the daemon):

- Offers only Task, Bug, and Event.
- Task and Bug file to the global inbox (a desktop capture has no meaningful project context — the old project-aware target resolved against whatever buffer the daemon last had open).
- Closes the popup frame on every exit path — abort, error, or finalize — so a stray selection never orphans it.

12 ERT tests cover the template subset, the inbox retarget, and the frame-cleanup on abort/quit/success.

* The one-line script change (archsetup's side)

In =~/.dotfiles/hyprland/.local/bin/quick-capture=, change the =-e= form to call =cj/quick-capture= instead of =org-capture=:

#+begin_src sh
emacsclient -c \
    -F '((name . "org-capture") (width . 90) (height . 22))' \
    -e '(progn (select-frame-set-input-focus (selected-frame)) (cj/quick-capture))'
#+end_src

Only the final symbol changes: =(org-capture)= becomes =(cj/quick-capture)=. The frame name stays "org-capture" (all the config-side gating keys on it), and the width/height/rules are unchanged.

Until the script is updated, the popup still works with the single-window fix — it just shows the full template menu and keeps the old targets. The menu subset, inbox target, and abort-close only take effect once the script calls =cj/quick-capture=.

* Verify (after the script change)

Super+Shift+N, then:
- The menu lists only Task / Bug / Event, single window.
- Task or Bug lands in the global inbox under "Inbox".
- Event prompts for a date and files to the schedule.
- Hitting q or C-g at the menu closes the popup (no orphan frame).

If anything's off, send a note back with a fresh crop.