From: Stefan Monnier Date: Tue, 11 Jan 2022 03:37:16 +0000 (-0500) Subject: (hack-one-local-variable-constantp): Mark as obsolete X-Git-Tag: emacs-29.0.90~3141 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f4e0562a2c3474d7d5acaa474367ad9fdc02073f;p=emacs.git (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. --- 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)