mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 09:14:18 +00:00
Generalize 'scrape-elpa--safe-evil'
* admin/scrape-elpa.el (scrape-elpa--safe-eval): Extend support from just 'cons' and 'concat' to any side-effect-free function.
This commit is contained in:
parent
5bc7185afa
commit
0afb026a99
1 changed files with 3 additions and 6 deletions
|
|
@ -43,12 +43,9 @@ be comprehensive, but just to handle the kinds of expressions that
|
|||
(cons
|
||||
(if (eq (car-safe car) '\,) (scrape-elpa--safe-eval (cadr car) vars) car)
|
||||
(if (eq (car-safe cdr) '\,) (scrape-elpa--safe-eval (cadr cdr) vars) cdr)))
|
||||
;; supported functions
|
||||
(`(cons ,car ,cdr)
|
||||
(cons (scrape-elpa--safe-eval car vars)
|
||||
(scrape-elpa--safe-eval cdr vars)))
|
||||
(`(concat . ,args)
|
||||
(apply #'concat (mapcar #'scrape-elpa--safe-eval args)))
|
||||
;; allow calling `side-effect-free' functions
|
||||
(`(,(and (pred symbolp) (pred (get _ 'side-effect-free)) fn) . ,args)
|
||||
(apply fn (mapcar #'scrape-elpa--safe-eval args)))
|
||||
;; self-evaluating forms
|
||||
((pred macroexp-const-p) exp)
|
||||
;; variable evaluation
|
||||
|
|
|
|||
Loading…
Reference in a new issue