From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/44975 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: patches add variable `gnus-confirm-mail-reply-to-news' Date: Sun, 26 May 2002 21:11:05 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1022440313 17640 127.0.0.1 (26 May 2002 19:11:53 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 26 May 2002 19:11:53 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17C3Qm-0004aP-00 for ; Sun, 26 May 2002 21:11:53 +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 17C3QV-000749-00; Sun, 26 May 2002 14:11:35 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 26 May 2002 14:11:49 -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 OAA08366 for ; Sun, 26 May 2002 14:11:29 -0500 (CDT) Original-Received: (qmail 14465 invoked by alias); 26 May 2002 19:11:08 -0000 Original-Received: (qmail 14460 invoked from network); 26 May 2002 19:11:07 -0000 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net (HELO yxa.extundo.com) (217.13.230.178) by gnus.org with SMTP; 26 May 2002 19:11:07 -0000 Original-Received: from latte.josefsson.org (yxa.extundo.com [217.13.230.178]) (authenticated bits=0) by yxa.extundo.com (8.12.3/8.12.3) with ESMTP id g4QJB5Wa026994 for ; Sun, 26 May 2002 21:11:05 +0200 Original-To: ding@gnus.org Mail-Copies-To: nobody In-Reply-To: (Raymond Scholz's message of "Sun, 26 May 2002 18:22:25 +0200") User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.3.50 (i686-pc-linux-gnu) X-Face: 1Yn@M+tp9bHO[8c_KMq4EAehxF;z,'j|yrivOiG+mxk$hnZac61A{@h6 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))