[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Solution of sorts]
From: |
Michael Heerdegen |
Subject: |
Re: [Solution of sorts] |
Date: |
Tue, 11 Feb 2025 03:37:41 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Moin Uwe,
Nice idea, thx for sharing. Some comments below:
> 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)
Hmm, but you don't want to select that buffer, right? I would at least
wrap the whole thing in an appropriate excursion
(`save-window-excursion'?) But maybe we find a better suited function.
Doesn't (with-current-buffer gnus-article-buffer ...) suffice?
> (unless
> (string-match user-mail-address (message-fetch-field "To"))
Slightly better:
(string-match-p (regexp-quote user-mail-address)
(message-fetch-field "To"))
> (error
> (progn
> (message "Aborted, you are not in the To: field!!!"))))))
Either `error', then with string + arg, or a message. We don't have a
condition-case handler here, right? I'd use `user-error'.
> (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))
Is there some hook one could alternatively use for this functionality?
We could check `this-command' to include only commands we want to
influence.
Michael.
- 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, 2025/02/10
- Re: [Solution of sorts],
Michael Heerdegen <=
- 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
Re: Checking if user-mail-address is in To or CC (to avoid an embarrassing social situation) BCC, James Thomas, 2025/02/11