> 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 

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

  • ... Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader (in English)
    • ... Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader (in English)
      • ... Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader (in English)
        • ... Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader (in English)
        • ... Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader (in English)
          • ... Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader (in English)
            • ... Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader (in English)
            • ... Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader (in English)
              • ... Christoph Groth
                • ... Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader (in English)
                • ... Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader (in English)
                • ... Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader (in English)

Reply via email to