diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm index 8156757be..b77984742 100644 --- a/guix/build/emacs-build-system.scm +++ b/guix/build/emacs-build-system.scm @@ -116,22 +116,21 @@ store in '.el' files." ;; strings containing NULs. Filter out such files. TODO: Remove ;; this workaround when is fixed. (el-files (remove file-contains-nul-char? - (find-files "." "\\.el$"))) - - (substitute-cmd (lambda () + (find-files (getcwd) "\\.el$")))) + (define (substitute-program-names) (substitute* el-files (("\"/bin/([^.]\\S*)\"" _ cmd-name) (let ((cmd (which cmd-name))) (unless cmd - (error - "patch-el-files: unable to locate " cmd-name)) - (string-append "\"" cmd "\""))))))) + (error "patch-el-files: unable to locate " cmd-name)) + (string-append "\"" cmd "\""))))) + (with-directory-excursion el-dir - ;; Some old '.el' files (e.g., tex-buf.el in AUCTeX) are still encoded - ;; with the "ISO-8859-1" locale. - (unless (false-if-exception (substitute-cmd)) + ;; Some old '.el' files (e.g., tex-buf.el in AUCTeX) are still + ;; ISO-8859-1-encoded. + (unless (false-if-exception (substitute-program-names)) (with-fluids ((%default-port-encoding "ISO-8859-1")) - (substitute-cmd)))) + (substitute-program-names)))) #t)) (define* (install #:key outputs