From 378c4a3d4917d78dd380f3677ba1d214dd2ca08b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 11 Jun 2026 09:28:15 +0300 Subject: [PATCH] ; Fix last change * etc/NEWS: * lisp/cus-edit.el (setopt-local-type-mismatch): Improve wording of documentation in last change. (Bug#81120) --- etc/NEWS | 19 ++++++++++--------- lisp/cus-edit.el | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 44c4ab282ba..6678b632d41 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -50,22 +50,23 @@ If this variable is nil, 'tty-cursor-movement-use-TAB-BS' has no effect, and Emacs will never use TABs for any cursor-movement sequences. --- -** File- and directory-locals respect user option setters. +** File- and directory-local variables respect user option setters. Values of variables that are user options mentioned in file-local -variable properties and directory-locals via ".dir-locals.el" are now +variable sections and directory-locals via ".dir-locals.el" are now set similarly to 'setopt-local'; i.e., if a user option has a defcustom ':set' function, that function will be invoked. --- ** New user option 'setopt-local-type-mismatch'. This option controls what 'setopt-local' does when it detects a type -mismatch between the specified value and the 'defcustom' of its user -option. Its backward-compatible default is nil which emits a warning -and accepts the type-mismatched value. If you customize it to non-nil, -you will be prompted to accept or ignore the value. If it is the symbol -'accept', warnings are inhibited and type-mismatched values are -accepted. If 'discard', warnings are inhibited and type-mismatched -values are discarded. +mismatch between the specified value and the :type specification of a +user option. Its backward-compatible default is nil which emits a +warning and accepts the type-mismatched value. You can control this by +customizing 'setopt-local-type-mismatch' to a non-nil value: the value +'accept' inhibits the warning and silently accepts type-mismatched +values; the value 'discard' inhibits the warning and discards +type-mismatched values; any other non-nil value prompts you whether to +accept or ignore the value. *** Specifying a minor mode as a local variables enables that mode, unconditionally. The previous behavior, toggling the mode, was diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index adc9d57b4ce..d1586a1cfe7 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1107,10 +1107,10 @@ even if it doesn't match the type.) ;;;###autoload (defcustom setopt-local-type-mismatch nil "Behavior of `setopt-local’ if value's type mismatches its definition. -If nil, emit a warning and assign the value. -If non-nil, prompt to accept or discard the value. +If nil, emit a warning, but accept the mismatched value. If the symbol `accept', ignore type mismatch warning and assign the value. If the symbol `discard', ignore warning and discard the mismatched value. +If any other non-nil value, prompt whether to accept or discard the value. Note: Accepting mismatched values may result in unexpected behavior." :type '(choice (const :tag "Emit a warning and accept the type value" nil) (const :tag "Prompt to accept or discard the value" t)