]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/gnus/gnus-art.el: Fix misuse of `standard-value`.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 2 Feb 2021 19:39:28 +0000 (14:39 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 2 Feb 2021 19:39:28 +0000 (14:39 -0500)
* 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
lisp/dired-aux.el
lisp/emacs-lisp/package-x.el
lisp/gnus/gnus-art.el
lisp/startup.el

index 5e354c4c595e21e74d172372c44902ad82cb5c09..833810718b7eaf9082fce5024df051cfdc676f89 100644 (file)
@@ -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)
index ec864d54d69bc5d792d538b896bc05d98bae1a84..a94bdf5b42ef5cf1be0b5286328e60d6e7fae5d1 100644 (file)
@@ -3148,7 +3148,7 @@ REGEXP should use constructs supported by your local `grep' command."
   (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)))
 
index b723643ffb9fdc50230efdb39a091dd916a8e54e..2e327d16de485750d0ed155289b2d6bfb6591314 100644 (file)
@@ -182,8 +182,7 @@ if it exists."
     ;; 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: ")))
index 39b182f2cda7f92789cfdc80c94d6e618243f6aa..70ededf1ba18c9cc8e6784ee8e8d06c7df685f1c 100644 (file)
@@ -3010,8 +3010,7 @@ message header will be added to the bodies of the \"text/html\" parts."
               (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)
@@ -3045,8 +3044,8 @@ images if any to the browser, and deletes them when exiting the group
   (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))
index 60e1a200bbdd56378437baa032fb3df5e0ff3e2f..b173d619733f34013c5229afd46b4b05a28a4e77 100644 (file)
@@ -1386,7 +1386,7 @@ please check its value")
         (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