all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.