all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: dalanicolai <dalanicolai@gmail.com>
To: 48594@debbugs.gnu.org
Subject: bug#48594: FYI Djvu package extension with svg annotations
Date: Sun, 23 May 2021 00:27:48 +0200	[thread overview]
Message-ID: <CACJP=3njS0hnC=JG1DSCpWQHe-WrAjtdRaJh+CP93RPK8UZdPg@mail.gmail.com> (raw)

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

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,

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: 2437 bytes --]

             reply	other threads:[~2021-05-22 22:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-22 22:27 dalanicolai [this message]
2021-05-23  6:28 ` Fwd: FYI Djvu package extension with svg annotations dalanicolai
2022-07-15 10:18 ` bug#48594: " Lars Ingebrigtsen
2022-07-15 10:45   ` Visuwesh
2022-07-15 11:11     ` Lars Ingebrigtsen
2022-07-15 23:28       ` Roland Winkler
2022-07-16  9:59         ` dalanicolai

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

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

  git send-email \
    --in-reply-to='CACJP=3njS0hnC=JG1DSCpWQHe-WrAjtdRaJh+CP93RPK8UZdPg@mail.gmail.com' \
    --to=dalanicolai@gmail.com \
    --cc=48594@debbugs.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.