Skip to content

Commit eacd330

Browse files
vspinubbatsov
authored andcommitted
Remove ; from paragraph-start regexp during fill (#434)
1 parent 6e966d5 commit eacd330

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Bugs fixed
66

7+
* Fix fill-paragraph in multi-line comments.
78
* [#429](https://github.com/clojure-emacs/clojure-mode/issues/429): Fix a bug causing last occurrence of expression sometimes is not replaced when using `move-to-let`.
89
* [#423](https://github.com/clojure-emacs/clojure-mode/issues/423): Make `clojure-match-next-def` more robust against zero-arity def-like forms.
910

clojure-mode.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,14 +579,14 @@ If JUSTIFY is non-nil, justify as well as fill the paragraph."
579579
(if (clojure-in-docstring-p)
580580
(let ((paragraph-start
581581
(concat paragraph-start
582-
"\\|\\s-*\\([(;:\"[]\\|~@\\|`(\\|#'(\\)"))
582+
"\\|\\s-*\\([(:\"[]\\|~@\\|`(\\|#'(\\)"))
583583
(paragraph-separate
584584
(concat paragraph-separate "\\|\\s-*\".*[,\\.]$"))
585585
(fill-column (or clojure-docstring-fill-column fill-column))
586586
(fill-prefix (clojure-docstring-fill-prefix)))
587587
(fill-paragraph justify))
588588
(let ((paragraph-start (concat paragraph-start
589-
"\\|\\s-*\\([(;:\"[]\\|`(\\|#'(\\)"))
589+
"\\|\\s-*\\([(:\"[]\\|`(\\|#'(\\)"))
590590
(paragraph-separate
591591
(concat paragraph-separate "\\|\\s-*\".*[,\\.[]$")))
592592
(or (fill-comment-paragraph justify)

test/clojure-mode-syntax-test.el

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,32 @@
7777
(backward-prefix-chars)
7878
(should (bobp)))))
7979

80+
(def-refactor-test test-paragraph-fill-within-comments
81+
"
82+
;; Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
83+
;; ut labore et dolore magna aliqua."
84+
"
85+
;; Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
86+
;; tempor incididunt ut labore et dolore magna aliqua."
87+
(goto-char (point-min))
88+
(let ((fill-column 80))
89+
(fill-paragraph)))
90+
91+
(def-refactor-test test-paragraph-fill-within-inner-comments
92+
"
93+
(let [a 1]
94+
;; Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
95+
;; ut labore et dolore
96+
;; magna aliqua.
97+
)"
98+
"
99+
(let [a 1]
100+
;; Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
101+
;; tempor incididunt ut labore et dolore magna aliqua.
102+
)"
103+
(goto-char (point-min))
104+
(forward-line 2)
105+
(let ((fill-column 80))
106+
(fill-paragraph)))
107+
80108
(provide 'clojure-mode-syntax-test)

0 commit comments

Comments
 (0)