auctex-devel
[Top][All Lists]
Advanced

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

Re: Possible defect in TeX-complete-make-expert-command-functions


From: Tassilo Horn
Subject: Re: Possible defect in TeX-complete-make-expert-command-functions
Date: Tue, 21 Dec 2021 21:26:45 +0100
User-agent: mu4e 1.7.5; emacs 29.0.50

Ikumi Keita <ikumi@ikumi.que.jp> writes:

> We have currently the following code in tex.el:
> ----------------------------------------------------------------------
> (defmacro TeX-complete-make-expert-command-functions (thing list-var prefix)
> [...]
>            (if (null style)
>                (remhash x TeX-expert-macro-table)
>                           ^^^^^^^^^^^^^^^^^^^^^^
>              (puthash x style TeX-expert-macro-table))))
>                               ^^^^^^^^^^^^^^^^^^^^^^
> [...]
>                     (let* ((cmd (car entry))
>                            (style (gethash cmd TeX-expert-macro-table)))
>                                                ^^^^^^^^^^^^^^^^^^^^^^
> [...]
>
> (TeX-complete-make-expert-command-functions "macro" TeX-symbol-list "TeX")
> (TeX-complete-make-expert-command-functions "environment" 
> LaTeX-environment-list "LaTeX")
> ----------------------------------------------------------------------
> This code registers both expert macros and expert environments in a
> common variable `TeX-expert-macro-table'. And
> `LaTeX-expert-environment-filtered' refers to that variable to determine
> whether the given environment is expert or not. The variable
> `LaTeX-expert-environment-table', of which defvar is generated by
> omitted portion of this elisp macro, is never used.
>
> Tassilo, is this the intended behavior? Am I missing something?

No, I guess that's not how it is supposed to be but a leftover when I
turned the hard-coded macro version to macros & environments.  The
functions the macro generates must refer to the *-table variable they
defined with this macro call and nothing else, so all
TeX-expert-macro-table occurrences there should actually be
,(intern (format "%s-expert-%s-table" prefix thing)).

I'm also not sure if we might not want to remove that feature.  AFAIK,
there has never been any serious attempt to classify the macros &
environments provided by our styles.  There are just 6 styles using
`TeX-declare-expert-macros' and one single style using
`LaTeX-declare-expert-environments'.

Bye,
Tassilo



reply via email to

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