[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Checking if user-mail-address is in To or CC (to avoid an embarrassi
From: |
Uwe Brauer |
Subject: |
Re: Checking if user-mail-address is in To or CC (to avoid an embarrassing social situation) BCC |
Date: |
Fri, 14 Feb 2025 12:07:14 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
> Uwe Brauer via "Announcements and discussions for GNUS, the GNU Emacs
> Usenet newsreader (in English)" <info-gnus-english@gnu.org> writes:
> Sorry I meant the 'message-wide-reply-to-function' in the same page.
> On the face of it, it seems to cover this use case:
Hm on a second thought I could to this
(defun check-my-to-field (&optional arg)
"Warn if your email address is not in the To field, unless it's a newsgroup
post."
(interactive "P")
(save-window-excursion
(gnus-summary-select-article-buffer)
(let ((to-field (message-fetch-field "To"))
(newsgroup-field (message-fetch-field "Newsgroups")))
(unless (or (and to-field (string-match-p (regexp-quote
user-mail-address) to-field))
newsgroup-field) ; Do not warn if it's a newsgroup
(if (y-or-n-p "Warning: Followup? But you are not on the TO field, you
FOOL, proceed?")
(message "I hope you are sure.")
(error
(progn
(message "Aborted, you are not in the To: field!!!"))))))))
Which is the final version of the function I came up with
(setq message-reply-to-function #'check-my-to-field)
Instead of using advice.
--
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military.
I support the EU and NATO membership of Ukraine.
smime.p7s
Description: S/MIME cryptographic signature
- [which hook?] (was: [defadvice, advice-add ]), (continued)
- [which hook?] (was: [defadvice, advice-add ]), Uwe Brauer, 2025/02/12
- Re: [defadvice, advice-add ], Uwe Brauer, 2025/02/12
- Re: [defadvice, advice-add ], Christoph Groth, 2025/02/12
- Re: [defadvice, advice-add ], Uwe Brauer, 2025/02/13
- Re: [defadvice, advice-add ], Uwe Brauer, 2025/02/15
- [a better solution without using advice] (was: [defadvice, advice-add ]), Uwe Brauer, 2025/02/22
Re: Checking if user-mail-address is in To or CC (to avoid an embarrassing social situation) BCC, James Thomas, 2025/02/11