]> git.eshelyaron.com Git - emacs.git/commitdiff
; lisp/so-long.el: Prevent potential error if comment-use-syntax is nil
authorPhil Sainty <psainty@orcon.net.nz>
Sat, 11 Jul 2020 07:40:27 +0000 (19:40 +1200)
committerPhil Sainty <psainty@orcon.net.nz>
Mon, 3 Aug 2020 13:44:53 +0000 (01:44 +1200)
* 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.

lisp/so-long.el

index 21dc7de75c8eecb6222d208a1d24a38f9c5472ab..1332ae12633cd671fdf5f6e0e0a40af27b747da5 100644 (file)
@@ -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 "#!")