Skip to content

Remove ; from paragraph-start regexp during fill #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bugs fixed

* Fix fill-paragraph in multi-line comments.
* [#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`.
* [#423](https://github.com/clojure-emacs/clojure-mode/issues/423): Make `clojure-match-next-def` more robust against zero-arity def-like forms.

Expand Down
4 changes: 2 additions & 2 deletions clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -579,14 +579,14 @@ If JUSTIFY is non-nil, justify as well as fill the paragraph."
(if (clojure-in-docstring-p)
(let ((paragraph-start
(concat paragraph-start
"\\|\\s-*\\([(;:\"[]\\|~@\\|`(\\|#'(\\)"))
"\\|\\s-*\\([(:\"[]\\|~@\\|`(\\|#'(\\)"))
(paragraph-separate
(concat paragraph-separate "\\|\\s-*\".*[,\\.]$"))
(fill-column (or clojure-docstring-fill-column fill-column))
(fill-prefix (clojure-docstring-fill-prefix)))
(fill-paragraph justify))
(let ((paragraph-start (concat paragraph-start
"\\|\\s-*\\([(;:\"[]\\|`(\\|#'(\\)"))
"\\|\\s-*\\([(:\"[]\\|`(\\|#'(\\)"))
(paragraph-separate
(concat paragraph-separate "\\|\\s-*\".*[,\\.[]$")))
(or (fill-comment-paragraph justify)
Expand Down
28 changes: 28 additions & 0 deletions test/clojure-mode-syntax-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,32 @@
(backward-prefix-chars)
(should (bobp)))))

(def-refactor-test test-paragraph-fill-within-comments
"
;; Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
;; ut labore et dolore magna aliqua."
"
;; Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
;; tempor incididunt ut labore et dolore magna aliqua."
(goto-char (point-min))
(let ((fill-column 80))
(fill-paragraph)))

(def-refactor-test test-paragraph-fill-within-inner-comments
"
(let [a 1]
;; Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
;; ut labore et dolore
;; magna aliqua.
)"
"
(let [a 1]
;; Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
;; tempor incididunt ut labore et dolore magna aliqua.
)"
(goto-char (point-min))
(forward-line 2)
(let ((fill-column 80))
(fill-paragraph)))

(provide 'clojure-mode-syntax-test)