From 0d99968038f14175e8c9ac05b8a2adc4d1fe095d Mon Sep 17 00:00:00 2001 From: fenix Date: Thu, 19 Mar 2026 09:26:32 +0100 Subject: [PATCH] Add emacs-svg-maps skill (migrated from ~/.claude/skills/) Consolidated all skills into this repo as the single source of truth. Previously lived as an orphan in ~/.claude/skills/emacs-svg-maps/. Co-Authored-By: Claude Opus 4.6 --- skills/emacs-svg-maps/SKILL.md | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 skills/emacs-svg-maps/SKILL.md diff --git a/skills/emacs-svg-maps/SKILL.md b/skills/emacs-svg-maps/SKILL.md new file mode 100644 index 0000000..c87333a --- /dev/null +++ b/skills/emacs-svg-maps/SKILL.md @@ -0,0 +1,50 @@ +--- +name: emacs-svg-maps +description: Emacs workflows for SVG map editing — nxml-mode, EWW preview, Inkscape integration, and emacsclient commands for itinerary map projects. +--- + +# Emacs SVG Map Editing + +## Quick Emacs Commands for SVG Work + +### Open SVG for source editing (nxml-mode) +```bash +emacsclient --socket-name=water --eval '(find-file "netherlands3.svg")' +``` + +### Quick preview in EWW (limited but fast) +```bash +emacsclient --socket-name=water --eval '(eww-open-file (expand-file-name "netherlands3.svg"))' +``` +Tell Fénix to press `g` in EWW to reload after changes. + +### Navigate to MARKERS layer in SVG source +```bash +emacsclient --socket-name=water --eval '(progn (find-file "netherlands3.svg") (goto-char (point-min)) (search-forward "ITINERARY MARKERS"))' +``` + +### Check marker count +```bash +emacsclient --socket-name=water --eval '(with-current-buffer (find-file-noselect "netherlands3.svg") (count-matches "marker-" (point-min) (point-max)))' +``` + +## SVG + nxml-mode Tips + +- SVG files open in `nxml-mode` automatically — syntax highlighting and tag matching +- `C-c C-f` / `C-c C-b` — fold/unfold XML elements (navigate large SVG layers) +- `C-c C-n` — narrow to current element (focus on one marker) +- `M-x nxml-balanced-close-start-tag` — auto-close SVG tags + +## Integration with geo2svg.py + +After running `python3 geo2svg.py --builtin netherlands3.svg`: +1. Emacs auto-reverts if `auto-revert-mode` is on +2. Otherwise: `M-x revert-buffer` in the SVG buffer +3. Check diff: `M-x magit-diff-buffer-file` or `C-x v =` + +## Inkscape ↔ Emacs Handoff + +When editing in Inkscape: +- Save in Inkscape → Emacs auto-reverts the buffer +- Edit source in Emacs → reload in Inkscape (`F5` or reopen) +- Use `git diff` before committing to filter Inkscape metadata noise