diff options
author | Phil Sainty <psainty@orcon.net.nz> | 2021-01-10 14:43:16 +1300 |
---|---|---|
committer | Phil Sainty <psainty@orcon.net.nz> | 2021-03-21 16:02:42 +1300 |
commit | 8b5667fb7f8a2955d1972390c25c7cdc41432ed1 (patch) | |
tree | 0586ea3497cb70f500485ee04466f750fe9e940a | |
parent | 99dd12130e695c1e2444e6322c73cb8a2e3632f3 (diff) | |
download | emacs-8b5667fb7f8a2955d1972390c25c7cdc41432ed1.tar.gz |
Make `global-so-long-mode' handle unrecognised file types
* lisp/so-long.el (so-long-target-modes): Add `fundamental-mode'
* etc/NEWS: Describe changes.
This doesn't affect buffers which are simply in `fundamental-mode' by
default. It only affects buffers for which `set-auto-mode' has been
called (normally via `find-file') without establishing a different
major mode.
-rw-r--r-- | etc/NEWS | 7 | ||||
-rw-r--r-- | lisp/so-long.el | 8 |
2 files changed, 13 insertions, 2 deletions
@@ -2239,6 +2239,13 @@ defines an additional key to exit mode like 'isearch-exit' ('RET'). 10000 characters and 500 lines respectively, to reduce the likelihood of false-positives when 'global-so-long-mode' is enabled. +--- +*** 'so-long-target-modes' now includes 'fundamental-mode' by default, +meaning that 'global-so-long-mode' will also process files which were +not recognised. (This only has an effect if 'set-auto-mode' chooses +'fundamental-mode'; buffers which are simply in 'fundamental-mode' by +default are unaffected.) + * New Modes and Packages in Emacs 28.1 diff --git a/lisp/so-long.el b/lisp/so-long.el index a70b37ad15d..0f8b8dc93a3 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -393,6 +393,7 @@ ;; ;; 1.1 - Increase `so-long-threshold' from 250 to 10,000. ;; - Increase `so-long-max-lines' from 5 to 500. +;; - Include `fundamental-mode' in `so-long-target-modes'. ;; 1.0 - Included in Emacs 27.1, and in GNU ELPA for prior versions of Emacs. ;; - New global mode `global-so-long-mode' to enable/disable the library. ;; - New user option `so-long-action'. @@ -525,7 +526,7 @@ See `so-long-detected-long-line-p' for details." :package-version '(so-long . "1.0")) (defcustom so-long-target-modes - '(prog-mode css-mode sgml-mode nxml-mode) + '(prog-mode css-mode sgml-mode nxml-mode fundamental-mode) "`so-long' affects only these modes and their derivatives. Our primary use-case is minified programming code, so `prog-mode' covers @@ -538,7 +539,7 @@ files would prevent Emacs from handling them correctly." ;; Use 'symbol', as 'function' may be unknown => mismatch. :type '(choice (repeat :tag "Specified modes" symbol) (const :tag "All modes" t)) - :package-version '(so-long . "1.0")) + :package-version '(so-long . "1.1")) (defcustom so-long-invisible-buffer-function #'so-long-deferred "Function called in place of `so-long' when the buffer is not displayed. @@ -1897,6 +1898,9 @@ If it appears in `%s', you should remove it." (unless global-so-long-mode (global-so-long-mode 1))) (makunbound 'so-long-mode-enabled)) + ;; Update to version 1.1 from earlier versions: + (when (version< so-long-version "1.1") + (add-to-list 'so-long-target-modes 'fundamental-mode)) ;; Update to version 1.N: ;; (when (version< so-long-version "1.N") ...) ;; |