From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dalanicolai Newsgroups: gmane.emacs.devel Subject: Fwd: FYI Djvu package extension with svg annotations Date: Sun, 23 May 2021 08:28:15 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008db63b05c2f966cf" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1131"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 23 08:29:47 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lkhcR-00006H-22 for ged-emacs-devel@m.gmane-mx.org; Sun, 23 May 2021 08:29:47 +0200 Original-Received: from localhost ([::1]:34248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkhcQ-0003gG-2V for ged-emacs-devel@m.gmane-mx.org; Sun, 23 May 2021 02:29:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkhbF-0002zQ-J5 for emacs-devel@gnu.org; Sun, 23 May 2021 02:28:33 -0400 Original-Received: from mail-vs1-xe2d.google.com ([2607:f8b0:4864:20::e2d]:42905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkhbA-00071A-Bw for emacs-devel@gnu.org; Sun, 23 May 2021 02:28:33 -0400 Original-Received: by mail-vs1-xe2d.google.com with SMTP id j12so7539968vsq.9 for ; Sat, 22 May 2021 23:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=FZcdpOIYDnkyjAMFX7WYAtMTZ4xhyYhIqwS9uBuNZ2g=; b=Z4AfUEppCO9JKzjk2hGgj+hVLmXA8uxAul9UNTCV9l7j5CMMuGUv7JIwNI8d44B50J VC2DGrv1p7r/OmBTcZKMlQ5ZNwmozooV8MuTfuJVE/ws3uiTLFa4t9LWTf5R8byszlsQ 5sF5Q8bxaxgjCl9t1xVl5Aw/KoXvCIWRaev4WtPmwtMxKbXJSG5eBQzr8oIzo++XADhU G4tNzuStOPmSgw6my/pngQV7SRvQk2U82ms5iwmrhpFLHHEajQgWLQu8bBX6+9tClIEZ /GIPle6HvXefYgD/pfME+Z7QgnOF6Q7vKitbx+Hod1QyRr3wUhM6TVJtheutl0Tc8vas AbUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=FZcdpOIYDnkyjAMFX7WYAtMTZ4xhyYhIqwS9uBuNZ2g=; b=mJm+F5Cq57WXboPtbXPz4Z80ImseAfZV7C/0JgTioMWvPnIze1dXbWQHHXJqBNbIal hAsV+sI9iTR6waZTWS0mLyNfhyUKHWvuOIb4upMoBo217ImB3ZVzGyFoN2LWPSWTsMgc SIzQ7TeKmiZSuguEQjkqgs3jbpVNVWGgl+Y3NkB6/dp2F7kQrtM1oTM8ZVEjIFd/8lzt Rce8LAYySpcbX2uoujJc9Wf8cIBu1fMCadmPsddx4VrPqzEo6JliBK2yODUOi0J6wFWf PuA1wWNwDPfiQj/CdNjThhQ+BbEra8bCF97xNJQloBBGAMJF/Q0suOFxvW27y2xQDrhX 7Z9A== X-Gm-Message-State: AOAM532JDvqb0ZtcCcwLo8SVz5+lklOvZe8T4JKuF87k+qnKHUV4ECK6 hlB/cGf00MOWGx+M0VONhtFNKIrQY2GMk59HW5OEROoi6oRpYw== X-Google-Smtp-Source: ABdhPJxw3kQk7SNxhfjNSaXAVCb2F+pIw27t9hE7oVC8RvzlAW/2iRWZhRbPg/cBZoyZLDIPGPcsJl/Bpsc+p5gtsTA= X-Received: by 2002:a67:e34e:: with SMTP id s14mr4803656vsm.41.1621751306760; Sat, 22 May 2021 23:28:26 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e2d; envelope-from=dalanicolai@gmail.com; helo=mail-vs1-xe2d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269647 Archived-At: --0000000000008db63b05c2f966cf Content-Type: text/plain; charset="UTF-8" I have accidentally sent this mail to bug-gnu-emacs@gnu.org, but I actually wanted to post it here ---------- Forwarded message --------- From: dalanicolai Date: Sun, 23 May 2021 at 00:27 Subject: FYI Djvu package extension with svg annotations To: I have tried to inform you about this before by replying to an old bug-report, but it seems that that did not work out well. I will paste the text of that message below (with some updates) Hi Roland and others, I have made a small modification to the djvu-image function so that it displays annotations. The code can be found here (a small comment follows) Although I had extended djvu.el already with some nice extra features in djvu2 , those extensions mainly relied on the usage of the external imagemagick command. This time however, I have used Emacs capability of drawing svg files. I have simply embedded the ppm in an svg image and subsequently we can use svg.el to draw annotations. To test it you can just load the file after you loaded the original djvu.el and then open some djvu with annotations. I think the annotation part is quite clean code, and it is really just a small modification. Additionally in the section *Keyboard annotation functionality* I have added a quite fancy function to make highlights with the keyboard. You can test it after loading the file by using the command *djvu-keyboard-annot*. It is up to you if you also like to implement that. If you like to implement any of this in djvu.el, then I could make a patch. Or you can just copy the code and do with it whatever you like. Additionally I have a small question (to anyone receiving this mail) I wanted to keep the annotation draw functionality in a separate function outside of the djvu-image function, but then I had to pass all the local variabels, Do you happen to know some (closure like?) trick to pass the local variables while defining the function outside of the djvu-image function (so without passing the variables explicitly as arguments)? I forgot to mention that that keyboard annotation function is meant to be handy for annotating directly from djvu-image-mode... Thanks again! --0000000000008db63b05c2f966cf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I have accidentally sent this mail to = bug-gnu-emacs@gnu.org, but I a= ctually wanted to post it here

---------- Forwarded mess= age ---------
From: dalanicol= ai <dala= nicolai@gmail.com>
Date: Sun, 23 May 2021 at 00:27
Subj= ect: FYI Djvu package extension with svg annotations
To: <bug-gnu-emacs@gnu.org>

<= br>
I have tried to inform you about this before by re= plying to an old bug-report, but it seems that that did not work out well.<= /div>

I will paste the text of that message below (with = some updates)

Hi Roland and others,
=

I have made a small modification to the djvu-image func= tion so that it displays annotations. The code can be found here<= /a> (a small comment follows)
Although I had extended djvu.el= already with some nice extra features in djvu2, those extensions mainly rel= ied on the usage of the external imagemagick command.
This time however, I have used Emacs capability of drawing svg files. I have simply embedded the ppm in an svg image and subsequently we can use=20 svg.el to draw annotations.

To test it you can jus= t load the file after you loaded the original djvu.el and then open some dj= vu with annotations.
I think the annotation part is quite cle= an code, and it is really just a small modification.

Additionally in the section Keyboard annotation functionality I h= ave added a quite fancy function to make highlights with the keyboard.
You can test it after loading the file by using the command djvu-k= eyboard-annot.

It is up to you if you also lik= e to implement that. If you like to implement any of this in djvu.el, then = I could make a patch.
Or you can just copy the code and do with i= t whatever you like.

Additionally I have a sm= all question (to anyone receiving this mail)
I wanted to keep the annotation draw functionality in a separate function outside of the djvu-image function, but then I had to pass all the=20 local variabels,
Do you happen to know some (closure like?)=20 trick to pass the local variables while defining the function outside of the djvu-image function (so without passing the variables explicitly as arguments)?

I forgot to mention that that keyboar= d annotation function is meant to be handy for annotating directly from djv= u-image-mode...

Thanks again!

--0000000000008db63b05c2f966cf--