From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/47226 Path: main.gmane.org!not-for-mail From: Raymond Scholz Newsgroups: gmane.emacs.gnus.general Subject: Re: patches add variable `gnus-confirm-mail-reply-to-news' Date: Wed, 16 Oct 2002 17:31:42 +0200 Organization: =?UTF-8?Q?/=CB=8C=C9=94=CB=90=C9=A1=C9=99na=C9=AA=CB=88ze=C9=AA=CA=83n/?= Sender: owner-ding@hpc.uh.edu Message-ID: References: Reply-To: Raymond Scholz NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1034782384 32506 80.91.224.249 (16 Oct 2002 15:33:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 16 Oct 2002 15:33:04 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 181qAP-0008Rd-00 for ; Wed, 16 Oct 2002 17:33:01 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 181qAC-00041W-00; Wed, 16 Oct 2002 10:32:48 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 16 Oct 2002 10:33:30 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id KAA05344 for ; Wed, 16 Oct 2002 10:33:13 -0500 (CDT) Original-Received: (qmail 8348 invoked by alias); 16 Oct 2002 15:32:25 -0000 Original-Received: (qmail 8343 invoked from network); 16 Oct 2002 15:32:25 -0000 Original-Received: from quimby.gnus.org (80.91.224.244) by gnus.org with SMTP; 16 Oct 2002 15:32:25 -0000 Original-Received: from news by quimby.gnus.org with local (Exim 3.12 #1 (Debian)) id 181r0V-0004Dp-00 for ; Wed, 16 Oct 2002 18:26:51 +0200 Original-To: ding@gnus.org Original-Path: fly.verified.de!not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 129 Original-NNTP-Posting-Host: acb17bef.ipt.aol.com Original-X-Trace: quimby.gnus.org 1034785611 16232 172.177.123.239 (16 Oct 2002 16:26:51 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 16 Oct 2002 16:26:51 GMT X-Now-Playing: Nothing X-Face: %.!RBc`e*wW)84O*\)VdkC}mU5c2Zh$y~ZRA3K594g/jp_&5bx\Oyes!/jK~4<<%KlaPn^\ 0 wrote: > Raymond Scholz writes: > >> Simon Josefsson writes: >> >>> I agree. Ok, I added the original patch that defaults to not asking. Thanks. >> >> I used to have this in my .gnus for ages: >> >> (setq rs-mailing-lists "list\\.") >> >> ;; Patric Mueller in <7iq1t9.m63.ln@bhaak.xodox.com> >> ;; von mir erweitert um die Abfrage auf Mailinglisten >> (defadvice gnus-summary-reply (around reply-in-news activate) >> (when (or >> (not (or (gnus-news-group-p >> (if (gnus-virtual-group-p gnus-newsgroup-name) >> (car (nnvirtual-map-article (cdr gnus-article-current))) >> gnus-newsgroup-name >> )) >> (string-match rs-mailing-lists gnus-newsgroup-name))) >> (y-or-n-p "Really, really reply? ")) >> ad-do-it)) >> >> It adds "support" for virtual groups that contain newsgroups and for >> user defined lists (all of my mailing lists) where I usually don't >> want to say `R'. >> >> Would it be useful to be added to Gnus or is it too specifically >> tailored for my personal needs? > > I didn't test this, but it should add support for setting the variable > to a string or function to get the behaviour you want. Does it work? > > --- gnus-msg.el.~6.90.~ Thu May 23 23:57:20 2002 > +++ gnus-msg.el Sun May 26 21:09:26 2002 > @@ -242,9 +242,15 @@ > (defcustom gnus-confirm-mail-reply-to-news nil > "If non-nil, Gnus requests confirmation when replying to news. > This is done because new users often reply by mistake when reading > -news." > +news. > +This can also be a function which should return non-nil iff a > +confirmation is needed, or a regexp, in which case a confirmation is > +asked if the group name matches the regexp." > :group 'gnus-message > - :type 'boolean) > + :type '(choice (const :tag "No" nil) > + (const :tag "Yes" nil) > + (regexp :tag "Iff group matches regexp") > + (function :tag "Iff function evaluates to non-nil"))) > > ;;; Internal variables. > > @@ -988,7 +994,11 @@ > ;; Allow user to require confirmation before replying by mail to the > ;; author of a news article. > (when (or (not (gnus-news-group-p gnus-newsgroup-name)) > - (not gnus-confirm-mail-reply-to-news) > + (not (cond ((stringp gnus-confirm-mail-reply-to-news) > + (string-match gnus-confirm-mail-reply-to-news gnus-newsgroup-name)) > + ((functionp gnus-confirm-mail-reply-to-news) > + (funcall gnus-confirm-mail-reply-to-news)) > + (t gnus-confirm-mail-reply-to-news))) > (y-or-n-p "Really reply by mail to article author? ")) > (let* ((article > (if (listp (car yank)) This kind of works for news groups but it doesn't for mail because (gnus-news-group-p gnus-newsgroup-name) is always nil then. As I treat mailing lists like news groups regarding personal replies, the only way to solve this is to disable this condition. What about another variable like `gnus-confirm-treat-mail-like-news'? --- gnus-msg.el 2002/09/25 23:45:17 6.100 +++ gnus-msg.el 2002/10/16 16:22:51 @@ -256,8 +256,23 @@ (defcustom gnus-confirm-mail-reply-to-news nil "If non-nil, Gnus requests confirmation when replying to news. This is done because new users often reply by mistake when reading -news." +news. +This can also be a function which should return non-nil iff a +confirmation is needed, or a regexp, in which case a confirmation is +asked if the group name matches the regexp." :group 'gnus-message + :type '(choice (const :tag "No" nil) + (const :tag "Yes" nil) + (regexp :tag "Iff group matches regexp") + (function :tag "Iff function evaluates to non-nil"))) + +(defcustom gnus-confirm-treat-mail-like-news + nil + "If non-nil, Gnus will treat mail like news with regard to confirmation +when replying by mail. See the `gnus-confirm-mail-reply-to-news' variable +for fine-tuning this. +If nil, Gnus will never ask for confirmation if replying to mail." + :group 'gnus-message :type 'boolean) (defcustom gnus-summary-resend-default-address t @@ -1025,9 +1040,15 @@ (list (and current-prefix-arg (gnus-summary-work-articles 1)))) ;; Allow user to require confirmation before replying by mail to the - ;; author of a news article. - (when (or (not (gnus-news-group-p gnus-newsgroup-name)) - (not gnus-confirm-mail-reply-to-news) + ;; author of a news article (or mail message). + (when (or + (not (or (gnus-news-group-p gnus-newsgroup-name) + gnus-confirm-treat-mail-like-news)) + (not (cond ((stringp gnus-confirm-mail-reply-to-news) + (string-match gnus-confirm-mail-reply-to-news gnus-newsgroup-name)) + ((functionp gnus-confirm-mail-reply-to-news) + (funcall gnus-confirm-mail-reply-to-news)) + (t gnus-confirm-mail-reply-to-news))) (y-or-n-p "Really reply by mail to article author? ")) (let* ((article (if (listp (car yank)) Cheers, Ray -- "The main failure in computers is usually between keyboard and chair."