From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#60162: [PATCH] * lisp/cus-edit.el (setopt--set): Warn instead of rasing an error Date: Sat, 17 Dec 2022 16:35:08 +0000 Message-ID: <87a63mvvib.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35703"; mail-complaints-to="usenet@ciao.gmane.io" To: 60162@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 17 17:36:17 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p6aAb-00092u-DL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Dec 2022 17:36:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6aAO-0007Qu-CB; Sat, 17 Dec 2022 11:36:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6aAM-0007Qi-SP for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 11:36:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6aAM-0001mT-Ks for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 11:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p6aAM-00056O-GY for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 11:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Dec 2022 16:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60162 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167129491119600 (code B ref -1); Sat, 17 Dec 2022 16:36:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Dec 2022 16:35:11 +0000 Original-Received: from localhost ([127.0.0.1]:56795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6a9X-000564-F7 for submit@debbugs.gnu.org; Sat, 17 Dec 2022 11:35:11 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:59852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6a9V-00055w-Oo for submit@debbugs.gnu.org; Sat, 17 Dec 2022 11:35:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6a9V-0007Ja-JI for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 11:35:09 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6a9T-0001Wt-GW for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 11:35:09 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9A82D240027 for ; Sat, 17 Dec 2022 17:35:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1671294905; bh=IZtw7BJD/re1Ambhr3pM1eCbuTM2xLHNCQoW5uWYo7k=; h=From:To:Subject:Date:From; b=AEKx9ScxbSK/U0KaMiydrOs8lokLx8opZMR2n1ephngueCwLPwXcFQusiVAlqC81l bjixvjhB6VgMYZ9S+G9O6wD/sxn2aF8sPbImTS+j2+1Rh/1Fi/XjivIYGrX9oU3wIj CeFhl5hPHFHNbt1JF5LKxnjYh9w3jZrbaM9a/uV8e9DJQS30/tI5nVCEPNSkQsbFBS nS6/1TAydeNt59uEOSnS4BDNEcMx4EWLxBaLq9GzGCklAHAGY5iFk56JVmUQTzUM8w ue2NubTswl+CGU+eZxaEeXpeyEc5KgAHvSoRdh+mwyR46JFTfLU20A1r1Ei9nzflbb 8tyDaw5WyZ4Dg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NZBQd12S4z9rxD for ; Sat, 17 Dec 2022 17:35:04 +0100 (CET) Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251290 Archived-At: --=-=-= Content-Type: text/plain 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' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-lisp-cus-edit.el-setopt-set-Warn-instead-of-rasing-a.patch >From ced6b44050b417391e0675acc850d1a0030ef13f Mon Sep 17 00:00:00 2001 From: Philip Kaludercic 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 --=-=-=--