clojure-emacs / clojure-emacs/clojure-mode

clojure-fill-paragraph won't break lines at the space in `word :word`

Open
#613 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
1k
Forks
249
PR merge metrics
No merged PRs in 30d

Description

I noticed a, to me, weird behavior of `clojure-fill-paragraph`. I was listing keyword arguments in a docstrsing, and when I tried to fill it I ended up with something similar to the screenshot below. I tracked it down to the extra stuff that it is adding to `paragraph-start`, i.e. this code:
```
(let ((paragraph-start
(concat paragraph-start
"\\|\\s-*\\([(:\"[]\\|~@\\|`(\\|#'(\\)"))
```
I don't understand why the regexp is like that, but I don't like the current result.

## Expected behavior

`clojure-fill-paragraph` can break lines at the space in `word :word`.

## Actual behavior

![image](https://user-images.githubusercontent.com/861064/161857445-655eab40-0c11-43b6-b177-cc70b37c00cc.png)

## Steps to reproduce the problem

Try to fill the docstring in
```
(defn some-function
"word word word word word word word word word :word :word :word :word :word :word :word :word :word :word :word :word :word :word :word :word :word :word :word :word :word :word word word word word word word word word word word word word word word word word word word word word word word word"
[])
```
## Environment & Version information

### clojure-mode version 5.13

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.