Function: so-long-mode

so-long-mode is an autoloaded, interactive and byte-compiled function defined in so-long.el.gz.

Signature

(so-long-mode)

Documentation

This major mode is the default so-long-action option.

The normal reason for this mode being active is that global-so-long-mode(var)/global-so-long-mode(fun) is enabled, and so-long-predicate has detected that the file contains 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). These kinds of files are typically not intended to be edited, so not providing the usual editing mode in these cases will rarely be an issue.

This major mode disables any active minor modes listed in so-long-minor-modes for the current buffer, and buffer-local values are assigned to variables in accordance with so-long-variable-overrides.

To restore the original major mode (along with the minor modes and variable values), despite potential performance issues, type M-x so-long-revert (so-long-revert).

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 mode runs the hook so-long-mode-hook, as the final or penultimate step during initialization.

This function has :before advice: so-long--change-major-mode.

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-derived-mode so-long-mode nil
  (propertize "So Long" 'face 'so-long-mode-line-active)
  "This major mode is the default `so-long-action' option.

The normal reason for this mode being active is that `global-so-long-mode' is
enabled, and `so-long-predicate' has detected that the file contains 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).  These kinds of files are
typically not intended to be edited, so not providing the usual editing mode
in these cases will rarely be an issue.

This major mode disables any active minor modes listed in `so-long-minor-modes'
for the current buffer, and buffer-local values are assigned to variables in
accordance with `so-long-variable-overrides'.

To restore the original major mode (along with the minor modes and variable
values), despite potential performance issues, type \\[so-long-revert].

Use \\[so-long-commentary] for more information.

Use \\[so-long-customize] to open the customization group `so-long' to
configure the behavior."
  ;; Housekeeping.  `so-long-mode' might be invoked directly rather than via
  ;; `so-long', so replicate the necessary behaviors.  We could use this same
  ;; test in `so-long-after-change-major-mode' to run `so-long-hook', but that's
  ;; not so obviously the right thing to do, so I've omitted it for now.
  (unless so-long--calling
    (so-long--ensure-enabled)
    (setq so-long--active t
          so-long-detected-p t
          so-long-function #'so-long-mode
          so-long-revert-function #'so-long-mode-revert))
  ;; Use `after-change-major-mode-hook' to disable minor modes and override
  ;; variables.  Append, to act after any globalized modes have acted.
  (add-hook 'after-change-major-mode-hook
            #'so-long-after-change-major-mode :append :local)
  ;; Override variables.  This is the first of two instances where we do this
  ;; (the other being `so-long-after-change-major-mode').  It is desirable to
  ;; set variables here in order to cover cases where the setting of a variable
  ;; influences how a global minor mode behaves in this buffer.
  (so-long-override-variables)
  ;; Hide redundant mode-line information (our major mode info replicates this).
  (setq so-long-mode-line-info nil)
  ;; Inform the user about our major mode hijacking.
  (unless (or so-long--inhibited so-long--set-auto-mode)
    (message (concat "Changed to %s (from %s)"
                     (unless (or (eq this-command 'so-long)
                                 (and (symbolp this-command)
                                      (provided-mode-derived-p this-command
                                                               'so-long-mode)))
                       " on account of line length")
                     ".  %s to revert.")
             major-mode
             (or (so-long-original 'major-mode) "<unknown>")
             (substitute-command-keys "\\[so-long-revert]"))))