[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 9df60d5 03/11: Increase `so-long-threshold' and `so-long-max-line
From: |
Phil Sainty |
Subject: |
master 9df60d5 03/11: Increase `so-long-threshold' and `so-long-max-lines' defaults |
Date: |
Tue, 3 Aug 2021 07:44:25 -0400 (EDT) |
branch: master
commit 9df60d52d50b86639a82f22d7c0a07a81c3ba817
Author: Phil Sainty <psainty@orcon.net.nz>
Commit: Phil Sainty <psainty@orcon.net.nz>
Increase `so-long-threshold' and `so-long-max-lines' defaults
* lisp/so-long.el (so-long-threshold, so-long-max-lines): Increase
default values to reduce false-positives.
* etc/NEWS: Describe changes.
Lines shorter than 10,000 characters shouldn't generally be causing
problems, so testing this explicitly will largely eliminate
false-positives. We must also increase the maximum number of lines
to check, because 'minified' code may still include newlines, and so
there may be many lines shorter than the new threshold before we find
a line which exceeds it.
Previously we used a minimum-effort heuristic, testing a very small
number of lines against a maximum length which, while not remotely
long enough to cause problems, would nevertheless be uncommon in any
normal file of programming code (and hence indicative that the file
was likely to be minified code).
Testing indicates that the performance penalty for the larger values
should be negligible.
---
etc/NEWS | 7 +++++++
lisp/so-long.el | 11 ++++++-----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index 95a2c87..9f22d78 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2854,6 +2854,13 @@ GPG key servers can now be queried for keys with the
'M-x epa-search-keys' command. Keys can then be added to your
personal key ring.
+** So Long
+
+---
+*** 'so-long-threshold' and 'so-long-max-lines' have been raised to
+10000 characters and 500 lines respectively, to reduce the likelihood
+of false-positives when 'global-so-long-mode' is enabled.
+
* New Modes and Packages in Emacs 28.1
diff --git a/lisp/so-long.el b/lisp/so-long.el
index bb99693..58857de 100644
--- a/lisp/so-long.el
+++ b/lisp/so-long.el
@@ -391,7 +391,8 @@
;; * Change Log:
;;
-;; 1.1 - ?
+;; 1.1 - Increase `so-long-threshold' from 250 to 10,000.
+;; - Increase `so-long-max-lines' from 5 to 500.
;; 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'.
@@ -494,14 +495,14 @@
:prefix "so-long"
:group 'convenience)
-(defcustom so-long-threshold 250
+(defcustom so-long-threshold 10000
"Maximum line length permitted before invoking `so-long-function'.
See `so-long-detected-long-line-p' for details."
:type 'integer
- :package-version '(so-long . "1.0"))
+ :package-version '(so-long . "1.1"))
-(defcustom so-long-max-lines 5
+(defcustom so-long-max-lines 500
"Number of non-blank, non-comment lines to test for excessive length.
If nil then all lines will be tested, until either a long line is detected,
@@ -513,7 +514,7 @@ be counted.
See `so-long-detected-long-line-p' for details."
:type '(choice (integer :tag "Limit")
(const :tag "Unlimited" nil))
- :package-version '(so-long . "1.0"))
+ :package-version '(so-long . "1.1"))
(defcustom so-long-skip-leading-comments t
"Non-nil to ignore all leading comments and whitespace.
- master updated (b44abac -> 3a56d4e), Phil Sainty, 2021/08/03
- master 359a8e4 02/11: ; * lisp/so-long.el: Bump to version 1.1, Phil Sainty, 2021/08/03
- master 985a3bd 01/11: ; * lisp/so-long.el: Documentation, Phil Sainty, 2021/08/03
- master 0ec67a2 07/11: ; so-long-tests.el: Suppress expected warnings, Phil Sainty, 2021/08/03
- master 748df22 06/11: ; * lisp/so-long.el: Minor bug fixes, Phil Sainty, 2021/08/03
- master e871852 04/11: Make `global-so-long-mode' handle unrecognised file types, Phil Sainty, 2021/08/03
- master 7828f69 05/11: * lisp/so-long.el (so-long-minor-modes): Additional modes to disable, Phil Sainty, 2021/08/03
- master 10bd4bc 08/11: Support 'preserved' variables and minor modes in `so-long-mode', Phil Sainty, 2021/08/03
- master 3a56d4e 11/11: Merge branch 'scratch/so-long', Phil Sainty, 2021/08/03
- master 12cbe8e 09/11: ; Revert "Make `so-long' restore `view-mode'", Phil Sainty, 2021/08/03
- master 9df60d5 03/11: Increase `so-long-threshold' and `so-long-max-lines' defaults,
Phil Sainty <=
- master 59128bb 10/11: Make `global-so-long-mode' use `buffer-line-statistics', Phil Sainty, 2021/08/03