help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Major and minor modes


From: Emanuel Berg
Subject: Re: Major and minor modes
Date: Wed, 14 Jun 2017 03:54:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

M.R.P. wrote:

> Can anyone explain to me clearly how Major
> modes and minor modes work together. Can any
> minor mode work within any major mode?

In general, the major mode is the big frame
and there is one and only one major mode to
help you edit the text in the buffer. So for C,
it is C/l defined in cc-mode.el, and so on.

The minor mode is a small piece of
functionality, like Line-Number to have the
current line shown in the mode bar. It is
a good thing it can be used in all but whatever
major mode so it doesn't have to be duplicated.

In principle I suppose you can have as many
minor modes as you want for any major mode but
it isn't difficult to predict a scenario where
the minor modes contradict each other and/or
work in opposite ways to what makes sense for
the underlying major mode.

I never heard of anyone putting up fences in
their code to prevent that, and it is a good
thing they didn't as that would make all code
interdependent and besides people aren't that
stupid to setup a system that doesn't make
sense anyway. And if they are, let's go
nuts already.

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

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