GNU bug report logs -
#24412
11.89; Wrong DocTeX-mode
Previous Next
Reported by: Piet van Oostrum <piet <at> vanoostrum.org>
Date: Sun, 11 Sep 2016 16:28:01 UTC
Severity: normal
Found in version 11.89
Done: Arash Esbati <arash <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 24412 <at> debbugs.gnu.org (full text, mbox):
David Kastrup wrote:
> Piet van Oostrum <piet <at> vanoostrum.org> 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 <piet <at> vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
This bug report was last modified 2 years and 361 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.