Federico Beffa (2015-06-21 11:29 +0300) wrote: [...] > +(define* (emacs-byte-compile-directory dir #:optional (dependency-dirs '())) > + "Byte compile all files in DIR and its sub-directories. Before compiling > +the files, add DIR and all directories in DEPENDENCY-DIRS to 'load-path'." > + (let ((expr `(progn > + (add-to-list 'load-path ,dir) > + (unless (null ,(if (null? dependency-dirs) > + 'nil > + dependency-dirs)) > + (setq load-path (append load-path ,dependency-dirs))) > + (byte-recompile-directory (file-name-as-directory ,dir) 0)))) > + (emacs-batch-eval expr))) > + > (define-syntax emacs-substitute-sexps > (syntax-rules () > "Substitute the S-expression immediately following the first occurrence of Shouldn't there be problems with unquoted 'dependency-dirs' list? IIUC the following: (emacs-byte-compile-directory "/tmp/foo" '("one" "two")) will produce the following elisp expression: (progn (add-to-list (quote load-path) "/tmp/foo") (unless (null ("one" "two")) (setq load-path (append load-path ("one" "two")))) (byte-recompile-directory (file-name-as-directory "/tmp/foo") 0)) but that will raise an error ‘(invalid-function "one")’. Or did I miss anything? Also I believe dependency-dirs should have a preference over other 'load-path' directories. So what about the following variant: