Org-mode mailing list
 help / color / mirror / 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
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
 


^ 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

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git