Commit Graph

249 Commits

Author SHA1 Message Date
eee626cf65 fix: restore org export + corfu — olivetti hook, global-org-modern, fragtog guard, super-agenda date
- olivetti: odstraněn org-mode-hook (měnil vizuální marginy → corfu popup souřadnice)
- org-modern: global-org-modern-mode → hook s guard na buffer-file-name
  (globální mode aktivoval org-modern v export temp bufferech → rozbití exportu)
  org-modern-table nil (tabulkové overlaye rizikovné při exportu)
- org-fragtog: :hook → config + guard na buffer-file-name
  (stejný problém s export temp buffery jako org-modern)
- org-super-agenda: backtick + org-read-date → plain quoted list
  (org-read-date evaluoval při startu, datum stárlo; relativní řetězec +3d je správný)
2026-02-23 18:35:39 +01:00
f856ad4f5c fix: org-super-agenda backquote, remove duplicate popup and terra in init.el 2026-02-23 17:10:20 +01:00
c9b855d26a feat: add link-hint, olivetti, org-modern, org-fragtog, org-super-agenda, org-noter, gptel-rewrite, git-link, forge 2026-02-23 17:09:34 +01:00
a60566d046 fix(org-latex): rewrite tabularx filter using with-temp-buffer + replace-match
Emacs 31 changed behavior of replace-regexp-in-string with lambda replacements
containing backslashes: 'Invalid use of backslash in replacement text' error.

Fix: use with-temp-buffer + re-search-forward + replace-match (literal t t).
replace-match with LITERAL=t never processes backslash sequences.

Also fixes \end{tabular} → \end{tabularx} regex to not match existing tabularx.
2026-02-23 15:23:51 +01:00
e084ff35ea fix(org-latex): tabularx filter with lYYY column spec matching template
document.org template defines Y column type (RaggedRight + auto-width X).
Filter now computes proper column spec:
  - 1 col  → Y
  - N cols → l + (N-1)*Y  (first col natural-width, rest auto-width)

Also handles tabularx{colspec} → tabularx{\linewidth}{lYYY} (missing width fix).
Works with ltablex (loaded by template) which makes tabularx also support page breaks.
2026-02-23 15:19:26 +01:00
854a6de40a fix(org-latex): filter-based tabularx with guaranteed registration
Root cause of \begin{tabularx}{lll} error: org-latex in this version does not
add \linewidth for tabularx environment, generating invalid LaTeX.

Fix: org-export-filter-table-functions filter that transforms rendered output:
  - \begin{tabular}{spec}     → \begin{tabularx}{\linewidth}{spec}
  - \begin{tabularx}{spec}    → \begin{tabularx}{\linewidth}{spec} (missing width fix)
  - \end{tabular}             → \end{tabularx}

No buffer modification → no recursion, works on Emacs 31.

Belt+suspenders registration: with-eval-after-load 'ox-latex + explicit
require+add-to-list in org-export-before-processing-hook ensures the filter
is always registered before the export transcoder runs.
2026-02-23 15:17:15 +01:00
7a1498cdd7 fix(org-latex): setq-local instead of insert for tabularx — no buffer modification
Root cause of Emacs 31 recursion: insert in org-export-before-processing-hook
triggers hooks that inhibit-modification-hooks does not suppress on Emacs 31
(window management, org-fold text properties, etc.). The old Mac (older Emacs)
was not affected.

Fix: setq-local org-latex-default-table-environment in the hook.
No buffer content modification → no hook chains → no recursion possible.
org-latex.el natively handles tabularx by adding \linewidth width argument.
tabularx added to org-latex-packages-alist.
2026-02-23 15:09:27 +01:00
2c2823a62d restore: original org-auto-tabularx with inhibit-modification-hooks (worked on Mac1)
Restore the hook-based approach from acb3875 (original working version) + the
inhibit-modification-hooks fix from 457b9d3 that made it work on Emacs 31.

457b9d3 confirmed working by Martin (PDF exported) — only issue was the syntax
warning from the stray paren. This commit has correct paren balance.

Also keep pdf-tools config and corfu-terminal Emacs 31 guard from 98b53cb.
2026-02-23 15:06:38 +01:00
98b53cb181 feat(pdf+org-latex): pdf-tools config + fix tabularx via default-table-environment
org-latex tabularx:
  - Dropped advice/filter/hook approaches (all caused issues)
  - Use org-latex-default-table-environment="tabularx" — org natively
    handles tabularx/tabulary by inserting \linewidth width arg automatically
  - tabularx added to org-latex-packages-alist

