Add import_file_to_globals for use in emacs inferior lisp mode
This commit is contained in:
parent
1962826c1c
commit
6dc12dd703
@ -89,6 +89,15 @@ def import_file_to_module(module_name, fpath):
|
|||||||
return mod
|
return mod
|
||||||
|
|
||||||
|
|
||||||
|
def import_file_to_globals(env, module_name, fpath):
|
||||||
|
""" Import content from fpath and puts it into the dict provided
|
||||||
|
(e.g., for use in a REPL)
|
||||||
|
"""
|
||||||
|
mod = import_file_to_module(module_name, fpath)
|
||||||
|
for k, v in mod.__dict__.items():
|
||||||
|
env[k] = v
|
||||||
|
|
||||||
|
|
||||||
def import_buffer_to_module(module_name, buf):
|
def import_buffer_to_module(module_name, buf):
|
||||||
try:
|
try:
|
||||||
_ast = import_buffer_to_ast(buf, module_name)
|
_ast = import_buffer_to_ast(buf, module_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user