diff options
author | Vibhav Pant <vibhavp@gmail.com> | 2020-08-21 14:04:35 +0530 |
---|---|---|
committer | Vibhav Pant <vibhavp@gmail.com> | 2020-08-21 14:04:35 +0530 |
commit | f0f8d7b82492e741950c363a03b886965c91b1b0 (patch) | |
tree | 19b716830b1ebabc0d7d75949c4e6800c0f104ad /lisp/mail/flow-fill.el | |
parent | 9e64a087c4d167e7ec1c4e22bea3e6af53b563de (diff) | |
parent | c818c29771d3cb51875643b2f6c894073e429dd2 (diff) | |
download | emacs-feature/native-comp-macos-fixes.tar.gz |
Merge branch 'feature/native-comp' into feature/native-comp-macos-fixesfeature/native-comp-macos-fixes
Diffstat (limited to 'lisp/mail/flow-fill.el')
-rw-r--r-- | lisp/mail/flow-fill.el | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/lisp/mail/flow-fill.el b/lisp/mail/flow-fill.el index af3b493a08a..f4b55031194 100644 --- a/lisp/mail/flow-fill.el +++ b/lisp/mail/flow-fill.el @@ -131,31 +131,37 @@ lines." (goto-char (match-end 0)) (unless (looking-at " ") (insert " ")) - (end-of-line) - (when (and (not (eobp)) - (save-excursion - (forward-line 1) - (looking-at (format "\\(%s ?\\)[^>]" prefix)))) - ;; Delete the newline and the quote at the start of the - ;; next line. - (delete-region (point) (match-end 1)) - (ignore-errors + (while (and (eq (char-before (line-end-position)) ?\s) + (not (eobp)) + (save-excursion + (forward-line 1) + (looking-at (format "\\(%s ?\\)[^>]" prefix)))) + (end-of-line) + (when (and (not (eobp)) + (save-excursion + (forward-line 1) + (looking-at (format "\\(%s ?\\)[^>]" prefix)))) + ;; Delete the newline and the quote at the start of the + ;; next line. + (delete-region (point) (match-end 1)))) + (ignore-errors (let ((fill-prefix (concat prefix " ")) adaptive-fill-mode) (fill-region (line-beginning-position) (line-end-position) - 'left 'nosqueeze)))))) - (t + 'left 'nosqueeze))))) + (t ;; Delete the newline. (when (eq (following-char) ?\s) (delete-char 1)) ;; Hack: Don't do the flowing on the signature line. (when (and (not (looking-at "-- $")) (eq (char-before (line-end-position)) ?\s)) - (end-of-line) - (when delete-space - (delete-char -1)) - (delete-char 1) + (while (eq (char-before (line-end-position)) ?\s) + (end-of-line) + (when delete-space + (delete-char -1)) + (delete-char 1)) (ignore-errors (let ((fill-prefix "")) (fill-region (line-beginning-position) |