[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-AUCTeX] Re: 11.85; PDF file deleted when generating previews

From: Ralf Angeli
Subject: [Bug-AUCTeX] Re: 11.85; PDF file deleted when generating previews
Date: Sun, 14 Jun 2009 20:42:27 +0200

* Ralf Angeli (2009-02-14) writes:

> * David Reitter (2009-02-09) writes:
>> - In AUCTeX (latest release) with PDF mode on, using the command bound  
>> to the menu item "(or toggle) at point", the .pdf file associated with  
>> the master file for the current .tex source is deleted.  This is  
>> annoying; among the problems it causes is the reported one quoted below.
>> It appears that the .pdf file is deleted towards the end of the  
>> preview generation; this is noticeable when running the slower  
>> "generate previews for buffer".
>> Further investigation shows that the .pdf file is deleted by preview- 
>> gs-sentinel because it is the car of `preview-ps-file'.
> AFAICS there might be two problems:
> 1) The car of `preview-ps-file' should likely point to _region_.pdf
>    because that's the intermediate store for previews before they are
>    being extracted to become PNG files.
> 2) The file given in the car of `preview-ps-file' should likely not be
>    deleted in `preview-gs-sentinel'.

As far as I can see I was wrong with the assessment in the second point.
At least preview-latex does the same deletion in the DVI case.  However,
in the PDF case it eventually deletes the wrong file, so the first point
should be valid.  Would anybody object to the following change?  It
assures that depending on the preview operation either `TeX-region-file'
or `TeX-master-file' is called, instead of always assuming the master
file to be the PDF source.

--- preview.el.~1.283.~ 2008-05-25 08:45:06.000000000 +0200
+++ preview.el  2009-06-14 20:34:02.000000000 +0200
@@ -3098,7 +3098,7 @@
                        (TeX-command-expand preview-pdf2dsc-command
                                            (car file))
                      (setq tempdir TeX-active-tempdir
-                           pdfsource (TeX-master-file "pdf")))))
+                           pdfsource (funcall `,(car file) "pdf")))))
         (name "Preview-PDF2DSC"))
     (setq TeX-active-tempdir tempdir)
     (setq preview-ps-file (preview-attach-filename


reply via email to

[Prev in Thread] Current Thread [Next in Thread]