1.7 KiB
1.7 KiB
| name | description |
|---|---|
| emacs-svg-maps | 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)
emacsclient --socket-name=water --eval '(find-file "netherlands3.svg")'
Quick preview in EWW (limited but fast)
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
emacsclient --socket-name=water --eval '(progn (find-file "netherlands3.svg") (goto-char (point-min)) (search-forward "ITINERARY MARKERS"))'
Check marker count
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-modeautomatically — 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:
- Emacs auto-reverts if
auto-revert-modeis on - Otherwise:
M-x revert-bufferin the SVG buffer - Check diff:
M-x magit-diff-buffer-fileorC-x v =
Inkscape ↔ Emacs Handoff
When editing in Inkscape:
- Save in Inkscape → Emacs auto-reverts the buffer
- Edit source in Emacs → reload in Inkscape (
F5or reopen) - Use
git diffbefore committing to filter Inkscape metadata noise