bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57741: latex-mode still loads buffer with LaTeX-mode


From: Arash Esbati
Subject: bug#57741: latex-mode still loads buffer with LaTeX-mode
Date: Mon, 12 Sep 2022 16:56:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

uzibalqa via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 
<bug-gnu-emacs@gnu.org> writes:

> Even after removing auctex using "M-x package-delete" changing the
> buffer with "M-x latex-mode", loads the buffer with "LaTeX-mode".

When I do 'emacs -Q' (which means Emacs doesn't load AUCTeX with my
config) and find this .tex file:

\documentclass{article}

\begin{document}
Hello world.
\end{document}

%%% Local Variables:
%%% mode: latex
%%% End:

'C-h m' says:

    The major mode is LaTeX mode defined in tex-mode.el:

    Major mode for editing files of input for LaTeX.
    Makes $ and } display the characters they match.
    Makes " insert `` when it seems to be the beginning of a quotation,
    and '' when it appears to be the end; it inserts " only after a \.

tex-mode.el has this:

    (define-derived-mode latex-mode tex-mode "LaTeX"
      "Major mode for editing files of input for LaTeX.
    [...]

'C-h f define-derived-mode RET' says:

    define-derived-mode is an autoloaded Lisp macro in ‘derived.el’.

    (define-derived-mode CHILD PARENT NAME [DOCSTRING] [KEYWORD-ARGS...]
    &rest BODY)

    Create a new mode CHILD which is a variant of an existing mode PARENT.

    The arguments are as follows:

    CHILD:     the name of the command for the derived mode.
    PARENT:    the name of the command for the parent mode (e.g. ‘text-mode’)
               or nil if there is no parent.
    NAME:      a string that will appear in the mode line (e.g. "HTML")
    [...]

Opening the same file with AUCTeX enabled and hitting 'C-h m says:

    The major mode is LaTeX mode defined in tex-mode.el:

    Major mode for editing files of input for LaTeX.
    Makes $ and } display the characters they match.
    [...]
    This function has :override advice: ‘TeX-latex-mode’.

So don't get confused by the camel-case LaTeX in the mode line; you're
using the stock latex-mode (unless you have another AUCTeX installation
on your disk which is loaded).

Best, Arash





reply via email to

[Prev in Thread] Current Thread [Next in Thread]