]> git.eshelyaron.com Git - emacs.git/commitdiff
* Introduce `comp-output-directory'
authorAndrea Corallo <akrl@sdf.org>
Sun, 3 May 2020 13:35:50 +0000 (14:35 +0100)
committerAndrea Corallo <akrl@sdf.org>
Sun, 3 May 2020 13:35:50 +0000 (14:35 +0100)
* lisp/emacs-lisp/comp.el (comp-output-directory): New function.
(comp-output-base-filename): Use `comp-output-directory'.

lisp/emacs-lisp/comp.el

index 05417fdc31c145511d328fa416c68717e4f604bc..f027bad65cffac56bed14c0cb385d1696c611107 100644 (file)
@@ -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))))