1

Does Emacs have some notion of associating minor modes with windows rather than setting them as "global" or "buffer-local"?

For example, in a certain window layout I may wish to have a minor mode associated with a particular window regardless of the buffer currently shown in that window.

  • It might help to describe the use case a bit more. You never know - you might think that such an association is what you need, but someone might have another suggestion, if you made clear what the ultimate goal is. Just a suggestion. – Drew Dec 28 '15 at 21:58
  • @Drew It's just a conceptual Emacs question (a curiosity) at the moment – ebpa Dec 29 '15 at 4:11
4

Not as such. Even 'global' minor modes are generally just buffer-local minor modes which are enabled or disabled for multiple buffers en masse.

However there's nothing to stop you writing a global mode (or hook function, or whatever approach makes the most sense) which is ostensibly active everywhere, but which checks the window of the current buffer, and only actually does something if that window is the one you're interested in. Or you might determine the buffer currently displayed in the window you're interested in, and do things with that.

That will work nicely for some kinds of behaviours, and be very difficult for others, so it really depends on what you're hoping to achieve.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.