diff options
author | Yoni Rabkin <yoni@rabkins.net> | 2020-12-03 14:20:27 -0500 |
---|---|---|
committer | Yoni Rabkin <yoni@rabkins.net> | 2020-12-03 14:20:27 -0500 |
commit | 1038ecc683545100d0a3df972be1c3e1a8501c4f (patch) | |
tree | 2b21f81bab9c732b9ea5437e966f1a795c87317d /rt-liberation.el | |
parent | f529257ac3d3c6c29ea6d1c2b3b9d6b6b91f73f1 (diff) |
* rt-liberation.el: fill content
Diffstat (limited to 'rt-liberation.el')
-rw-r--r-- | rt-liberation.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/rt-liberation.el b/rt-liberation.el index 623c029..bf59ede 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1347,21 +1347,28 @@ ASSOC-BROWSER if non-nil should be a ticket browser." (goto-char (point-min)) (if (re-search-forward "^This transaction appears to have no content" (point-max) t) "" + ;; remove leading blank lines (save-excursion (goto-char (point-min)) (re-search-forward "[[:graph:]]" (point-max) t) (forward-line -1) (flush-lines "^[[:space:]]+$" (point-min) (point))) - + ;; remove trailing blank lines + (save-excursion + (goto-char (point-max)) + (re-search-backward "[[:graph:]]" (point-min) t) + (forward-line 2) + (flush-lines "^[[:space:]]+$" (point-max) (point))) ;; Convert the 9 leading whitespaces from RT's comment lines. (goto-char (point-min)) (insert " ") (while (re-search-forward "^ " (point-max) t) (replace-match " ")) - - (fill-region (point-min) - (point-max)) - + ;; fill + (let ((paragraph-separate " >[[:space:]]+$")) + (fill-region (point-min) + (point-max))) + ;; finally (buffer-substring (point-min) (point-max))))) |