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 10:19:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Héctor Lahoz <hectorlahoz@gmail.com> writes:

> Interesting matter. I have never thought of it
> thoroughly but it seems it is more difficult to
> write a minor mode. Because a minor mode doesn't
> know what other minor modes are in effect when it is
> running (environment).

They typically don't need to care about that because
it isn't that complicated. It is often a small piece
of functionality and the more isolated it can be the
better, and often it isn't difficult to do as it is
completely natural so you don't even think about it.

> Then I have this question. One major mode is
> suitable for a type of data. Everything is text but
> it is formatted differently. Usually in the same
> buffer you have several sections with different
> types. So, for example, you could have some C code,
> then some text and then an ASCII picture. What I do
> is changing the major mode as I edit the different
> sections. Is there some way to tell Emacs what major
> mode should be used for each section so it can
> switch the mode automatically when point enters
> that section?

There are solutions to deal with that but those are
exceptions. You keep the C source and the ASCII
picture apart. This is the same as above. It is sound
preceding. It makes everything more easy,
including Emacs.

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




reply via email to

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