- org-file-apps: use 'open %s' for PDF on darwin → async launch, no beachball
- org-latex-pdf-process: explicit latexmk -f -interaction=nonstopmode
(belt+suspenders; Doom module sets this but not always loaded early enough)
pixel-scroll-precision-mode (from previous commit) breaks scrolling on
NS/Cocoa builds: it rebinds [wheel-up/down] to precision handlers that
do not work with the NS event system, resulting in zero scroll response.
Fix: remove pixel-scroll-precision-mode, use standard mwheel.el:
- require mwheel explicitly (Doom may not load it early enough)
- 3 lines/tick, shift=1, meta=0, ctrl=text-scale
- mouse-wheel-progressive-speed nil (constant speed, no acceleration)
- mouse-wheel-tilt-scroll t (horizontal two-finger scroll)
- explicitly bind [wheel-up/down] to mwheel-scroll (prevents Doom
remapping from silently eating scroll events)
macOS NS/Cocoa Emacs generates pixel-level scroll events from trackpad
and Magic Mouse. Without pixel-scroll-precision-mode, these events are
handled as line-based scrolling, resulting in jerky or broken scroll
behavior.
Changes:
- Enable pixel-scroll-precision-mode (Emacs 29+) in GUI mode
- Set pixel-scroll-precision-large-scroll-height to 40.0 (prevents
trackpad fling from being interpolated frame-by-frame)
- Enable momentum scrolling (trackpad inertia from macOS)
- Keep line-based mouse-wheel-scroll-amount as fallback for physical
scroll wheels
- mouse-autoselect-window nil: mouse movement no longer switches
active window (was the main cause of apparent cursor jumping)
- focus-follows-mouse nil: same — no focus change on hover
- mouse clicks still disabled ([mouse-1..3] → #'ignore)
- scroll wheel explicitly configured: 3 lines/tick, no acceleration,
no progressive speed (mouse-wheel-scroll-amount)
my/smart-paste bound to s-v (cmd+v) in org-mode and markdown-mode:
- clipboard has image → my/paste-image-from-clipboard
- clipboard has text → normal yank
my/paste-image-from-clipboard:
- saves to attachments/ relative to current file
- filename: image-YYYYMMDD-HHMMSS.png
- org-mode: [[./attachments/image-....png]]
- markdown-mode: 
- creates attachments/ dir if missing
Requires: brew install pngpaste
my/ement-maybe-restore now:
- Loads sessions file manually (ement--load-sessions) before connecting
- Calls ement--reconnect directly on each loaded session — bypasses all
interactive prompts in ement-connect (homeserver discovery, read-passwd)
- Fallback to ement-connect with explicit :homeserver if --reconnect absent
- condition-case wrapper — startup errors are silent, never block Emacs
my/ement-open: use my/ement-maybe-restore (instead of ement-connect
directly) for the 'sessions file exists' branch.
ement checks ement-save-sessions during its own init to register
kill-emacs-hook. Setting it inside after! was too late — the hook
wasn't added, so sessions were never saved on Emacs exit.
Also set ement-sessions-file explicitly to doom-private-dir to avoid
no-littering path redirection surprises.
my/ement-open now handles 3 cases:
1. Already connected -> ement-list-rooms immediately
2. Sessions file exists -> ement-connect (no credentials), then
open rooms via ement-after-initial-sync-hook
3. No saved session -> call-interactively ement-connect, then rooms
my/ement-open-after-sync: self-removing hook that opens room list
after initial sync completes (regardless of how connect was triggered).
Startup auto-connect unchanged (doom-after-init-hook).
Functions defined inside (after! ement ...) are not registered as
interactive commands by Doom. Move my/ement-maybe-restore and
my/ement-open to top level.
Also move add-hook from inside after! to top level (after-init-hook
fires before lazy packages load — use doom-after-init-hook instead).
- my/ement-maybe-restore: restores saved session on after-init-hook,
no credentials prompt (requires one manual login first)
- my/ement-open: SPC o M o — connects if needed, then ement-list-rooms
- Remove SPC o M s (ement-sync is internal, manual call causes double-loop)
- Update quick reference comments
1. my/org-agenda-goto-task-name: replace face-based detection with
regexp-opt over org-todo-keywords. Works for all keywords
(TODO, NEXT, WAIT, DONE, CANCELLED, ...), not just TODO/DONE.
Added helper my/org-agenda-all-keywords.
2. Disable mouse clicks in GUI Emacs (Fix C in macOS GUI section):
global-set-key [mouse-*] to #'ignore, mouse-highlight nil.
Prevents accidental cursor movement when touching trackpad.
Doom mu4e module binds SPC o m directly to #'mu4e (non-prefix).
Collision prevented ement keybindings from loading.
Renamed Matrix prefix to SPC o M (uppercase).