[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Solution of sorts] (was: Checking if user-mail-address is in To or CC (
From: |
Uwe Brauer |
Subject: |
[Solution of sorts] (was: Checking if user-mail-address is in To or CC (to avoid an embarrassing social situation) BCC) |
Date: |
Mon, 10 Feb 2025 22:44:53 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
> Hi
> Let’s assume I write an email to:
> (defun check-my-to-field ()
> "This function will be run before you execute followup. And it warns you if
> your email address is not
> in the To field. That warning is a safty message if you had been only on the
> BCC field!!"
> (interactive)
> (unless (string-match user-mail-address (message-fetch-field "To"))
> (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!!!"))))))
> (defadvice gnus-article-followup-with-original (before mychecktofield
> activate)
> "This function will be run before you execute followup. It warns you if
> your email address is not in the To field. That warning is a safty
> message if you had been only on the BCC field!!"
> (check-my-to-field))
> It does not work in the *summary buffer*.
Adding (gnus-summary-select-article-buffer)
Solves the problem somehow:
(defun check-my-to-field ()
"This function will be run before you execute followup. And it
warns you if your email address is not in the To field. That
warning is a safty message if you had been only on the BCC
field!!"
(interactive)
(gnus-summary-select-article-buffer)
(unless
(string-match user-mail-address (message-fetch-field "To"))
(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!!!"))))))
(defadvice gnus-article-followup-with-original (before mychecktofield activate)
"This function will be run before you execute followup. It warns you if your
email address is not in the To field. That
warning is a safty message if you had been only on the BCC field!!"
(check-my-to-field))
(defadvice gnus-summary-followup-with-original (before mychecktofield activate)
"This function will be run before you execute followup. It warns you if your
email address is not in the To field. That
warning is a safty message if you had been only on the BCC field!!"
(check-my-to-field))
Uwe Brauer
smime.p7s
Description: S/MIME cryptographic signature
- Checking if user-mail-address is in To or CC (to avoid an embarrassing social situation) BCC, Uwe Brauer, 2025/02/10
- [Solution of sorts] (was: Checking if user-mail-address is in To or CC (to avoid an embarrassing social situation) BCC),
Uwe Brauer <=
- Re: [Solution of sorts], Michael Heerdegen, 2025/02/10
- Re: [Solution of sorts], Uwe Brauer, 2025/02/11
- [defadvice, advice-add ] (was: [Solution of sorts]), Uwe Brauer, 2025/02/11
- Re: [defadvice, advice-add ], Michael Heerdegen, 2025/02/11
- [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