From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.devel Subject: Re: Performance degradation from long lines Date: Sun, 30 Dec 2018 17:07:17 +1300 Message-ID: <55c0781a-8c15-f0c5-a80b-40e7c37507da@orcon.net.nz> References: <665d5f3d84c071632f87f66ffedb6aed@webmail.orcon.net.nz> <83sh0uqhw8.fsf@gnu.org> <83h8haqd2g.fsf@gnu.org> <1c7973ecaeb4478a81dcf17e9257620c@webmail.orcon.net.nz> <34b92ce4-7b3d-97c7-f59e-e61e9564a7b0@orcon.net.nz> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1546143235 8430 195.159.176.226 (30 Dec 2018 04:13:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Dec 2018 04:13:55 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 Cc: Eli Zaretskii , mithraeum , Stefan Monnier To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 30 05:13:51 2018 Return-path: Envelope-to: ged-emacs-devel@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 1gdSU2-00025S-SH for ged-emacs-devel@m.gmane.org; Sun, 30 Dec 2018 05:13:50 +0100 Original-Received: from localhost ([127.0.0.1]:42731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdSW9-0007qB-Nl for ged-emacs-devel@m.gmane.org; Sat, 29 Dec 2018 23:16:01 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdSTX-0006MS-Fv for emacs-devel@gnu.org; Sat, 29 Dec 2018 23:13:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gdSNy-0006UI-P1 for emacs-devel@gnu.org; Sat, 29 Dec 2018 23:07:35 -0500 Original-Received: from smtp-2.orcon.net.nz ([60.234.4.43]:60945) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gdSNv-000691-5X; Sat, 29 Dec 2018 23:07:31 -0500 Original-Received: from [150.107.172.73] (port=28204 helo=[192.168.20.103]) by smtp-2.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1gdSNi-0003xy-0M; Sun, 30 Dec 2018 17:07:18 +1300 In-Reply-To: Content-Language: en-GB X-GeoIP: NZ X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 60.234.4.43 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232043 Archived-At: so-long.el is once again ready for people to look at. As before, the current code is available at: http://git.savannah.nongnu.org/cgit/so-long.git/plain/so-long.el?h=wip It's become more of a framework for allowing different 'actions' to be defined and employed to mitigate performance issues. Users can choose the action they prefer, and new actions can easily be added, so hopefully any alternative approaches can be easily integrated. Each action comprises two functions (one to enable the behaviour, and one to revert it), and all actions are available via the new menu. The default actions are still: - Change major mode to so-long-mode (default) - Disable minor modes and override variables - Enable longlines-mode The system is now more general and extensible though, and the actions are now more apparent for the end user. The automated behaviour is still performed only during `set-auto-mode', so I'm not dealing with cases other than visiting files; but in principle I think one could write code to detect the introduction of long lines in more dynamic situations and invoke one of the so-long actions in response, so that could be considered in future. I've tested this in 27, 26.1, and 25.3. The changes to `normal-mode' in 26.1 wrt when local variables are processed means that 26+ can use local variables to affect the so-long behaviour whereas earlier versions cannot; but the bulk of the features work in 25.3. The original library worked in 24.3 (which is still set as the minimum version), but I find I am unable to build Emacs 24 on my current system, so that is untested. There are no automated tests, and I don't have experience in writing those, so if anyone was willing to assist on that front, that would be fantastic. Per previous discussions, my expectation is that we'll add this to Emacs 27, and build the GNU ELPA package for older Emacsen from that. The following changelog summaries the recent work towards version 1.0 (which is what I'll release this as): - New user option `so-long-action'. - New user option `so-long-action-alist' defining alternative actions. - New user option `so-long-variable-overrides'. - New user option `so-long-skip-leading-comments'. - New user option `so-long-file-local-mode-function'. - New user option `so-long-predicate'. - New variable and function `so-long-function'. - New variable and function `so-long-revert-function'. - New command `so-long' to invoke `so-long-function' interactively. - New command `so-long-revert' to invoke `so-long-revert-function'. - Support retaining the original major mode while still disabling minor modes and overriding variables. - Support `longlines-mode' as a `so-long-action' option. - Added "So Long" menu, including all selectable actions. - Added mode-line indicator, user option `so-long-mode-line-label', and faces `so-long-mode-line-active', `so-long-mode-line-inactive'. - Renamed `so-long-mode-enabled' to `so-long-enabled'. - Refactored the default hook values using variable overrides (and returning all the hooks to nil default values). - Performance improvements for `so-long-detected-long-line-p'. -Phil