]> git.eshelyaron.com Git - emacs.git/commitdiff
(hack-one-local-variable-constantp): Mark as obsolete
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 11 Jan 2022 03:37:16 +0000 (22:37 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 11 Jan 2022 03:37:16 +0000 (22:37 -0500)
* lisp/files.el (hack-one-local-variable-constantp): Mark as obsolete.
(hack-one-local-variable-eval-safep): Use `macroexp-const-p` instead.

lisp/files.el

index cd43b94622e9c93af5fe5f170d67d1670651036f..48e0252e0608c36524b301be616c5c58e85a5411 100644 (file)
@@ -4083,11 +4083,8 @@ It is dangerous if either of these conditions are met:
 (defun hack-one-local-variable-quotep (exp)
   (and (consp exp) (eq (car exp) 'quote) (consp (cdr exp))))
 
-(defun hack-one-local-variable-constantp (exp)
-  (or (and (not (symbolp exp)) (not (consp exp)))
-      (memq exp '(t nil))
-      (keywordp exp)
-      (hack-one-local-variable-quotep exp)))
+(define-obsolete-function-alias 'hack-one-local-variable-constantp
+  #'macroexp-const-p "29.1")
 
 (defun hack-one-local-variable-eval-safep (exp)
   "Return non-nil if it is safe to eval EXP when it is found in a file."
@@ -4125,7 +4122,7 @@ It is dangerous if either of these conditions are met:
                 (cond ((eq prop t)
                        (let ((ok t))
                          (dolist (arg (cdr exp))
-                           (unless (hack-one-local-variable-constantp arg)
+                           (unless (macroexp-const-p arg)
                              (setq ok nil)))
                          ok))
                       ((functionp prop)