aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2017-02-11 23:15:13 -0500
committerNoam Postavsky2017-02-14 22:29:56 -0500
commit0a64666288e3f32967db4ad683a4bc2f225fb952 (patch)
tree2f235f41d4c44bd7f218a006b59d03feb4eab672
parent61ea36bb37740315dc78ba213db51c508c489f25 (diff)
downloademacs-0a64666288e3f32967db4ad683a4bc2f225fb952.tar.gz
emacs-0a64666288e3f32967db4ad683a4bc2f225fb952.zip
Test comment-multi-line = nil auto fill case too
* test/lisp/progmodes/js-tests.el (js-mode-auto-fill): Test with `comment-multi-line' both nil and non-nil. * lisp/newcomment.el (comment-multi-line): Mark safe if it's a boolean. * etc/NEWS: Mention that `js-mode' now sets `comment-multi-line'.
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/newcomment.el1
-rw-r--r--test/lisp/progmodes/js-tests.el22
3 files changed, 16 insertions, 10 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 31b05ddbab4..421e5daa3e4 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -624,6 +624,9 @@ initialization files.
624--- 624---
625** 'auto-revert-use-notify' is set back to t in 'global-auto-revert-mode'. 625** 'auto-revert-use-notify' is set back to t in 'global-auto-revert-mode'.
626 626
627---
628** JS mode now sets 'comment-multi-line' to t.
629
627** CSS mode 630** CSS mode
628 631
629--- 632---
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 1af89293b62..4b261c34c65 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -309,6 +309,7 @@ customize this variable.
309It also affects \\[indent-new-comment-line]. However, if you want this 309It also affects \\[indent-new-comment-line]. However, if you want this
310behavior for explicit filling, you might as well use \\[newline-and-indent]." 310behavior for explicit filling, you might as well use \\[newline-and-indent]."
311 :type 'boolean 311 :type 'boolean
312 :safe #'booleanp
312 :group 'comment) 313 :group 'comment)
313 314
314(defcustom comment-empty-lines nil 315(defcustom comment-empty-lines nil
diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el
index d61f084e0df..99f5898525b 100644
--- a/test/lisp/progmodes/js-tests.el
+++ b/test/lisp/progmodes/js-tests.el
@@ -89,16 +89,18 @@ if (!/[ (:,='\"]/.test(value)) {
89(ert-deftest js-mode-auto-fill () 89(ert-deftest js-mode-auto-fill ()
90 (with-temp-buffer 90 (with-temp-buffer
91 (js-mode) 91 (js-mode)
92 (setq fill-column 70) 92 (let ((fill-column 10)
93 (insert "/* ") 93 (comment-multi-line t))
94 (dotimes (_ 16) 94 (insert "/* test test")
95 (insert "test ")) 95 (do-auto-fill)
96 (do-auto-fill) 96 ;; Filling should continue the multi line comment.
97 ;; The bug is that, after auto-fill, the second line starts with 97 (should (equal (buffer-string) "/* test\n * test"))
98 ;; "/*", whereas it should start with " * ". 98 (erase-buffer)
99 (goto-char (point-min)) 99 (insert "/* test test")
100 (forward-line) 100 (setq comment-multi-line nil)
101 (should (looking-at " \\* test")))) 101 (do-auto-fill)
102 ;; Filling should start a new comment on the next line.
103 (should (equal (buffer-string) "/* test */\n/* test")))))
102 104
103(ert-deftest js-mode-regexp-syntax-bug-25529 () 105(ert-deftest js-mode-regexp-syntax-bug-25529 ()
104 (dolist (regexp-contents '("[^[]" 106 (dolist (regexp-contents '("[^[]"