unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 51335@debbugs.gnu.org
Subject: bug#51335: 29.0.50; Use warnings facility for reporting Gnus errors
Date: Sat, 04 Dec 2021 12:42:18 -0800	[thread overview]
Message-ID: <87wnkkayqd.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87k0hkjd8j.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 07 Nov 2021 14:40:12 +0100")

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]

Continuing a more piecemeal approach to this, here's a patch to change
the mail source error behavior. I'm floating it for review because it
involves removing a user-facing option. If this goes in, should that
removal be mentioned in NEWS?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-gnus-error-to-report-mail-source-failures.patch --]
[-- Type: text/x-patch, Size: 2935 bytes --]

From 9d4359a72cd042a6357773c62fb70fc0c678a3cf Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Sat, 4 Dec 2021 12:37:14 -0800
Subject: [PATCH] Use gnus-error to report mail-source failures

* lisp/gnus/mail-source.el (mail-source-fetch): Instead of querying
the user on mail sources errors -- in effect asking "do you want to
continue, or halt the process?" -- log the error with `gnus-error',
severity 5. The query didn't provide any meaningful control; error
reporting is all that's needed.
(mail-source-ignore-errors): Obsolete this option; users can see the
error or not by configuring `gnus-verbose'.
* doc/misc/gnus.texi (Mail Source Customization): Remove mention of
the above option from the manual.
---
 doc/misc/gnus.texi       |  4 ----
 lisp/gnus/mail-source.el | 19 +++++++------------
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index a18afec02e..6ffc057ba1 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -15447,10 +15447,6 @@ Mail Source Customization
 files.  This variable only applies when
 @code{mail-source-delete-incoming} is a positive number.
 
-@item mail-source-ignore-errors
-@vindex mail-source-ignore-errors
-If non-@code{nil}, ignore errors when reading mail from a mail source.
-
 @item mail-source-directory
 @vindex mail-source-directory
 Directory where incoming mail source files (if any) will be stored.  The
diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el
index af0a198376..efdddea69f 100644
--- a/lisp/gnus/mail-source.el
+++ b/lisp/gnus/mail-source.el
@@ -224,12 +224,9 @@ mail-sources
 					   (const :format "" :value :plugged)
 					   (boolean :tag "Plugged"))))))))
 
-(defcustom mail-source-ignore-errors nil
-  "Ignore errors when querying mail sources.
-If nil, the user will be prompted when an error occurs.  If non-nil,
-the error will be ignored."
-  :version "22.1"
-  :type 'boolean)
+(make-obsolete-variable 'mail-source-ignore-errors
+                        "configure `gnus-verbose' instead"
+                        "29.1")
 
 (defcustom mail-source-primary-source nil
   "Primary source for incoming mail.
@@ -554,18 +551,16 @@ mail-source-fetch
 		 (condition-case err
 		     (funcall function source callback)
 		   (error
-		    (if (and (not mail-source-ignore-errors)
-			     (not
-			      (yes-or-no-p
-			       (format "Mail source %s error (%s).  Continue? "
+                    (gnus-error
+                     5
+                     (format "Mail source %s error (%s)"
 				       (if (memq ':password source)
 					   (let ((s (copy-sequence source)))
 					     (setcar (cdr (memq ':password s))
 						     "********")
 					     s)
 					 source)
-				       (cadr err)))))
-		      (error "Cannot get new mail"))
+				       (cadr err)))
 		    0)))))))))
 
 (declare-function gnus-message "gnus-util" (level &rest args))
-- 
2.34.1


  reply	other threads:[~2021-12-04 20:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22 17:04 bug#51335: 29.0.50; Use warnings facility for reporting Gnus errors Eric Abrahamsen
2021-10-24 18:37 ` Lars Ingebrigtsen
2021-10-25 18:28   ` Eric Abrahamsen
2021-10-25 18:33     ` Eric Abrahamsen
2021-10-27 13:01     ` Lars Ingebrigtsen
2021-11-06  0:03       ` Eric Abrahamsen
2021-11-06 18:18         ` Lars Ingebrigtsen
2021-11-06 21:17 ` Eric Abrahamsen
2021-11-07 13:40   ` Lars Ingebrigtsen
2021-12-04 20:42     ` Eric Abrahamsen [this message]
2021-12-04 22:13       ` Lars Ingebrigtsen
2022-09-13 14:45         ` Lars Ingebrigtsen
2022-11-07 20:53           ` Eric Abrahamsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87wnkkayqd.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=51335@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).