all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#60162: [PATCH] * lisp/cus-edit.el (setopt--set): Warn instead of rasing an error
@ 2022-12-17 16:35 Philip Kaludercic
  2022-12-17 17:40 ` Drew Adams
  2022-12-18 11:28 ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Philip Kaludercic @ 2022-12-17 16:35 UTC (permalink / raw)
  To: 60162

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

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'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-cus-edit.el-setopt-set-Warn-instead-of-rasing-a.patch --]
[-- Type: text/patch, Size: 904 bytes --]

From ced6b44050b417391e0675acc850d1a0030ef13f Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-18 11:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-17 16:35 bug#60162: [PATCH] * lisp/cus-edit.el (setopt--set): Warn instead of rasing an error Philip Kaludercic
2022-12-17 17:40 ` Drew Adams
2022-12-17 18:00   ` Philip Kaludercic
2022-12-17 20:53     ` Drew Adams
2022-12-17 22:19       ` Philip Kaludercic
2022-12-18 11:28 ` Eli Zaretskii
2022-12-18 11:46   ` Philip Kaludercic

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.