Hi all,
I've now implemented a better approach. Style file authors can now mark
macros and environments as expert commands using
(TeX-declare-expert-macros
'("command1" . "mystyle")
'("command2" . "mystyle")
...)
(LaTeX-declare-expert-environments
'("env1" . "mystyle")
'("env1" . "mystyle")
...)
Users can control if they want the completion to include expert
macros/envs with `TeX-complete-expert-commands' which can be nil
(default), t, or a list of package names whose expert macros/envs should
be complete.
Expert commands are stored in hash-tables
TeX-expert-macro-table
LaTeX-expert-environment-table
and the functions
TeX-symbol-list-filtered
LaTeX-environment-list-filtered
filter their un"-filtered" counterparts by what's defined by
`TeX-complete-expert-commands'. The completion functions now usually
use the *-filtered functions except for `TeX-arg-macro',
`TeX-arg-define-macro', `TeX-arg-environment', and
`TeX-arg-define-environment', because AFAICS those are mostly used for
stuff like \renewcommand etc., and there I think it's more appropriate
to complete everything...
Even if \foobar was declared an expert command and a user doesn't
include those in completion, C-c RET foobar RET will still use the
argument completion as declared by (TeX-add-symbols '("foobar" ...)).
The only thing that I haven't managed to implement until now is a way to
_temporary_ enable expert commands for one single completion, because
prefix args are already used differently by `TeX-insert-macro' and
`LaTeX-environment'.
Bye,
Tassilo
_______________________________________________
auctex-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex-devel