The removed expressions, which were used to ensure that citations were
both preceded and followed by a blank line, were poorly implemented
and caused a regexp stack overflow on messages more than a few
thousand lines long.
(defun notmuch-wash-tidy-citations (depth)
"Improve the display of cited regions of a message.
(defun notmuch-wash-tidy-citations (depth)
"Improve the display of cited regions of a message.
-Perform four transformations on the message body:
+Perform several transformations on the message body:
- Remove lines of repeated citation leaders with no other
content,
- Remove lines of repeated citation leaders with no other
content,
;; text.
(goto-char (point-min))
(while (re-search-forward "\\(^>[> ]*\n\\)\\(^$\\|^[^>].*\\)" nil t)
;; text.
(goto-char (point-min))
(while (re-search-forward "\\(^>[> ]*\n\\)\\(^$\\|^[^>].*\\)" nil t)
- (replace-match "\\2"))
-
- ;; Insert a blank line before a citation if there isn't one.
- (goto-char (point-min))
- (while (re-search-forward "\\(^[^>]+\\)\n>" nil t)
- (replace-match "\\1\n\n>"))
-
- ;; Insert a blank line after a citation if there isn't one.
- (goto-char (point-min))
- (while (re-search-forward "\\(^>.+\\)\n\\([^>]\\)" nil t)
- (replace-match "\\1\n\n\\2")))
+ (replace-match "\\2")))