Ah, I remember that I linked to the package in my original
message, but indeed I do not find any link there (let me see if
this works, otherwise the package can be found at:
https://github.com/dalanicolai/sketch-mode).

Anyway, although I do not immediately see any big advantage of
having the image overlayed on a 'semantically corresponding
text', it sounds like an interesting idea. Maybe you can explain the
advantages in a little more detail.

I was thinking of creating a togglable side-window that can show various
'levels` of definitions (layers, objects etc.). It is not very useful to get the
full definition of the svg image, as it is 'polluted' with the definitions of
the grid and the object's labels. So a sketch-mode image is build up modularly
using svg-groups, where the grid and labels and the different layers are added
as different modules/groups. So when I overlay the image on semantically
corresponding text, I would not immediately know which part of the definition
best to use for the text (the svg definition, the full elisp image definition,
only the layers?)

Indeed, the package is only an isolated editor emulated in Emacs, but it has
certain advantages over more specialized software especially for simple svg
images; i.e. it is in Emacs, sketches can be created really quick and finally it
is an Emacs package and therefore ultimately/easily hackable. So users can
implement whatever they like, e.g. snippets, and use elisp functions for
drawing certain patterns etc.

I have written a little motivation and vision in the sketch-mode wiki
(https://github.com/dalanicolai/sketch-mode/wiki).

Furthermore, if you would like to contribute/join in development then you are
very welcome.

Finally, I think we should move further discussions to either a github issue or
to the discussions board (https://github.com/dalanicolai/sketch-mode/discussions).

Daniel

On Mon, 30 Aug 2021 at 08:00, Qiantan Hong <qhong@mit.edu> wrote:
> I am writing primarily to notify you about a package, sketch-mode, I am working on. It provides a handy interface to quickly draw svg's using, well Emacs, but in particular svg.el and transient.el.
> It is handy in particular for creating svg sketches really fast, while of course, it has the advantage over other svg drawing applications that it is very hackable in your favorite langauge :)

This looks very exciting! Is the code available somewhere?

One important question I have is, do you implement it by putting an SVG overlay/property over a single dummy character,
or do you put it on a range of text that *semantically* correspond the SVG being displayed?
I strongly recommend the latter model because it makes it possible to blend in Emacs,
e.g. you can get cursor movement, selection, copy/yank etc relatively easily.
Just for a started, suppose underlying text is structured as one word correspond to and SVG element,
then one can use forward-word backward-word to move between elements.
And there’s much more to explore using other existing structural editing command.
On the other hand, overlaying over a single dummy character just sounds like inventing
a different, isolated editor emulated in Emacs.

I posted some more in-depth discussion over such issue here http://lambda-the-ultimate.org/node/5630#comment-96710

If you find the above proposals compelling, I’m happy to collaborate on it if that’s helpful!
I once experimented building a music notation software using the above discipline
(character -> note head, word -> chord, sentence -> beamed note, paragraph -> bar)
but eventually I abandoned it and get away with MuseScore.

Best,
Qiantan