From 80eb1dc449c169c172a5ff2b4de543481c7057bd Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 3 Aug 2018 02:46:48 +0200 Subject: [PATCH] Fix file-exists-p! with nested forms Due to the eval not picking up lexical bindings. --- core/core-lib.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/core/core-lib.el b/core/core-lib.el index 4406c3627..c64bd6133 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -57,19 +57,18 @@ This is used by `associate!', `file-exists-p!' and `project-file-exists-p!'." ,(if (file-name-absolute-p spec) spec `(expand-file-name ,spec ,directory)))) - ((symbolp spec) - `(file-exists-p ,(if (and directory - (or (not (stringp directory)) - (file-name-absolute-p directory))) - `(expand-file-name ,spec ,directory) - spec))) ((and (listp spec) (memq (car spec) '(or and))) `(,(car spec) ,@(cl-loop for i in (cdr spec) collect (doom--resolve-path-forms i directory)))) - ((listp spec) - (doom--resolve-path-forms (eval spec t) directory)) + ((or (symbolp spec) + (listp spec)) + `(file-exists-p ,(if (and directory + (or (not (stringp directory)) + (file-name-absolute-p directory))) + `(expand-file-name ,spec ,directory) + spec))) (t spec))) (defun doom--resolve-hook-forms (hooks)