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: Tassilo Horn
Subject: Re: [AUCTeX-devel] Insertion of braces when the last argument of a macro is optional
Date: Mon, 30 Sep 2013 13:05:55 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

David Kastrup <address@hidden> writes:

>> 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.
>
> The right way to do that kind of unconditional restore is using
> unwind-protect for it.

Ah, indeed.

> But wouldn't using let on TeX-insert-braces achieve just that?

Yes, if we had an alist of macros that must always/never have braces
appended, then we could let-bind TeX-insert-braces in `TeX-parse-macro'
taking that alist and `TeX-insert-braces's default value into account
and be done.

Bye,
Tassilo



reply via email to

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