bug-auctex
[Top][All Lists]
Advanced

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

[Bug-AUCTeX] preview-1.247; preview-latex makes desktop restoration fail


From: Ralf Angeli
Subject: [Bug-AUCTeX] preview-1.247; preview-latex makes desktop restoration fail for some buffers
Date: Tue, 05 Apr 2005 09:15:42 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

Suppose you have a directory with two LaTeX files.  Have those two
files opened and call `M-x desktop-save RET' (if you have desktop.el
and preview-latex enabled).  After restarting Emacs only one of the
files will be loaded and the message

Desktop: 1 buffer restored, 1 failed to restore.

will be printed to the *Messages* buffer.

What is happening is that desktop.el calls `desktop-buffer-preview'
for latex-mode files which will return nil unless it finds the symbol
'preview in the car of `desktop-buffer-misc'.  But if you didn't have
any active previews such a symbol will not be present because
`desktop-buffer-preview-misc-data' didn't write generate anything like
that.  I think in such cases `desktop-buffer-preview' should just
return the buffer without extra processing in contrast to returning
nil.  Here is a patch doing this:

Attachment: txtgtks1Eby7q.txt
Description: Text Data

WDYT?


Emacs  : GNU Emacs 22.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.6.2)
 of 2005-03-30 on neutrino
Package: preview-1.247

current state:
==============

Output from running `gs -h':
ESP Ghostscript 7.07.1 (2003-07-12)
Copyright 2003 artofcode LLC and Easy Software Products, all rights reserved.
Usage: gs [switches] [file1.ps file2.ps ...]
Most frequently used switches: (you can use # in place of =)
 -dNOPAUSE           no pause after page   | -q       `quiet', fewer messages
 -g<width>x<height>  page size in pixels   | -r<res>  pixels/inch resolution
 -sDEVICE=<devname>  select device         | -dBATCH  exit after last file
 -sOutputFile=<file> select output file: - for stdout, |command for pipe,
                                         embed %d or %ld for page #
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PDF
Default output device: x11
Available devices:
[...]
Search path:
   . : /usr/share/gs-esp/7.07/lib : /usr/share/gs-esp/fonts :
   /var/lib/defoma/gs.d/dirs/fonts : /usr/share/cups/fonts :
   /usr/share/ghostscript/fonts : /usr/local/lib/ghostscript/fonts
For more information, see /usr/share/doc/gs-esp/Use.htm.
Report bugs using the form at "http://www.cups.org/str.php";.

(setq
 AUC-TeX-version "CVS-5.496"
 LaTeX-command-style '(("" "%(PDF)%(latex) %S%(PDFout)"))
 image-types '(png gif jpeg xpm xbm pbm postscript)
 preview-image-type 'dvipng
 preview-image-creators '((dvipng
                           (open preview-gs-open preview-dvipng-process-setup)
                           (place preview-gs-place)
                           (close preview-dvipng-close))
                          (png (open preview-gs-open) (place preview-gs-place)
                           (close preview-gs-close))
                          (jpeg (open preview-gs-open)
                           (place preview-gs-place) (close preview-gs-close))
                          (pnm (open preview-gs-open) (place preview-gs-place)
                           (close preview-gs-close))
                          (tiff (open preview-gs-open)
                           (place preview-gs-place) (close preview-gs-close))
                          )
 preview-dvipng-image-type 'png
 preview-dvipng-command "dvipng -picky -noghostscript %d -o 
\"%m/prev%%03d.png\""
 preview-pdf2dsc-command "pdf2dsc %s.pdf %m/preview.dsc"
 preview-gs-command "gs"
 preview-gs-options '("-q" "-dSAFER" "-dNOPAUSE" "-DNOPLATFONTS" "-dPrinted"
                      "-dTextAlphaBits=4" "-dGraphicsAlphaBits=4")
 preview-gs-image-type-alist '((png png "-sDEVICE=png16m")
                               (dvipng png "-sDEVICE=png16m")
                               (jpeg jpeg "-sDEVICE=jpeg")
                               (pnm pbm "-sDEVICE=pnmraw")
                               (tiff tiff "-sDEVICE=tiff12nc"))
 preview-fast-conversion t
 preview-prefer-TeX-bb nil
 preview-dvips-command "dvips -Pwww -i -E %d -o %m/preview.000"
 preview-fast-dvips-command "dvips -Pwww %d -o %m/preview.ps"
 preview-scale-function 'preview-scale-from-face
 preview-LaTeX-command '("%l \"\\nonstopmode\\nofiles\\PassOptionsToPackage{"
                         ("," . preview-required-option-list)
                         
"}{preview}\\AtBeginDocument{\\ifx\\ifPreview\\undefined" 
preview-default-preamble "\\fi}\\input{%t}\"")
 preview-required-option-list '("active" "tightpage" "auctex")
 preview-default-option-list '("displaymath" "floats" "graphics" "textmath"
                               "sections" "footnotes")
 preview-default-preamble '("\\RequirePackage["
                            ("," . preview-default-option-list)
                            "]{preview}[2004/11/05]")
 preview-LaTeX-command-replacements nil
 preview-dump-replacements '(preview-LaTeX-command-replacements
                             ("\\`\\([^ ]+\\)\\(\\( -\\([^ 
\"]\\|\"[^\"]*\"\\)*\\)*\\)\\(.*\\)\\'" "\\1 -ini \"&\\1\" " 
preview-format-name ".ini \\5")
                             )
 preview-undump-replacements '(("\\`\\([^ ]+\\)\\(\\( -\\([^ 
\"]\\|\"[^\"]*\"\\)*\\)*\\).*\\input{\\([^}]*\\)}.*\\'" "\\1 \"&" 
preview-format-name "\" \\5")
                               )
 preview-auto-cache-preamble t
 )

reply via email to

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