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 23:46:38 +1300 Message-ID: <8e8efdd6-7dd8-c0f8-b2c1-ed94f34af4e6@orcon.net.nz> References: <06b2b38e-1d44-5a7e-b1c0-aac489989fde@orcon.net.nz> 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="13872"; 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 Wed Dec 09 11:48:14 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 1kmx13-0003WD-VV for ged-emacs-devel@m.gmane-mx.org; Wed, 09 Dec 2020 11:48:13 +0100 Original-Received: from localhost ([::1]:60372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmx12-00037J-V3 for ged-emacs-devel@m.gmane-mx.org; Wed, 09 Dec 2020 05:48:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmwzc-0002H1-C1 for emacs-devel@gnu.org; Wed, 09 Dec 2020 05:46:47 -0500 Original-Received: from smtp-4.orcon.net.nz ([60.234.4.59]:44875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmwza-0001x8-Q6; Wed, 09 Dec 2020 05:46:44 -0500 Original-Received: from [101.53.216.160] (port=44207 helo=[192.168.20.103]) by smtp-4.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1kmwzW-0001YI-Mi; Wed, 09 Dec 2020 23:46:38 +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:260604 Archived-At: On 9/12/20 7:48 pm, Richard Stallman wrote: > > 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. > > How about if you try activating for all except special > modes? It MIGHT turn out to be exactly right. And if > not, you can override as needed. I don't have the broad knowledge of major modes necessary to say whether your idea would be right in all cases. I think that it would increase the number of major modes being considered by a significant margin, though, so to me it sounds risky, but I'd welcome additional input from anyone who feels confident on the matter. It's certainly broadening the scope of the library, which was originally written to mitigate issues with files of 'minified' programming code and data formats (being a somewhat common situation in which implicit assumptions made by modes about a buffer's contents could end up being badly incorrect). If the rule isn't correct in all cases, then I'm firmly against the notion of maintaining a manual list of exceptions. If we don't have a reliable rule, I would greatly prefer that we err on the side of caution, and only trigger so-long in situations where we are confident that we will not be causing worse problems than the one we're trying to solve. If anyone would like to experiment with the idea, though, you can do that by setting `so-long-target-modes' to `t', and then writing a custom `so-long-predicate' function. -Phil