Ikumi Keita <[email protected]> writes:

Hi Keita,

> I wrote the relevant portion of tex-site.el.in assuming that various
> autoloads in tex-site.el, including the one for `LaTeX-mode', _follows_
> the parts generated from tex-site.el.in. This holds for configure-make
> installation scheme. However, it seems that the order is reversed in
> ELPA installation scheme; In ELPA installation,
> [1] tex-site.el contains no autoload declarations; there are only parts
>     generated from tex-site.el.in.
> [2] auctex-autoloads.el, which doesn't exist in configure-make
>     installation, contains
> ----------------------------------------------------------------------
> ;;; Generated autoloads from tex-site.el
>
>  (require 'tex-site)
> ----------------------------------------------------------------------
>     _after_ the autoload declaration of `LaTeX-mode'.
>
> I assumed that the following code in tex-site.el(.in) runs _before_
> AUCTeX autoload declaration for LaTeX-mode in order to eliminate the
> alias predefined by tex-mode.el:
> ----------------------------------------------------------------------
> ;; Delete aliases predefined in tex-mode.el so that AUCTeX
> ;; autoloads provided below take precedence.
> (TeX--alias-overlapped-modes)
> ----------------------------------------------------------------------
> In ELPA installation, the autoload for LaTeX-mode provided by AUCTeX goes
> without this elimination and have no effect because elisp function
> `autoload' doesn't overwrite existing alias. In addition, in the
> subsequent loading of tex-site.el, the above code eliminates that
> alias, hence leading to (void-function LaTeX-mode) when opening a
> LaTeX file.
>
> When I moved
> ----------------------------------------------------------------------
> ;;; Generated autoloads from tex-site.el
>
>  (require 'tex-site)
> ----------------------------------------------------------------------
> to the early stage in auctex-autoloads.el and restarted emacs session,
> everything works fine. Thus I think that my above consideration is
> right.
>
> Is there any simple way in ELPA installation scheme to sort out the
> order of autoload declaration and (require 'tex-site)?

Too bad.  It seems the autoloads are simply appended in alphabetical
order of filenames so tex-site comes pretty late...

I checked the ELPA README.  It is possible to run a shell command to
build the package (in addition or instead (?) of "make").  So maybe we
can temporarily fix it by adding a shell command that prepends

  (require 'tex-site)

to auctex-autoloads.el?

Bye,
Tassilo

Reply via email to