From 04ab3904eddc01af918fb85b8712cd5d45238468 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 2 Feb 2021 14:39:28 -0500 Subject: * lisp/gnus/gnus-art.el: Fix misuse of `standard-value`. * lisp/custom.el (custom--standard-value): New function. * lisp/gnus/gnus-art.el: (gnus-article-browse-html-parts) (gnus-article-browse-html-article): * lisp/dired-aux.el (dired-do-find-regexp-and-replace): * lisp/emacs-lisp/package-x.el (package-upload-buffer-internal): * lisp/startup.el (command-line): Use it. --- lisp/custom.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lisp/custom.el') diff --git a/lisp/custom.el b/lisp/custom.el index 5e354c4c595..833810718b7 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -350,7 +350,7 @@ for more information." ;; if you need to recompile all the Lisp files using interpreted code. `(custom-declare-variable ',symbol - ,(if lexical-binding ;FIXME: This is not reliable, but is all we have. + ,(if lexical-binding ;; The STANDARD arg should be an expression that evaluates to ;; the standard value. The use of `eval' for it is spread ;; over many different places and hence difficult to @@ -627,6 +627,10 @@ property, or (ii) an alias for another customizable variable." (or (get variable 'standard-value) (get variable 'custom-autoload)))) +(defun custom--standard-value (variable) + "Return the standard value of VARIABLE." + (eval (car (get variable 'standard-value)) t)) + (define-obsolete-function-alias 'user-variable-p 'custom-variable-p "24.3") (defun custom-note-var-changed (variable) -- cgit v1.2.1