unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to set up a minor mode depending on a major mode?
@ 2009-05-11 11:43 tomas
  2009-05-11 22:13 ` Lennart Borgman
  2009-05-12 10:45 ` [semi-resolved] How to set up a minor mode depending on a major mode? tomas
  0 siblings, 2 replies; 5+ messages in thread
From: tomas @ 2009-05-11 11:43 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, Emacs-folks

I'd like to set up some minor mode whenever a major mode is switched on.
I gather that the recommended method seems to be to hook into the major
mode hook like so:

    (add-hook 'am-mode-hook '(lambda () (visual-line-mode t)))

(i.e. switch visual-line-mode on whenever am-mode-hook is swiitched on).

However, this doesn't work, and I have tracked it back to the standard
major-mode machinery doing a (kill-all-local-variables) sweeping away
whatever tidbits the minor mode needs to survive.

Now I could look into the minor mode and declare every variable needed
by it as 'permanent-local, but that feels quite awkward.

Is there a better way? Am I missing something?

Thanks
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFKCA9VBcgs9XrR2kYRAiSeAJ41OIXJiRMKZa4E4BQQunmomBNbAgCePBJh
vaNli5R14hH4NKStCtxi4KA=
=QoKS
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-12 10:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-11 11:43 How to set up a minor mode depending on a major mode? tomas
2009-05-11 22:13 ` Lennart Borgman
2009-05-12  6:43   ` Tassilo Horn
     [not found]   ` <791153ba0905111408m6d4b36f4hfbf86b6290b9e75c@mail.gmail.com>
2009-05-12  9:11     ` Pilot error [was: How to set up a minor mode depending on a major mode?] tomas
2009-05-12 10:45 ` [semi-resolved] How to set up a minor mode depending on a major mode? tomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).