emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Meta] Mailing list helper functions
@ 2020-11-13  2:13 Ihor Radchenko
  0 siblings, 0 replies; only message in thread
From: Ihor Radchenko @ 2020-11-13  2:13 UTC (permalink / raw)
  To: emacs-orgmode

Recent changes in https://orgmode.org/worg/org-mailing-list.html
encouraged several unusual practices when posting to org-mode mailing
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))
	(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))
	(goto-char (point-min))
	(when (re-search-forward "^\\(To:\\|CC:\\).+emacs-orgmode@gnu\\.org" nil t)
          (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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-13  2:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-13  2:13 [Meta] Mailing list helper functions Ihor Radchenko

Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).