Mosè Giordano <[email protected]> writes:

Hi Mosè,

> You're right, I agree.  The attached patch takes a completely
> different approach: it makes it possible to override the value of
> `TeX-insert-braces'.  `TeX-insert-braces' is forced to nil for
> {top,mid,bottom}rule macros.  A FIXME in style/booktabs.el is also
> resolved.

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.

> As a side note, I don't like very much the `last-optional-rejected'
> feature, because there are cases in which the second optional argument
> shouldn't be skipped if the previous one has been rejected.

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'.  (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.)

Bye,
Tassilo

_______________________________________________
auctex-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to