emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [Meta] Mailing list helper functions
Date: Fri, 13 Nov 2020 10:13:36 +0800	[thread overview]
Message-ID: <87wnyqknqn.fsf@localhost> (raw)


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	other threads:[~2020-11-13  2:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnyqknqn.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).