summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Sainty <psainty@orcon.net.nz>2020-07-11 19:40:27 +1200
committerPhil Sainty <psainty@orcon.net.nz>2020-08-04 01:44:53 +1200
commit8576297b2a657d1944b7d824b30a1cb6459685c6 (patch)
tree474a3d8e7a8b04980ce2401dd06f4ebf04902399
parent986c12b20fa29c37f13563846fddf6edcd0b4945 (diff)
downloademacs-8576297b2a657d1944b7d824b30a1cb6459685c6.tar.gz
; lisp/so-long.el: Prevent potential error if comment-use-syntax is nil
* lisp/so-long.el (so-long-detected-long-line-p): Ensure that `comment-start-skip' and `comment-end-skip' are both set if `comment-use-syntax' is nil, as `comment-forward' requires them to be bound in this scenario.
-rw-r--r--lisp/so-long.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/so-long.el b/lisp/so-long.el
index 21dc7de75c8..1332ae12633 100644
--- a/lisp/so-long.el
+++ b/lisp/so-long.el
@@ -1047,7 +1047,9 @@ This is the default value of `so-long-predicate'."
(let ((count 0) start)
(save-excursion
(goto-char (point-min))
- (when so-long-skip-leading-comments
+ (when (and so-long-skip-leading-comments
+ (or comment-use-syntax ;; Refer to `comment-forward'.
+ (and comment-start-skip comment-end-skip)))
;; Skip the shebang line, if any. This is not necessarily comment
;; syntax, so we need to treat it specially.
(when (looking-at "#!")