Subject: bug#60162: closed (Re: bug#60162: [PATCH] * lisp/cus-edit.el (setopt--set): Warn instead of rasing an error)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 18 Dec 2022 11:47:03 +0000

Your bug report

#60162: [PATCH] * lisp/cus-edit.el (setopt--set): Warn instead of rasing an error

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
60162: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60162
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#60162: [PATCH] * lisp/cus-edit.el (setopt--set): Warn instead of rasing an error
From: Philip Kaludercic <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked]
Date: Sun, 18 Dec 2022 11:46:36 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Eli Zaretskii <[email-masked]> writes:

>> From: Philip Kaludercic <[email-masked]>
>> Date: Sat, 17 Dec 2022 16:35:08 +0000
>> 
>> Setopt checks the :type of a user option, and raises an user-error if
>> the value doesn't match the type.  This can be annoying during
>> initialisation, because minor mistakes interrupt everything and you are
>> let with a partially loaded configuration.
>> 
>> I'd propose replacing the `user-error' with a `warn', that would still
>> indicate mistakes, but continue loading the init.el.
>
> This is fine by me, please install on the release branch.

Done.

Subject: [PATCH] * lisp/cus-edit.el (setopt--set): Warn instead of rasing an error
From: Philip Kaludercic <[email-masked]>
To: [email-masked]
Date: Sat, 17 Dec 2022 16:35:08 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

Setopt checks the :type of a user option, and raises an user-error if
the value doesn't match the type.  This can be annoying during
initialisation, because minor mistakes interrupt everything and you are
let with a partially loaded configuration.

I'd propose replacing the `user-error' with a `warn', that would still
indicate mistakes, but continue loading the init.el.

In GNU Emacs 29.0.60 (build 5, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.16.0) of 2022-12-14 built on quetzal
Repository revision: 622838b957e240d700585050e9ddbd036e690513
Repository branch: emacs-29
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure --with-pgtk --with-imagemagick'

>From ced6b44050b417391e0675acc850d1a0030ef13f Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <[email-masked]>
Date: Sat, 17 Dec 2022 17:29:24 +0100
Subject: [PATCH] * lisp/cus-edit.el (setopt--set): Warn instead of rasing an
 error

---
 lisp/cus-edit.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 0e09e99da9..ab2f74dbb8 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1073,7 +1073,7 @@ setopt--set
   ;; Check that the type is correct.
   (when-let ((type (get variable 'custom-type)))
     (unless (widget-apply (widget-convert type) :match value)
-      (user-error "Value `%S' does not match type %s" value type)))
+      (warn "Value `%S' does not match type %s" value type)))
   (put variable 'custom-check-value (list value))
   (funcall (or (get variable 'custom-set) #'set-default) variable value))
 
-- 
2.35.1