auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] a LaTeX-env-usepackage environment


From: Mosè Giordano
Subject: Re: [AUCTeX-devel] a LaTeX-env-usepackage environment
Date: Thu, 20 Feb 2014 00:40:54 +0100

Tassilo,

2014-02-14 19:03 GMT+01:00 Mosè Giordano <address@hidden>:
> 2014-02-14 16:31 GMT+01:00 Mosè Giordano <address@hidden>:
>> You might want to insert the `\usepackage's after the `\documentclass'
>> inside the `LaTeX-env-document' and I might agree, but that would
>> require some care and work.  Is this what you want?  I can try to
>> write down a patch for this.
>
> Ok, I wrote a small patch jsut to show what I mean.  It is a
> proof-of-concept, can be improved and suggestions are welcome.  The
> main changes are:
> - the body of `LaTeX-arg-usepackage' has been split into two new
> functions, one (LaTeX-arg-usepackage-get-packages-options) to get the
> arguments of `\usepackage' and another (LaTeX-arg-usepackage-insert)
> to actually insert them.  Apart from splitting its body, nothing has
> been changed inside `LaTeX-arg-usepackage'
> - a new function (LaTeX-insert-usepackages) has been defined, which
> prompts for a new `\usepackage' until empty input
> - `LaTeX-env-document' uses `LaTeX-insert-usepackages'.
>
> If this feature will be accepted, possible improvements come to my mind are:
> - in `LaTeX-arg-usepackage-get-packages-options', don't prompt for
> options if no package has been given
> - in `LaTeX-env-document', make autoinsertion of `\documentclass' and
> `\usepackage' optional but on by default (maybe not everybody likes
> this kind of automatisms).

Any comments about this feature? :-)  I'm sending a revised version of
the patch, the major change is that you aren't prompted for options if
no package is supplied.

Bye,
Mosè

Attachment: usepackage.patch
Description: Text Data


reply via email to

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