pdf-tools:
  - pdf-tools-install :no-query (auto-builds server binary)
  - pdf-view: fit-page default, Retina scaling, midnight dark theme,
    continuous scrolling, auto-revert after LaTeX re-export, no line numbers
  - Evil keybinds: j/k scroll, J/K pages, gg/G first/last, +/-/= zoom,
    W fit-width, / search, m midnight toggle, a annotate, q quit
  - org-file-apps on macOS: PDF opens in Emacs (pdf-view-mode via auto-mode)
    instead of system Preview
2026-02-23 15:02:31 +01:00
7b0b092e21 fix(org-latex): use :around advice on org-latex-table instead of filter
org-export-filter-table-functions timing was unreliable (after! ox-latex
runs too late or filter not called for all table types). Around advice on
org-latex-table is called directly during transcoding, guaranteed to run.
Also switched to with-eval-after-load for more predictable load timing.
2026-02-23 14:57:36 +01:00
46c9327dd0 fix(org-latex+corfu): filter-based tabularx, disable corfu-terminal on Emacs 31+
org-latex: replace before-processing-hook+insert with org-export-filter-table-functions.
  - Old approach (insert in hook) triggered org-element-cache after-change hooks
    causing infinite recursion / max-lisp-eval-depth even with inhibit-modification-hooks.
  - New: my/org-latex-table-to-tabularx filter transforms rendered LaTeX string,
    no buffer modification, no hook recursion possible.
  - Removed dead helpers: my/org-count-table-columns, my/org-table-attr-latex-spec.

corfu-terminal: add (< emacs-major-version 31) guard.
  - Emacs 31 supports corfu natively in terminal; corfu-terminal causes
    popup positioning issues (jumping) on Emacs 31+.
2026-02-23 14:53:41 +01:00
f36e515501 fix(syntax): balance parentheses in my/org-auto-tabularx 2026-02-23 14:47:24 +01:00
457b9d3d4c fix(org-latex): inhibit-modification-hooks in auto-tabularx to prevent recursion
The insert call in my/org-auto-tabularx triggered buffer-change hooks (e.g.
org-element-cache) during LaTeX export, causing infinite recursion and
'max-lisp-eval-depth exceeded'. HTML export was unaffected (hook only runs
for latex backend). Fix: wrap body in (let ((inhibit-modification-hooks t))).
2026-02-23 14:44:32 +01:00
26ac9082dd fix(org-latex): macOS PDF export - open async + latexmk nonstopmode
- 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)
2026-02-23 14:34:39 +01:00
9bf41c045a Revert "fix(scroll): enable pixel-scroll-precision-mode for smooth macOS trackpad scrolling"
This reverts commit 372e93fce4.
2026-02-23 14:32:47 +01:00
372e93fce4 fix(scroll): enable pixel-scroll-precision-mode for smooth macOS trackpad scrolling
Replace mwheel.el fallback with pixel-scroll-precision-mode (Emacs 29+).
Works on NS/Cocoa builds — previous comment was wrong.

- ns-use-mwheel-momentum t: pass through macOS kinetic scroll events
- pixel-scroll-precision-use-momentum nil: avoid double-momentum (macOS
  already handles inertia; Emacs simulation would stack on top)
- pixel-scroll-precision-large-scroll-height 40.0: reasonable page-jump size
- Removed global-set-key mwheel-scroll overrides (were blocking precision mode)
- Kept mouse-wheel-follow-mouse + mouse-wheel-tilt-scroll for horizontal
2026-02-23 14:26:01 +01:00
06de5b447a macos: revert pixel-scroll-precision-mode, fix scroll with mwheel
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)
2026-02-23 14:15:39 +01:00
Martin Sukany
a887f6a59d update 2026-02-23 14:12:37 +01:00
a1701b60ea fix(macos): enable pixel-scroll-precision-mode for smooth trackpad/mouse scrolling
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
2026-02-23 14:11:16 +01:00
96e8fc3f1c macos: fix mouse — scroll wheel works, movement doesn't move cursor
- 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)
2026-02-23 14:08:42 +01:00
312b6f0eab macos: clipboard image paste via cmd+v (pngpaste)
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: ![filename](./attachments/image-....png)
- creates attachments/ dir if missing

