From f4e0562a2c3474d7d5acaa474367ad9fdc02073f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 10 Jan 2022 22:37:16 -0500 Subject: [PATCH] (hack-one-local-variable-constantp): Mark as obsolete * 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 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index cd43b94622e..48e0252e060 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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) -- 2.39.5