From c0116d1447e5ba2c2a1fedb14ab18f665726d231 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 13 Dec 2019 14:55:50 -0500 Subject: [PATCH] Fix #2183: suppress so-long when no comment syntax Hopefully a better solution can be found. --- core/core-editor.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/core-editor.el b/core/core-editor.el index 8e8806dcc..a641245c8 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -501,7 +501,14 @@ files, so we replace calls to `pp' with the much faster `prin1'." auto-composition-mode undo-tree-mode highlight-indent-guides-mode - hl-fill-column-mode))) + hl-fill-column-mode)) + ;; HACK Fix #2183: `so-long-detected-long-line-p' tries to parse comment + ;; syntax, but in some buffers comment state isn't initialized, leading + ;; to a wrong-type-argument: stringp error. + (defun doom-buffer-has-long-lines-p () + (when (bound-and-true-p comment-use-syntax) + (so-long-detected-long-line-p))) + (setq so-long-predicate #'doom-buffer-has-long-lines-p)) (use-package! undo-tree