auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] [define-minor-mode] (was: [hook does not work])


From: Uwe Brauer
Subject: [AUCTeX-devel] [define-minor-mode] (was: [hook does not work])
Date: Sun, 27 Jul 2014 18:49:47 +0200
User-agent: Gnus/5.13001 (Ma Gnus v0.10) XEmacs/21.5-b33 (linux)

>> "Tassilo" == Tassilo Horn <address@hidden> writes:

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


I did the same as you did for emacs, and indeed it is different 
TeX-source-correlate-mode is nil!


I now that 
`define-minor-mode' always was sort of problematic in Xemacs, for
example I almost never got an entry in the modline, although the mode
was on.
That is  why I CC to Xemcas-beta.

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

No, this is not the case and as I said I did what you to, 
xemacs -q evaluate the line with the hook and the mode is *not* turned
on.

Uwe 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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