* 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.
;; 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
(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)
(with-current-buffer
(let ((xref-show-xrefs-function
;; Some future-proofing (bug#44905).
- (eval (car (get 'xref-show-xrefs-function 'standard-value)))))
+ (custom--standard-value 'xref-show-xrefs-function)))
(dired-do-find-regexp from))
(xref-query-replace-in-results from to)))
;; Check if `package-archive-upload-base' is valid.
(when (or (not (stringp package-archive-upload-base))
(equal package-archive-upload-base
- (car-safe
- (get 'package-archive-upload-base 'standard-value))))
+ (custom--standard-value 'package-archive-upload-base)))
(setq package-archive-upload-base
(read-directory-name
"Base directory for package archive: ")))
(when header
(article-decode-encoded-words)
(let ((gnus-visible-headers
- (or (get 'gnus-visible-headers 'standard-value)
- gnus-visible-headers)))
+ (custom--standard-value 'gnus-visible-headers)))
(article-hide-headers))
(goto-char (point-min))
(search-forward "\n\n" nil 'move)
(interactive "P")
(if arg
(gnus-summary-show-article)
- (let ((gnus-visible-headers (or (get 'gnus-visible-headers 'standard-value)
- gnus-visible-headers))
+ (let ((gnus-visible-headers
+ (custom--standard-value 'gnus-visible-headers))
(gnus-mime-display-attachment-buttons-in-header nil)
;; As we insert a <hr>, there's no need for the body boundary.
(gnus-treat-body-boundary nil))
(equal user-mail-address
(let (mail-host-address)
(ignore-errors
- (eval (car (get 'user-mail-address 'standard-value))))))
+ (custom--standard-value 'user-mail-address))))
(custom-reevaluate-setting 'user-mail-address))
;; If parameter have been changed in the init file which influence