[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Patch] Draw and scribble notes in GNU Emacs
From: |
Lars Ingebrigtsen |
Subject: |
Re: [Patch] Draw and scribble notes in GNU Emacs |
Date: |
Thu, 09 Sep 2021 16:50:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Anand Tamariya <atamariya@gmail.com> writes:
> Here's a proposal for drawing and scribbling notes in GNU Emacs.
> Features:
>
> * Draw simple shapes and text
> * Scribble freehand
> * Visual selection using mouse
> * Zoom
> * Undo/delete selection
> * Erase
Looks cool -- perhaps something for GNU ELPA?
> I have few questions:
> - Can this be included in Emacs core?
> - I've copied two functions from Lars
> (https://github.com/larsmagne/ewp/blob/master/ewp.el ). How should
> attribution work in this case?
I've been thinking that I should push ewp to GNU ELPA, but I've never
taken the time. (It's a package for editing Wordpress blogs.)
> (defun svg--append (svg node)
> + ;; id is expected to be unique.
> (let ((old (and (dom-attr node 'id)
> (dom-by-id svg
> (concat "\\`" (regexp-quote (dom-attr node 'id))
> "\\'")))))
> (if old
> - ;; FIXME: This was (dom-set-attributes old (dom-attributes node))
> - ;; and got changed by commit f7ea7aa11f6211b5142bbcfc41c580d75485ca56
> - ;; without any explanation.
> - (setcdr (car old) (cdr node))
> - (dom-append-child svg node)))
> + ;; Remove old node. New node might be a different type.
> + (mapc (lambda (a)
> + (dom-remove-node svg a))
> + old))
> + (dom-append-child svg node))
Hm... I think this is basically correct, but it's a behaviour change --
previously svg--append wouldn't append if the ID already existed, but
would keep the save place in the structure, but with this change, it
really always appends.
So I don't think that's quite right -- the old behaviour was OK, I think
(but undocumented).
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Re: [Patch] Draw and scribble notes in GNU Emacs, Anand Tamariya, 2021/09/13
Re: [Patch] Draw and scribble notes in GNU Emacs,
Lars Ingebrigtsen <=