Closed progfolio closed 1 year ago
Hi. Thank you for your contribution.
I've fixed compilation warnings, replaced all the manually constructed regexps with builtin constants and now I use ot-svg-obj
global variable to search for a block under mouse cursor in ot-select-block-under-mouse
. It's the only place I used this object though.
For searching over svg object, I used dom-search
which returns all matched nodes. I think the dom.el library lacks of something like dom-find
that returns only the first matched node (like seq-find). Maybe it's a good idea to send it in a patch.
Avoid this pattern:
It makes debugging the functions which use
on
much harder than necessary. It would be better to properly define the macro usingdefmacro
and use it. Even better would be to rewriteon
as a function so a macro is not necessary at all.The macro also raises the following byte-compiler warnings:
Can this regexp be replaced with
org-scheduled-regexp
?Likewise, could these be replaced by
org-tsr-regexp
?:Instead of searching through the text of the svg file, you should be able to give each element an id or classname when creating them and programatically manipulate them via the svg functions or the built-in dom.el.