From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Roland Winkler" Newsgroups: gmane.emacs.devel Subject: Re: Djvu mode Date: Fri, 14 Oct 2011 07:52:06 -0500 Message-ID: <20120.12406.217640.108007@gargle.gargle.HOWL> References: <871uv17nar.fsf@gmail.com> <874nzwvjgi.fsf@maguirefamily.org> <82bou4y5kz.fsf@gmail.com> <87d3ejtjrb.fsf_-_@niu.edu> <87r52zl29j.fsf_-_@maguirefamily.org> <20100.46983.768447.889306@gargle.gargle.HOWL> <87d3ejgmmz.fsf@maguirefamily.org> <20103.17789.10053.53615@gargle.gargle.HOWL> <878vp49g56.fsf@maguirefamily.org> <20105.64927.931187.909507@gargle.gargle.HOWL> <87fwj9oltj.fsf@maguirefamily.org> <20106.42394.439216.956135@gargle.gargle.HOWL> <87ipnuqlsx.fsf@maguirefamily.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1318596750 30054 80.91.229.12 (14 Oct 2011 12:52:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 14 Oct 2011 12:52:30 +0000 (UTC) Cc: joakim@verona.se, emacs-devel@gnu.org To: Camm Maguire Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 14 14:52:23 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1REhFO-0007aY-Io for ged-emacs-devel@m.gmane.org; Fri, 14 Oct 2011 14:52:22 +0200 Original-Received: from localhost ([::1]:58464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REhFN-0001V2-Uv for ged-emacs-devel@m.gmane.org; Fri, 14 Oct 2011 08:52:21 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REhFM-0001ST-1j for emacs-devel@gnu.org; Fri, 14 Oct 2011 08:52:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1REhFK-0005e5-S7 for emacs-devel@gnu.org; Fri, 14 Oct 2011 08:52:19 -0400 Original-Received: from tfkpsv.physik.uni-erlangen.de ([131.188.164.197]:21659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REhFK-0005dU-Jh for emacs-devel@gnu.org; Fri, 14 Oct 2011 08:52:18 -0400 Original-Received: from regnitz (u010774.lc.ehu.es [158.227.8.163]) by tfkpsv.physik.uni-erlangen.de (Postfix) with ESMTP id 34FB584AA4; Fri, 14 Oct 2011 14:52:09 +0200 (CEST) In-Reply-To: <87ipnuqlsx.fsf@maguirefamily.org> X-Mailer: VM 8.2 trial under 24.0.50.1 (x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 131.188.164.197 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:145212 Archived-At: On Wed Oct 12 2011 Camm Maguire wrote: > Greetings! Where do we stand on this project? Correct me if I am wrong: - Joakim's name found its way into this thread because he was interested in a direct support for rendering djvu files inside emacs. So he was a driving force for adding ImageMagick to Emacs 24. In principle, ImageMagick can render djvu files. Yet the implementation does not yet work perfectly smooth, in particular for multipage djvu documents, where apparently ImageMagick attempts to put all pages into memory before it displays the first page. - Camm, I am sorry, I have not yet fully understood your code which unfortunately doesn't have very many comments, and many variables names are just one-letter names which doesn't make it easier for me, either. Anyway, it appears to me that the internals of your code rely on djvu images being converted to ppm format so that this code can do a fair amount of bit shifting in order to incorporate any highlighting in a djvu page into the image that is displayed by emacs. In the end, this highlighting is a cool feature, which, to the best of my knowledge, could not be implemented by other means currently available within emacs. - Finally, my code has not yet worried much about any internal display engine for djvu images. A major reason for this is that most of this code's functionality is not tied to any viewer, but it is is mostly operating on the text and annotation layers of djvu files. Then it uses the djview viewer from djvulibre which I find extremely fast for djvu files even if this viewer needs to be restarted frequently. (For this, it also helps that upon startup, djview can jump to the right place in the document.) In the meanwhile, I've also added some basic support to this code to display the djvu images inside emacs. So one can mark a region in these images that gets highlighted in the djvu file, kind of similar to what your code has been doing. - Another basic difference in the design of the two djvu modes is the handling of the text layer. Your code extracts the complete text layer of multipage documents so that it becomes searchable from within emacs. In principle, this is a great feature. Yet I find it too slow if a djvu document has many pages (a major bottleneck being the extraction of the complete text layer upon startup which makes loading a larger djvu document rather slow). So my code works strictly on one page at a time. With this approach, loading large documents does not take more time than loading small ones. The price to pay is that the document is not searchable beyond the current page. Personally, I do not find that a big problem because djview can search djvu documents extremely fast. It might be possible to aim for the best of both worlds by defining a limit for the total page number of a document up to which the whole text layer is extracted. Beyond this limit, one would operate on one page at a time. I have not yet thought about how this can possibly be implemented. So there are some basic differences in the design of the two modes that make it more difficult to go for something like a simple merge. I do not know what your thoughts have been to set up the features in your code the way they are. Roland