emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Performance degradation from long lines


From: Phil Sainty
Subject: Re: Performance degradation from long lines
Date: Sun, 30 Dec 2018 17:07:17 +1300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]