unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Anand Tamariya <atamariya@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: [Patch] Draw and scribble notes in GNU Emacs
Date: Thu, 09 Sep 2021 16:50:53 +0200	[thread overview]
Message-ID: <87fsudu7jm.fsf@gnus.org> (raw)
In-Reply-To: <CADm7Y4nWYswRR-uk5ACZ5YTvC94mGX-ZRRUOm=hB8LkOLEZNSg@mail.gmail.com> (Anand Tamariya's message of "Thu, 9 Sep 2021 13:24:44 +0530")

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



  parent reply	other threads:[~2021-09-09 14:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09  7:54 [Patch] Draw and scribble notes in GNU Emacs Anand Tamariya
2021-09-09  8:33 ` Po Lu
2021-09-09 12:00   ` Eli Zaretskii
2021-09-09 12:23     ` Po Lu
2021-09-09 14:51       ` Lars Ingebrigtsen
2021-09-10 21:45         ` dalanicolai
2021-09-13  5:32           ` Anand Tamariya
2021-09-13  5:15   ` Anand Tamariya
2021-09-09 14:50 ` Lars Ingebrigtsen [this message]
2021-09-13  5:36   ` Anand Tamariya
2021-09-13  8:25     ` Lars Ingebrigtsen
2021-09-13  8:31       ` Anand Tamariya
2021-09-13  8:47         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fsudu7jm.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=atamariya@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).