Requires: brew install pngpaste
2026-02-23 14:07:21 +01:00
9d8603d735 ement: silent startup restore via ement--reconnect, explicit homeserver
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.
2026-02-23 13:48:28 +01:00
d7f3c22a08 ement: move ement-save-sessions before after! block; pin sessions path
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.
2026-02-23 13:43:52 +01:00
95f80f9c44 ement: proper auto-restore and open-panel flow
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).
2026-02-23 13:40:39 +01:00
61bc7e7490 ement: fix commandp error — move defuns outside after! block
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).
2026-02-23 13:36:01 +01:00
8bc82d358f ement: auto-connect on startup, my/ement-open, remove ement-sync binding
- 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
2026-02-23 13:24:37 +01:00
acb38759b9 org-agenda: skip all todo keywords; disable mouse in GUI
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.
2026-02-23 13:17:40 +01:00
6aa50c9b59 style: translate Matrix section comments and :desc labels to English 2026-02-23 11:01:09 +01:00
Martin Sukany
9dc3b61416 Merge remote-tracking branch 'refs/remotes/origin/master' 2026-02-23 10:56:26 +01:00
ef6b7feb26 fix: Matrix prefix o m → o M (mu4e conflict)
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).
2026-02-23 10:55:58 +01:00
Martin Sukany
365219c4d1 patch updated 2026-02-23 10:55:10 +01:00
27904531ee feat: Matrix client (ement.el) — SPC o m keybindings + E2EE via Pantalaimon 2026-02-23 10:49:18 +01:00
87003cac96 fix: use manual y-flip instead of accessibilityConvertScreenRect:
Compilation error: EmacsView does not declare NSAccessibility conformance
so accessibilityConvertScreenRect: is not visible to the compiler.
Replaced with manual coordinate conversion:
  primaryH = NSScreen.screens.first.frame.height
  cgRect.origin.y = primaryH - cgRect.origin.y - cgRect.size.height
2026-02-23 10:28:02 +01:00
5196674d9e fix: UAZoomChangeFocus() — actual fix for macOS Zoom cursor tracking
Root cause found via research pipeline:
NSAccessibility notifications alone are insufficient for custom NSView.
macOS Zoom 'Follow keyboard focus' requires UAZoomChangeFocus() from
HIServices/UniversalAccess.h — same as iTerm2 and Chromium.

Squashed into single clean patch. 159 insertions, 2 files.
2026-02-23 10:22:59 +01:00
56db072f06 fix: add NSAccessibilityPostNotification (key missing piece)
macOS Zoom is event-driven -- it only queries AXBoundsForRange after
receiving NSAccessibilitySelectedTextChangedNotification. Previous
version implemented the bounds methods but never posted notifications,
so Zoom never triggered a cursor position query.

Added:
- NSAccessibilityPostNotification(SelectedTextChanged) in ns_draw_window_cursor
- NSAccessibilityPostNotification(FocusedUIElementChanged) in windowDidBecomeKey
- accessibilityAttributeNames + accessibilityAttributeValue: for
  NSAccessibilitySelectedTextRangeAttribute -> returns {0,0}
2026-02-23 10:03:51 +01:00
12869677e7 fix: correct hunk line count in patch (83→91) 2026-02-23 09:22:51 +01:00
ce46e5b7eb fix: add accessibilityBoundsForRange: (new NSAccessibilityProtocol) + isAccessibilityElement
Old parameterized attribute API alone insufficient — macOS Zoom prefers
the new NSAccessibilityProtocol method accessibilityBoundsForRange:.
Also adds isAccessibilityElement returning YES.

Both APIs now implemented for compatibility across macOS versions.
2026-02-23 09:19:51 +01:00
78ee89512e fix: zoom cursor visibility + translate all comments/messages to English 2026-02-22 23:33:13 +01:00
e6d6fc62fd feat: add NSAccessibility AXBoundsForRange patch for macOS Zoom cursor tracking 2026-02-22 23:31:12 +01:00
Martin Sukany
d404c84963 updated comments 2026-02-22 23:21:15 +01:00
21c7142d07 chore: remove split-screen magnifier (blind alley) 2026-02-22 23:17:10 +01:00
b8889cfa06 fix: magnifier buffer-switch + cursor visibility (architect-critic-coder pipeline) 2026-02-22 23:11:35 +01:00
d3747f71c4 fix: magnifier cursor visible, line nums hidden, M-x/which-key safe 2026-02-22 23:03:16 +01:00
a71e212d81 feat: full-featured Emacs-native magnifier, remove macOS zoom daemon 2026-02-22 22:57:58 +01:00
0e1232ad00 fix: pgrep matches Emacs-arm64-11 variant (Emacs.app path) 2026-02-22 22:36:38 +01:00
ce3c7b3127 refactor: Python ctypes daemon for macOS Zoom (no external tools) 2026-02-22 22:24:30 +01:00
c6b45f6867 feat: Hammerspoon IPC cursor tracking + split magnifier (SPC z m) 2026-02-22 22:05:36 +01:00
21b1637390 refactor: cursor tracking redesign based on research; clean SPC z 2026-02-22 21:51:36 +01:00
04b93dd067 refactor: focus follow — idle-timer warp, 3 modes, minibuffer support 2026-02-22 21:36:37 +01:00
f49ef939a2 fix: warp uses posn-at-point+window-pixel-edges (frame-relative, not display-absolute) 2026-02-22 21:26:42 +01:00