Last active
July 24, 2025 15:02
-
-
Save ychaouche/3fd8e329a4e155df8f154446d92ebc22 to your computer and use it in GitHub Desktop.
add-newline-after-punctuation.el
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun add-newline-after-punctuation9 (start end) | |
"Place a newline after each sequence of 4 or more words followed by a comma, semicolon, colon, or period in the region." | |
(interactive "r") | |
(save-excursion | |
(goto-char start) | |
(while (re-search-forward "\\(\\w+\s+\\)\\{3,\\}\\w+\s*[.,:;])" end t) | |
(replace-match "\\&\n")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment