>>> "AadfGtGEUn(E" == Announcements and discussions for GNUS, the GNU Emacs >>> Usenet newsreader (in English) <Michael> writes:
Moin Michael > Moin Uwe, > Nice idea, thx for sharing. Some comments below: Thanks for comments, this is work in progress. One problem that I have to solve later are newsgroups and mailing list, because right now the function complains in those circumstances, but I prefer to have false positives than false negatives, for the moment. >> 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? Right that was a desperate measure, since in the summary buffer itself to analyse the from field is very tricky. >> (unless >> (string-match user-mail-address (message-fetch-field "To")) > Slightly better: > (string-match-p (regexp-quote user-mail-address) > (message-fetch-field "To")) Ok >> (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'. Ok thanks >> >> (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. Right, defadvice is old and I copied that lines from some old code, so I will look into that later today. Uwe > Michael. -- 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