emacs-orgmode
[Top][All Lists]
Advanced

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

[Meta] Mailing list helper functions


From: Ihor Radchenko
Subject: [Meta] Mailing list helper functions
Date: Fri, 13 Nov 2020 10:13:36 +0800

Recent changes in https://orgmode.org/worg/org-mailing-list.html
encouraged several unusual practices when posting to org-mode mailing
list:
1. Using Woof headers to label Bugs/Help requests/Patches [1]
2. Avoiding full quoting of earlier thread when it gets too long (which
is default in Emacs and many other mail clients) [2]

I wrote two small helpers for message-send-hook reminding to follow the
suggestions. Hope they can be useful for other users following the
maillist from inside Emacs.

(defun yant/notmuch-mua-woof-check-maybe ()
    "Remind to use Woof headers when sending email to org-mode maillist."
    (let ((case-fold-search t))
      (save-excursion
        (goto-char (point-min))
        (when (re-search-forward "^\\(To:\\|CC:\\).+emacs-orgmode@gnu\\.org" 
nil t)
          (goto-char (point-min))
          (unless (re-search-forward 
"^X-Woof-\\(Bug\\|Help\\|Change\\|Release\\|Patch\\):" nil t)
            (unless (yes-or-no-p "No Woof-(Bug|Help|Patch): t/nil headers found 
in message being sent to emacs-orgmode@gnu.org. Send anyway? ")
              (error "Forgot Woof headers")))))))
  (add-hook 'message-send-hook #'yant/notmuch-mua-woof-check-maybe)

(defun yant/notmuch-mua-too-long-cite-reminder ()
    "Remind to cut unnecessary thread citation when replying to orgmode."
    (let ((case-fold-search t))
      (save-excursion
        (goto-char (point-min))
        (when (re-search-forward "^\\(To:\\|CC:\\).+emacs-orgmode@gnu\\.org" 
nil t)
          (message-goto-body)
          (when (> (- (point-max) (point)) 5000) ; Message too long.
            (unless (yes-or-no-p "Message is too long. May need to cutoff 
excess citation lines. Send anyway? ")
              (error "Forgot to cutoff excess citation")))))))
  (add-hook 'message-send-hook #'yant/notmuch-mua-too-long-cite-reminder)

[1] https://orgmode.org/worg/org-mailing-list.html#orga4190ea
[2] https://orgmode.org/worg/org-mailing-list.html#orgf343a0f

Best,
Ihor
 



reply via email to

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