From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: doc-view.el --- View PDF/PostScript/DVI files in Emacs Date: Sat, 25 Aug 2007 20:34:10 +0200 Message-ID: <854pincvkt.fsf@lola.goethe.zz> References: <87d4xd19f8.fsf@baldur.tsdh.de> <87ejhtkvc7.fsf@cadilhac.name> <87ir753qgu.fsf@baldur.tsdh.de> <85r6lsfw3q.fsf@lola.goethe.zz> <87zm0fmsod.fsf@baldur.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1188072361 22698 80.91.229.12 (25 Aug 2007 20:06:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 25 Aug 2007 20:06:01 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 25 22:05:54 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IP1tI-0008SJ-IB for ged-emacs-devel@m.gmane.org; Sat, 25 Aug 2007 22:05:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IP1tI-0006DJ-4b for ged-emacs-devel@m.gmane.org; Sat, 25 Aug 2007 16:05:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IP1tE-0006B2-Bu for emacs-devel@gnu.org; Sat, 25 Aug 2007 16:05:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IP1tD-0006Aq-QW for emacs-devel@gnu.org; Sat, 25 Aug 2007 16:05:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IP1tD-0006An-Nc for emacs-devel@gnu.org; Sat, 25 Aug 2007 16:05:47 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IP1t9-0004BB-7z; Sat, 25 Aug 2007 16:05:43 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IP1t5-0002wi-Hx; Sat, 25 Aug 2007 16:05:39 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id B5DA01C46118; Sat, 25 Aug 2007 20:34:10 +0200 (CEST) In-Reply-To: <87zm0fmsod.fsf@baldur.tsdh.de> (Tassilo Horn's message of "Sat\, 25 Aug 2007 19\:26\:42 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:77148 Archived-At: Tassilo Horn writes: > David Kastrup writes: > >> Have you tried out preview-latex (integrated with AUCTeX since >> version 11.80)? It displays images in Emacs buffers without >> blocking Emacs at all, and renders stuff in the background with a >> focus on material that is on-screen. > > I had a look at it but it didn't look that borrowing code there > would simplify doc-view.el. I was not thinking about simplification, but rather improvement. >> It works using Ghostscript on either PDF or PostScript files (in >> the latter case, dvips is used) or dvipng on DVI files. > > I changed doc-view.el so that it uses plain ghostscript (plus > dvipdfm for DVI files) which gives good results and is about ten > times faster than with ImageMagick's convert. > > The only downside is that I don't know how to cut off the margins. > Those waste a lot of buffer space when displaying the image. > converts -trim option was very nice for that cause. Do you know how > one can do that with ghostview? Well, that is one of the things done in preview-latex. Do you have the bounding box information for your images (preview-latex takes them from TeX usually)? >> Ghostscript is used as a daemon in order to render the stuff in a >> useful order, and a single Ghostscript session renders all images. > > Well, the conversion in doc-view.el runs asynchronous, too. Users > can go on with their work and eventually the *DocView* buffer will > pop up. preview-latex provides a working view of the buffer straight away, rendering images and replacing place-holders first on the displayed screen area, then off-screen. That way, you get immediate visual feedback where you need it, even though the rendering of thousands of images might take a minute or so. It is really several years of optimizations and user feedback that went into the code base. You should take it for a test drive before deciding that its behavior does not suggest interesting material to your project. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum