When I manually use fill-paragraph I would like to have emacs remove all previously inserted hyphenations (by others?). That means automatically replacing all "-\n" with "".
How can I do that?
I can imagine that not working out well in some cases, however...
(defadvice fill-delete-newlines (before my-before-fill-delete-newlines)
"Replace -\\n with an empty string when calling `fill-paragraph'."
(when (eq this-command 'fill-paragraph)
(goto-char (ad-get-arg 0))
(while (search-forward "-\n" (ad-get-arg 1) t)
(replace-match "")
(ad-set-arg 1 (- (ad-get-arg 1) 2)))))
(ad-activate 'fill-delete-newlines)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With