Gnus development mailing list
 help / color / mirror / Atom feed
From: Raymond Scholz <ray-2002@zonix.de>
Subject: Re: patches add variable `gnus-confirm-mail-reply-to-news'
Date: Wed, 16 Oct 2002 17:31:42 +0200	[thread overview]
Message-ID: <gd.y1yof9ue6xt.fsf@fly.verified.de> (raw)
In-Reply-To: <ilusn4eafna.fsf@latte.josefsson.org>

[Full quote, because the original posting is rather erm... well, what
 time makes of a posting that has been forgotten in a folder named
 "TODO" for some months]

* Simon Josefsson <jas@extundo.com> wrote:

> Raymond Scholz <ray-2002@zonix.de> writes:
>
>> Simon Josefsson <jas@extundo.com> 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."



  reply	other threads:[~2002-10-16 15:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-21  2:41 Benjamin Rutt
2002-05-21  9:36 ` Simon Josefsson
2002-05-21 10:46   ` Kai Großjohann
2002-05-21 12:49     ` Simon Josefsson
2002-05-21 17:11       ` Benjamin Rutt
2002-05-21 17:19         ` Benjamin Rutt
2002-05-22  8:52       ` Russ Allbery
2002-05-22  9:10         ` Simon Josefsson
2002-05-22 21:44           ` Benjamin Rutt
2002-05-23 21:36           ` Benjamin Rutt
2002-05-26 16:22           ` Raymond Scholz
2002-05-26 19:11             ` Simon Josefsson
2002-10-16 15:31               ` Raymond Scholz [this message]
2002-06-09  9:45 ` Thomas Skogestad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gd.y1yof9ue6xt.fsf@fly.verified.de \
    --to=ray-2002@zonix.de \
    --cc=rscholz@zonix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).