From 8d372201904bcb5fe6cb14aa5c45f33e6e1cd815 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 3 May 2020 14:35:50 +0100 Subject: [PATCH] * Introduce `comp-output-directory' * lisp/emacs-lisp/comp.el (comp-output-directory): New function. (comp-output-base-filename): Use `comp-output-directory'. --- lisp/emacs-lisp/comp.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 05417fdc31c..f027bad65cf 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -443,13 +443,19 @@ VERBOSITY is a number between 0 and 3." 2)) edges))) +(defun comp-output-directory (src) + "Return the compilation direcotry for source SRC." + (let* ((src (if (symbolp src) (symbol-name src) src)) + (expanded-filename (expand-file-name src))) + (file-name-as-directory + (concat (file-name-directory expanded-filename) + comp-native-path-postfix)))) + (defun comp-output-base-filename (src) "Output filename sans extention for SRC file being native compiled." (let* ((src (if (symbolp src) (symbol-name src) src)) (expanded-filename (expand-file-name src)) - (output-dir (file-name-as-directory - (concat (file-name-directory expanded-filename) - comp-native-path-postfix))) + (output-dir (comp-output-directory src)) (output-filename (file-name-sans-extension (file-name-nondirectory expanded-filename)))) -- 2.39.5