GNU bug report logs - #24412
11.89; Wrong DocTeX-mode

Previous Next

Package: auctex;

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 #8 received at 24412 <at> debbugs.gnu.org (full text, mbox):

From: David Kastrup <dak <at> gnu.org>
To: Piet van Oostrum <piet <at> vanoostrum.org>
Cc: 24412 <at> debbugs.gnu.org
Subject: Re: bug#24412: 11.89; Wrong DocTeX-mode
Date: Sun, 11 Sep 2016 22:26:16 +0200
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.

> 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?

-- 
David Kastrup




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.