pyorg.emacs module¶
Interface with Emacs and run commands.
-
class
pyorg.emacs.Emacs(cmd=('emacs', '--batch'), client=False, verbose=1)[source]¶ Bases:
objectInterface to Emacs program.
Parameters: -
eval(source, process=False, **kwargs)[source]¶ Evaluate ELisp source code and return output.
Parameters: - source (str or list) – Elisp code. If a list of strings will be enclosed in
progn. - process (bool) – If True return the
subprocess.CompletedProcessobject, otherwise just return the value ofstdout. - kwargs – Passed to
run().
Returns: Command output or completed process object, depending on value of
process.Return type: - source (str or list) – Elisp code. If a list of strings will be enclosed in
-
getoutput(args, **kwargs)[source]¶ Get output of command.
Parameters: Returns: Value of stdout.
Return type:
-
getresult(source, is_json=False, **kwargs)[source]¶ Get parsed result from evaluating the Elisp code.
Parameters: Returns: Return type: Parsed value.
-
run(args, check=True, verbose=None)[source]¶ Run the Emacs command with a list of arguments.
Parameters: Returns: Return type: Raises: subprocess.CalledProcessError– Ifcheck=Trueand return code is nonzero.
-