auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Insertion of braces when the last argument of a macro


From: Mosè Giordano
Subject: Re: [AUCTeX-devel] Insertion of braces when the last argument of a macro is optional
Date: Sat, 5 Oct 2013 00:13:51 +0200

Hi Tassilo,

2013/9/30 Tassilo Horn <address@hidden>:
>
> I don't like the setq-ing and resetting of `TeX-insert-braces'.  It's
> not unlikely that a user aborts (C-g) while inserting a macro, and then
> the resetting is skipped.  You could ensure resetting by wrapping
> anything else in a `ignore-errors` form, but even then things could go
> wrong in case a user aborts before the original value has been saved.
>
> I don't know, but maybe it would be better to have an explicit,
> buffer-local alist (TeX-insert-braces-alist?) of macros that either
> require braces or must not have braces.  Example:
>
>   '(("toprule" . nil)  ;; there must not be {}
>     ("foobar"  . t))   ;; there must be {}
>
> Then `TeX-parse-macro' could check this alist first before using the
> standard heuristics.
>

I agree again.  See the refreshed `booktabs.patch'.


> Hm, well, yes.  On the other hand, I also think that it's valuable that
> you can easily stop auctex from querying all remaining optional
> arguments.
>
> Maybe a good idea was to add another possible value
> `show-all-optional-args' to `TeX-insert-macro-default-style' which would
> always query for all optional args, regardless the value of
> `last-optional-rejected'.

Ok, the patch `show-all-optional-args.patch' should do that.


> (BTW: That it won't query for further
> optional args after rejecting one with `show-optional-args' isn't
> properly documented, so that would be a good chance to do that.)
>

Yep, this wasn't documented at all, it was a well kept secret in the
source code.

Bye,
Mosè

Attachment: booktabs.patch
Description: Binary data

Attachment: show-all-optional-args.patch
Description: Binary data


reply via email to

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