unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Fwd: FYI Djvu package extension with svg annotations
       [not found] <CACJP=3njS0hnC=JG1DSCpWQHe-WrAjtdRaJh+CP93RPK8UZdPg@mail.gmail.com>
@ 2021-05-23  6:28 ` dalanicolai
  0 siblings, 0 replies; only message in thread
From: dalanicolai @ 2021-05-23  6:28 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 2292 bytes --]

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

---------- Forwarded message ---------
From: dalanicolai <dalanicolai@gmail.com>
Date: Sun, 23 May 2021 at 00:27
Subject: FYI Djvu package extension with svg annotations
To: <bug-gnu-emacs@gnu.org>


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
<https://github.com/dalanicolai/djvu3/blob/main/djvu.el> (a small comment
follows)
Although I had extended djvu.el already with some nice extra features in
djvu2 <https://github.com/dalanicolai/djvu2.el>, 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!

[-- Attachment #2: Type: text/html, Size: 3126 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-23  6:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CACJP=3njS0hnC=JG1DSCpWQHe-WrAjtdRaJh+CP93RPK8UZdPg@mail.gmail.com>
2021-05-23  6:28 ` Fwd: FYI Djvu package extension with svg annotations dalanicolai

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).