[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24412: 11.89; Wrong DocTeX-mode
From: |
Piet van Oostrum |
Subject: |
bug#24412: 11.89; Wrong DocTeX-mode |
Date: |
Mon, 12 Sep 2016 08:09:30 +0200 |
David Kastrup wrote:
> Piet van Oostrum <address@hidden> writes:
>
> > In AucTeX, latex.el (line 5871) contains:
> >
> > (add-to-list 'auto-mode-alist '("\\.dtx\\'" . doctex-mode))
> >
> > However, AUCTeX's doctex mode is called docTeX-mode. So the line above
> > causes the standard Emacs doctex-mode to be invoked, rather than AUCTeX's
> > docTeX-mode. This is undesirable.
> >
> > The line should be:
> >
> > (add-to-list 'auto-mode-alist '("\\.dtx\\'" . docTeX-mode))
>
> Why? It doesn't change the other modes either. The point is that they
> are mapped to the AUCTeX modes on-demand, see
>
>
> TeX-modes is a variable defined in ‘tex-site.el’.
> Its value is
> (tex-mode plain-tex-mode texinfo-mode latex-mode doctex-mode)
>
> Documentation:
> List of modes provided by AUCTeX.
>
> This variable can’t be set normally; use customize for that, or
> set it with ‘TeX-modes-set’.
>
> You can customize this variable.
Oops! That's tricky.
>
> > There is another thing. The documentation of docTeX-mode says:
> >
> > "Major mode in AUCTeX for editing .dtx files derived from `LaTeX-mode'.
> > Runs `LaTeX-mode', sets a few variables and
> > runs the hooks in `docTeX-mode-hook'."
> >
> > However, docTeX-mode-hook is never run.
>
> That's a possible bug. Let me see.
>
> docTeX-mode is defined with
>
> (define-derived-mode docTeX-mode TeX-latex-mode "docTeX"
> ...
>
> in latex.el. The documentation of define-derived-mode states:
>
> The new mode runs the hook constructed by the function
> ‘derived-mode-hook-name’.
>
> which is defined as
>
> (defsubst derived-mode-hook-name (mode)
> "Construct a mode-hook name based on a MODE name."
> (intern (concat (symbol-name mode) "-hook")))
>
> Which very much looks like it should do the job. Do you have actual
> evidence that it doesn't?
I had put something in docTeX-mode-hook, and I didn't see much evidence of it
happening. There was an error in it, but I did not get an error message.
However, now you told me this, I looked in *Messages* and I saw the message
there. So it seems to work.
Thanks for updating me. You are never too old to learn something new.
>
> --
> David Kastrup
--
Piet van Oostrum <address@hidden>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]