commit 4760d40261ddd2496961d0443239b170c596d04f parent 0b50585111846c9383fda6cff478e974f3e4c0e1 Author: Tomas Hlavaty <tom@logand.com> Date: Sun, 8 Dec 2024 10:29:05 +0100 add euractiv Diffstat:
M | email-eww.el | | | 31 | +++++++++++++++++++++++++++++++ |
1 file changed, 31 insertions(+), 0 deletions(-)
diff --git a/email-eww.el b/email-eww.el @@ -294,6 +294,35 @@ (delete-region (point) (point-max)) (message-goto-body)) +(defun clean-up-euractiv () + (forward-line 1) + (let ((start (point))) + (cond + ((search-forward "Est. " nil t) + (beginning-of-line) + (backward-paragraph 3) + (delete-region (point) start)) + ((search-forward "Content-Type:") + (backward-paragraph 3) + (delete-region (point) start))) + ;; tail + (goto-char (point-max)) + (or + (search-backward "Euractiv is part of the Trust Project" nil t) + (search-backward "Topics" nil t) + (search-backward "Read more with Euractiv" nil t) + ) + (when (< start (point)) + (beginning-of-line) + (forward-line -1) + (backward-paragraph 1) + (delete-region (point) (point-max))) + ;; whitespace + (goto-char start) + (while (re-search-forward "^[ \t]+" nil t) + (replace-match ""))) + (message-goto-body)) + (defun email-eww () (interactive) (let ((content (buffer-string)) @@ -339,6 +368,8 @@ (clean-up-commondreams)) ((string-match "wsws.org" url) (clean-up-wsws)) + ((string-match "euractiv.com" url) + (clean-up-euractiv)) ) (goto-char (point-max)) (delete-blank-lines)