Commit f2559269 authored by Zach S's avatar Zach S

Accept an output filename in source-map-file

* source-mapping/source-map.el (source-map-file): Add optional
output-file-name argument.
parent d95c7f4c
......@@ -27,7 +27,8 @@
(require 'edebug)
(require 'pp)
(eval-when-compile
(require 'cl-lib))
(require 'cl-lib)
(require 'subr-x))
(cl-defstruct (source-map-expression
(:constructor nil)
......@@ -193,7 +194,7 @@ STREAM (or `standard-input' if nil) must be a buffer."
(defconst source-map-file-name-extension ".eld")
(defun source-map-file (file)
(defun source-map-file (file &optional output-file-name)
"Emit source-code mappings for FILE.
FILE should contain ELisp. A new file is created in the same
......@@ -202,8 +203,11 @@ The file contains `source-map-top-level-form's for each top level
expression in FILE."
(interactive "fFile to map: ")
(setq file (expand-file-name file))
(let* ((dest (concat (file-name-sans-extension file)
source-map-file-name-extension))
(let* ((dest (thread-first (if output-file-name
(expand-file-name output-file-name)
file)
(file-name-sans-extension)
(concat source-map-file-name-extension)))
(print-level nil)
(print-length nil)
(print-gensym t)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment