On Fri, Apr 28, 2006 at 12:08:46PM +0200, Matthias Rosenkranz wrote:
> The file I was editing is called kap1.tex and the Python script seems to
> append .tex to the filename, but kap1.tex.tex doesn't exist. Is there
> any other info I can provide? I can't remember seeing this error before
> a recent upgrade to version 20060325-1.

Hi Matthias,

the problem is in ftplugin/latex-suite/outline.py. This script scans your 
included/inputed tex-files for labels and so on but, unfortunately, when
opening the corresponding files an already given .tex extension is not
recognized, so a .tex is always appended.

I brewed up and attached a patch which fixes this behaviour. Please
confirm that it works for you. The erroneous file is located at
/usr/share/vim/addons/ftplugin/latex-suite/outline.py.

If everything works as expected there will be a new revision soon as
there's another patch pending, too. I'll also notify upstream about this
issue.

Thanks,
Franz

-- 
Franz Pletz                   \  The Internet treats censorship as
www: http://franz-pletz.org/   \  damage and routes around it.
email: [EMAIL PROTECTED]   \  -- John Gilmore
--- vim-latexsuite_20060325.orig/ftplugin/latex-suite/outline.py        
2006-03-21 20:29:35.000000000 +0100
+++ vim-latexsuite/ftplugin/latex-suite/outline.py      2006-04-28 
13:30:03.000000000 +0200
@@ -11,20 +11,28 @@
 import sys
 import StringIO
 
-# getFileContents {{{
-def getFileContents(argin, ext=''):
-    if type(argin) is str:
-        fname = argin + ext
+# includeFile {{{
+def includeFile(fname):
+    if type(fname) is not str:
+        fname = fname.group(3)
+
+    (root, ext) = os.path.splitext(fname)
+
+    if not ext:
+        return getFileContents(fname + '.tex')
     else:
-            fname = argin.group(3) + ext
+        return getFileContents(fname)
 
+# }}}
+# getFileContents {{{
+def getFileContents(fname):
     # This longish thing is to make sure that all files are converted into
     # \n seperated lines.
     contents = '\n'.join(open(fname).read().splitlines())
 
     # TODO what are all the ways in which a tex file can include another?
     pat = re.compile(r'^\\(@?)(include|input){(.*?)}', re.M)
-    contents = re.sub(pat, lambda input: getFileContents(input, ext), contents)
+    contents = re.sub(pat, includeFile, contents)
 
     return ('%%==== FILENAME: %s' % fname) + '\n' + contents
 
@@ -166,8 +174,7 @@
     if head:
         os.chdir(head)
 
-    [root, ext] = os.path.splitext(tail)
-    contents = getFileContents(root, ext)
+    contents = getFileContents(fname)
     nonempty = stripComments(contents)
     lineinfo = addFileNameAndNumber(nonempty)
 

Attachment: signature.asc
Description: Digital signature

Reply via email to