Hi Keita,

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

>>>>>> Arash Esbati <ar...@gnu.org> writes:
>> My only concern is why AUCTeX should recommend users to pass other
>> package names to `use-package' instead of auctex which can be confusing?
>> So things like
>
>>   (use-package auctex
>>     :config
>>     (require 'tex))
>
>> would also work, right?

Great, so let us advertise this kind of usage if needed.

>> Does this form work at all?  I tried that in my init file, restarted
>> Emacs, opened a .tex file and get:
>
>>   File mode specification error: (void-function LaTeX-mode)
>
> Indeed. I suppose that loading in
> ,----
> | (unless (or (fboundp 'TeX-modes-set)     ;Avoid inf-looping.
> | ...
> |   (load "auctex-autoloads" 'noerror 'nomessage))
> `----
> fails due to lack of arrangement of `load-path', without emitting error
> by 'noerror argument.

Ah, thanks, I missed that bit.  I think now I see why the setup
described by Colin works as expected.

> Then I can't think of cases where
>     (require 'tex-site (expand-file-name "tex-site.el"
>                         (file-name-directory load-file-name))
> is useful. Do you have any?

For me to recap, I see these use cases:

1.) Users install AUCTeX from ELPA:

    They don't have to do anything and can start using AUCTeX with:
    (use-package auctex ...)

2.) Users load AUCTeX from a local repo:

    They have to run make and then (let's skip the Info part for now):

    2a.)  Either use this in their init file:

          (use-package auctex
          :init
          (load "~/path/to/auctex/auctex-autoloads.el" nil t t))

    2b.)  or do:

          (use-package auctex
          :init
          (add-to-list 'load-path "~/path/to/auctex" t)
          (load "auctex.el" nil t t))

IIUC in 1.) and 2a.) the file auctex.el is more or less no-op, only in
2b.) it actually loads tex-site.el which then loads auctex-autoloads.el.

I briefly tested 2b.) by changing auctex.el with the code above, started
'emacs -Q', eval'ed the `use-package' form and opened a .tex file, it
seems to work and this is what I see in the `load-history':

--8<---------------cut here---------------start------------->8---
 ("~/path/to/auctex/auctex.el" (require . tex-site)
  (provide . auctex))
 ("~/path/to/auctex/tex-site.el" (provide . tex-site)
  TeX-lisp-directory TeX-data-directory TeX-auto-global TeX-mode-alist
  (defun . TeX-load-hack) (defun . tex-site-unload-function)
  (defun . TeX-modes-set) TeX-modes
  (defun . TeX--alias-overlapped-modes) AUCTeX-version AUCTeX-date
  preview-TeX-style-dir (provide . tex-site))
 ("~/path/to/auctex/auctex-autoloads.el"
  (defun . bib-cite-minor-mode) (defun . turn-on-bib-cite)
  (defun . context-mode) (defun . ConTeXt-mode)
  (defun . font-latex-setup) (defun . BibTeX-auto-store)
  (defun . LaTeX-mode) (defun . LaTeX-mode) (defun . docTeX-mode)
  (defun . multi-prompt) (defun . multi-prompt-key-value)
  (defun . plain-TeX-mode) (defun . plain-TeX-mode)
  (defun . AmSTeX-mode) (defun . ams-tex-mode)
  (defun . desktop-buffer-preview) (defun . preview-install-styles)
  (defun . LaTeX-preview-setup) (defun . preview-report-bug)
  (defun . TeX-tex-mode) (defun . TeX-mode)
  (defun . TeX-auto-generate) (defun . TeX-auto-generate-global)
  (defun . TeX-submit-bug-report) (defun . TeX-install-toolbar)
  (defun . LaTeX-install-toolbar) (defun . TeX-fold-mode)
  (defun . tex-fold-mode) (defun . tex-font-setup)
  (defun . Texinfo-mode) (defun . japanese-plain-TeX-mode)
  (defun . japanese-plain-tex-mode) (defun . japanese-LaTeX-mode)
  (defun . japanese-latex-mode) (require . tex-site)
  (defun . texmathp) (defun . texmathp-match-switch)
  (defun . toolbarx-install-toolbar) (provide . auctex-autoloads))
--8<---------------cut here---------------end--------------->8---

Best, Arash

Reply via email to