master cc78db98f17: ; Backward compatibility for variables set via 'setopt--set-local' (bug#81120)

Eli Zaretskii <[email protected]>
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: master
commit cc78db98f1774e2f3bc9f5df60c1fccb6f9f36da
Author: Stéphane Marks <[email protected]>
Commit: Eli Zaretskii <[email protected]>

    ; Backward compatibility for variables set via 'setopt--set-local' (bug#81120)
    
    Ensure that buffer locals are set despite setters not supporting
    'buffer-local (signaling an error is too heavy handed).
    
    * lisp/cus-edit.el (setopt--set-local): If the defcustom setter
    does not support 'setopt-local', warn and set the buffer local.
---
 lisp/cus-edit.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index f592a913546..18e649987f2 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1181,7 +1181,8 @@ Consult `setopt-local-type-mismatch'."
                        (lambda (x v &optional _) (set-local x v)))
                    variable value 'buffer-local)
         (wrong-number-of-arguments
-         (error "The setter of %S does not support setopt-local" variable))))))
+         (warn "The setter of %S lacks support for setopt-local" variable)
+         (set-local variable value))))))
 
 ;;;###autoload
 (defun customize-save-variable (variable value &optional comment)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.