From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.devel Subject: Re: so-long and special major modes Date: Wed, 9 Dec 2020 09:08:45 +1300 Message-ID: <06b2b38e-1d44-5a7e-b1c0-aac489989fde@orcon.net.nz> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7833"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 08 22:29:59 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmkYZ-0001wp-1S for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Dec 2020 22:29:59 +0100 Original-Received: from localhost ([::1]:53362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmkYY-0005ek-0j for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Dec 2020 16:29:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmjIA-0007IO-MR for emacs-devel@gnu.org; Tue, 08 Dec 2020 15:09:00 -0500 Original-Received: from smtp-4.orcon.net.nz ([60.234.4.59]:35549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmjI8-0007Z3-5B; Tue, 08 Dec 2020 15:08:57 -0500 Original-Received: from [101.53.216.160] (port=36643 helo=[192.168.20.103]) by smtp-4.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1kmjHy-0005iW-40; Wed, 09 Dec 2020 09:08:46 +1300 In-Reply-To: Content-Language: en-GB X-GeoIP: NZ Received-SPF: pass client-ip=60.234.4.59; envelope-from=psainty@orcon.net.nz; helo=smtp-4.orcon.net.nz X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:260581 Archived-At: On 8/12/20 6:30 pm, Richard Stallman wrote: > Emacs distinguishes two kinds of major modes: those that are for a > kind of data, and those that correspond to special applications. In > the former, q will self-insert. In the latter, q probably means > "quit". The way to distinguish is to test the mode-class property of > the major mode symbol. > > Dired, Rmail and Info are examples of special major modes. > > so-long-major-mode may be ok to use in an ordinary major mode, but it > is no good in a special mode. In that situation, it is necessary to > use so-long-minor-mode. In general I felt it was necessary to white-list the modes for which it is acceptable for so-long to take action, because I don't think it's possible to automatically detect every mode in which it might be problematic. The `so-long-target-modes' variable serves this purpose -- the automated behaviour only kicks in for buffers using a major mode (or derivative thereof) from this list. That's (prog-mode css-mode sgml-mode nxml-mode) by default. -Phil