emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/rt-liberation 1038ecc 53/68: * rt-liberation.el: fill c


From: Yoni Rabkin
Subject: [elpa] externals/rt-liberation 1038ecc 53/68: * rt-liberation.el: fill content
Date: Wed, 16 Dec 2020 12:11:15 -0500 (EST)

branch: externals/rt-liberation
commit 1038ecc683545100d0a3df972be1c3e1a8501c4f
Author: Yoni Rabkin <yoni@rabkins.net>
Commit: Yoni Rabkin <yoni@rabkins.net>

    * rt-liberation.el: fill content
---
 rt-liberation.el | 17 ++++++++++++-----
 1 file 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)))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]