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 03:54:53 +0200 Message-ID: <86k24f5o5u.fsf@zoho.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1497405343 12852 195.159.176.226 (14 Jun 2017 01:55:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Jun 2017 01:55:43 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (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 03:55:36 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 1dKxWx-0002s6-Qn for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jun 2017 03:55:35 +0200 Original-Received: from localhost ([::1]:46000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKxX3-0000fs-1C for geh-help-gnu-emacs@m.gmane.org; Tue, 13 Jun 2017 21:55:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKxWZ-0000dL-K3 for help-gnu-emacs@gnu.org; Tue, 13 Jun 2017 21:55:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKxWV-0004YL-Ji for help-gnu-emacs@gnu.org; Tue, 13 Jun 2017 21:55:11 -0400 Original-Received: from [195.159.176.226] (port=48318 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dKxWV-0004Wx-Cv for help-gnu-emacs@gnu.org; Tue, 13 Jun 2017 21:55:07 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dKxWJ-0000k1-9K for help-gnu-emacs@gnu.org; Wed, 14 Jun 2017 03:54:55 +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:YZjBTPuNVcNXPE3NLMjsI5alJ40= 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:113440 Archived-At: 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