Home

Awesome

sourcemap.el Build Status melpa badge melpa stable badge

sourcemap parser in Emacs Lisp. Only supports decoder now.

Installation

You can install sourcemap from MELPA and MELPA stable

You can install sourcemap with the following command.

<kbd>M-x package-install [RET] sourcemap [RET]</kbd>

Interface

(sourcemap-original-position-for sourcemap properties)

Find line and column of original file from specified properties.

properties is plist and should have following properties

Return value is property list which has :line and :column.

With an optional :nearest property, return the closest matching location.

(sourcemap-generated-position-for sourcemap properties)

Find line and column of generated file from specified properties.

properties is plist and should have following properties

With an optional :nearest property, return the closest matching location.

(sourcemap-goto-corresponding-point properties)

Go to corresponding point.

This is useful for compiling command of coffee-mode. You can use this for moving point in compiled JavaScript file which corresponding to cursor point in CoffeeScript. If you want to use this feature, add following configuration.

(setq coffee-args-compile '("-c" "-m")) ;; generating sourcemap file
(add-hook 'coffee-after-compile-hook 'sourcemap-goto-corresponding-point)

properties is plist and should have following properties

(sourcemap-from-file file)

Parse file as sourcemap and return sourcemap instance

(sourcemap-from-string string)

Parse string as sourcemap and return sourcemap instance