From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Major and minor modes Date: Wed, 14 Jun 2017 10:19:01 +0200 Message-ID: <874lvj56dm.fsf@debian.uxu> References: <86k24f5o5u.fsf@zoho.com> <20170614074003.GA2968@workstation> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1497428470 17838 195.159.176.226 (14 Jun 2017 08:21:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Jun 2017 08:21:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 14 10:21:04 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dL3Y0-0004IU-6c for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jun 2017 10:21:04 +0200 Original-Received: from localhost ([::1]:47095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dL3Y5-0008Dy-Am for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jun 2017 04:21:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dL3XD-0008CQ-FB for help-gnu-emacs@gnu.org; Wed, 14 Jun 2017 04:20:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dL3X8-0000Vm-Ia for help-gnu-emacs@gnu.org; Wed, 14 Jun 2017 04:20:15 -0400 Original-Received: from [195.159.176.226] (port=44981 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dL3X8-0000VJ-CY for help-gnu-emacs@gnu.org; Wed, 14 Jun 2017 04:20:10 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dL3X1-00019w-FY for help-gnu-emacs@gnu.org; Wed, 14 Jun 2017 10:20:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 35 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:1yyEj+9nvPlY6i02ry7FtcbXn+w= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113447 Archived-At: Héctor Lahoz 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