info-gnus-english
[Top][All Lists]
Advanced

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

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]