emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master f4e0562a2c: (hack-one-local-variable-constantp): Mark as obsolete


From: Stefan Monnier
Subject: master f4e0562a2c: (hack-one-local-variable-constantp): Mark as obsolete
Date: Mon, 10 Jan 2022 22:37:32 -0500 (EST)

branch: master
commit f4e0562a2c3474d7d5acaa474367ad9fdc02073f
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    (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 cd43b94622..48e0252e06 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]