Skip to content
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

Update filling functionality. #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

taku0
Copy link
Contributor

@taku0 taku0 commented Mar 21, 2023

fill-paragraph, fill-region, and auto-fill-mode now parse comments and multline strings as KDoc markdown and fill paragraphs with appropriate prefix (combination of /, *, >, and indentation).

Example:

/**
 *
 * *  >>  -  >10.  2)  aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *    >>     >         aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *    >>     >         aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *
 * @param foo  aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *     aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *     aaa aaa aaa
 * @param bar
 *     aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *     aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *     aaa
 */

The Markdown parser is based on the algorithm described in CommonMark spec. It only parses block-level structures. HTML blocks and link reference definitions are not implemented yet.

Fixes #55.

@gregghz
Copy link
Member

gregghz commented Apr 19, 2023

@taku0 this looks great. Is there any chance you could look into the build failure against the snapshot emacs?

`fill-paragraph`, `fill-region`, and `auto-fill-mode` parse
comments and multline strings as KDoc markdown and fill paragraphs with
appropriate prefix (combination of `/`, `*`, `>`, and indentation).

Example:

```kotlin
/**
 *
 * *  >>  -  >10.  2)  aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *    >>     >         aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *    >>     >         aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *
 * @param foo  aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *     aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *     aaa aaa aaa
 * @param bar
 *     aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *     aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa aaa
 *     aaa
 */
```
@taku0
Copy link
Contributor Author

taku0 commented Apr 22, 2023

@gregghz fixed. Now all green 😊.

@taku0
Copy link
Contributor Author

taku0 commented Jun 10, 2023

@gregghz can this be merged, or can I be a maintainer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fill-paragraph does not behave properly in comments
2 participants