[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] [hook does not work]
From: |
Tassilo Horn |
Subject: |
Re: [AUCTeX-devel] [hook does not work] |
Date: |
Fri, 25 Jul 2014 19:16:19 +0100 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) |
Uwe Brauer <address@hidden> writes:
Hi Uwe,
> Well well
>
> (add-hook 'LaTeX-mode-hook 'TeX-source-correlate-mode)
>
> This does not work
> ,----
> |
> | `LaTeX-mode-hook' is a variable declared in Lisp.
> | -- loaded from "latex"
> |
> | Value: (preview-mode-setup turn-on-auto-revert-mode
> | turn-on-my-footnote-mode turn-on-flyspell my-install-latex-toolbar
> | my-set-auto-capitalize turn-on-auto-capitalize-mode turn-on-cdlatex
> | my-latex-xsymbol-8bit turn-on-reftex my-LaTeX-TeX-add-symbols
> | TeX-source-correlate-mode my-latex-mode-key)
> |
> | Documentation:
> | A hook run in LaTeX mode buffers.
> `----
>
> But in a Latex buffer I obtain
>
> ,----
> |
> | `TeX-source-correlate-mode' is a variable declared in Lisp.
> | -- loaded from "tex"
> |
> | Value: nil
> |
> | Documentation:
> | Non-nil if Tex-Source-Correlate mode is enabled.
> | See the command `TeX-source-correlate-mode' for a description of this
> minor-mode.
> | Setting this variable directly does not take effect;
> | use either M-? C or the function `TeX-source-correlate-mode'.
> `----
>
> Is this a bug?
I can't reproduce that. With a fresh emacs on a test account with
auctex from ELPA, with no settings in ~/.emacs except for
(add-hook 'LaTeX-mode-hook 'TeX-source-correlate-mode)
emacs foo.tex will activate `TeX-source-correlate-mode', i.e., its value
is t.
Could be a specific of XEmacs maybe?
For (at least recent) Emacs versions, all minor mode obey this calling
convention:
,----
| When called from Lisp, the mode command toggles the mode if the
| argument is `toggle', disables the mode if the argument is a
| non-positive integer, and enables the mode otherwise (including
| if the argument is omitted or nil or a positive integer).
`----
I think with older emacs versions and XEmacs, calling a minor mode
function without argument toggles it. So maybe you have
`TeX-source-correlate-mode' in two hooks that are run for tex files,
e.g., in both `TeX-mode-hook' and `LaTeX-mode-hook', so that the first
toggles it on and the second off again?
Bye,
Tassilo
signature.asc
Description: PGP signature