[Top][All Lists]

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

Environment optional argument defect

From: Ikumi Keita
Subject: Environment optional argument defect
Date: Thu, 24 Nov 2022 02:14:59 +0900

Hi all,

Thanks to Arash's enthusiastic effort, input support for environment
arguments is rapidly getting improved. I'd like to take this opportunity
to discuss a defect of key bind of AUCTeX under specific situation and
how to resolve it.

A lot of environments in AUCTeX use `LaTeX-env-args' to support argument
completion. Suppose that there is an entry which contains an element for
an optional argument like this:
        '("foo" LaTeX-env-args ... [ SOME-FUNCTION-OR-STRING ] ...)
In this case, C-c C-e foo RET doesn't provide input support for the
element if the user customizes the AUCTeX option
`TeX-insert-macro-default-style' to `mandatory-args-only'. It is
impossible to toggle the behavior by C-u because C-c C-e
(`LaTeX-environment'), unlike C-c C-m (`TeX-insert-macro'), eats up C-u
for switching to `LaTeX-modify-environment'.

I hope there is clean solution for this conflict. A naive idea is to
assign a new key sequence to `LaTeX-modify-environment' and arrange
`LaTeX-environment' so that prefix argument survives into
`LaTeX-environment-menu'. But this change might not be welcomed by
majority of AUCTeX users.

(We read
|   ;; When called with a prefix (C-u), only ask for mandatory arguments,
|   ;; i.e. all optional arguments are skipped.  See `TeX-parse-arguments' for
|   ;; details.  Note that this behavior may be changed in favor of a more
|   ;; flexible solution in the future, therefore we don't document it at the
|   ;; moment.
in the defun of `TeX-insert-macro'. Maybe now is the "future" mentioned

Does anyone come up with good ideas?

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine

reply via email to

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