Function: global-so-long-mode
global-so-long-mode is an autoloaded, interactive and byte-compiled
function defined in so-long.el.gz.
Signature
(global-so-long-mode &optional ARG)
Documentation
Toggle automated performance mitigations for files with long lines.
Many Emacs modes struggle with buffers which contain excessively long lines, and may consequently cause unacceptable performance issues.
This is commonly on account of "minified" code (i.e. code that has been compacted into the smallest file size possible, which often entails removing newlines should they not be strictly necessary).
When such files are detected by so-long-predicate, we invoke the selected
so-long-action to mitigate potential performance problems in the buffer.
Use M-x so-long-commentary (so-long-commentary) for more information.
Use M-x so-long-customize (so-long-customize) to open the customization group so-long to
configure the behavior.
This is a global minor mode. If called interactively, toggle the
Global So-Long mode mode. If the prefix argument is positive, enable
the mode, and if it is zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the mode
if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate (default-value \=global-so-long-mode)'.
The mode's hook is called both when the mode is enabled and when it is disabled.
Probably introduced at or before Emacs version 27.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/so-long.el.gz
;;;###autoload
(define-minor-mode global-so-long-mode
"Toggle automated performance mitigations for files with long lines.
Many Emacs modes struggle with buffers which contain excessively long lines,
and may consequently cause unacceptable performance issues.
This is commonly on account of \"minified\" code (i.e. code that has been
compacted into the smallest file size possible, which often entails removing
newlines should they not be strictly necessary).
When such files are detected by `so-long-predicate', we invoke the selected
`so-long-action' to mitigate potential performance problems in the buffer.
Use \\[so-long-commentary] for more information.
Use \\[so-long-customize] to open the customization group `so-long' to
configure the behavior."
:global t
(if global-so-long-mode
;; Enable
(progn
(so-long--enable)
(advice-add 'hack-local-variables :around
#'so-long--hack-local-variables)
(advice-add 'set-auto-mode :around
#'so-long--set-auto-mode)
(when (< emacs-major-version 26)
(advice-add 'hack-one-local-variable :around
#'so-long--hack-one-local-variable)))
;; Disable
(so-long--disable)
(advice-remove 'hack-local-variables #'so-long--hack-local-variables)
(advice-remove 'set-auto-mode #'so-long--set-auto-mode)
(when (< emacs-major-version 26)
(advice-remove 'hack-one-local-variable
#'so-long--hack-one-local-variable))))