[Top][All Lists]

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

Re: [AUCTeX-devel] Document-environment, small suggestion

From: Ralf Angeli
Subject: Re: [AUCTeX-devel] Document-environment, small suggestion
Date: Sat, 04 Jul 2009 16:13:01 +0200

* Mads Jensen (2009-07-03) writes:

> Although this thing is most likely triggered very infrequently, I still
> consider it somewhat strange. Entering a new document-environment using
> C-c C-e inserts a new documentclass even though the document already
> contains one. Shouldn't auctex scan for a documentclass, and only insert
> one if it's not present already ?

The function which is invoked when you insert a document environment is
`LateX-env-document'.  Its doc string contains this: "Create new LaTeX
document."  So its purpose is actually to insert all things necessary to
create the document, which includes the document class.

I can understand that the insertion of the document class might
occasionally be unwanted but it would be quite hard to identify these
situations.  I thought about doing this only if point is near the top of
the buffer but then there are use cases where you want the document
class to be inserted even in the middle of a buffer.  DocTeX would be
one of those.  You could start to search all the way up to the top of a
buffer for a \documentclass macro but this can take a while in large
files.  And if you don't find one you might have to search in other
files using the file you are working with as input.  So for now I'd
rather leave this alone.


reply via email to

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