emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 8576297 4/4: ; lisp/so-long.el: Prevent potential error if comm


From: Phil
Subject: emacs-27 8576297 4/4: ; lisp/so-long.el: Prevent potential error if comment-use-syntax is nil
Date: Mon, 3 Aug 2020 09:56:50 -0400 (EDT)

branch: emacs-27
commit 8576297b2a657d1944b7d824b30a1cb6459685c6
Author: Phil Sainty <psainty@orcon.net.nz>
Commit: Phil Sainty <psainty@orcon.net.nz>

    ; 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.
---
 lisp/so-long.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/so-long.el b/lisp/so-long.el
index 21dc7de..1332ae1 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 "#!")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]