Go to the first, previous, next, last section, table of contents.


Calling emacs from Prolog

Author(s): The CLIP Group.

Version: 1.10#7 (2006/4/26, 19:22:13 CEST)

Version of last change: 1.9#234 (2003/12/22, 18:14:10 CET)

This library provides a prolog-emacs interface. This interface is complementary to (and independent from) the emacs mode, which is used to develop programs from within the emacs editor/environment. Instead, this library allows calling emacs from a running Prolog program. This facilitates the use of emacs as a "user interface" for a Prolog program. Emacs can be made to:

In order for this library to work correctly, the following is needed:

This suffices for using emacs to edit files. For running arbitrary code the following also needs to be added to the .emacs file:

(setq enable-local-eval t)
Allows executing lisp code without asking.
(setq enable-local-eval nil)
Does not allow executing lisp code without asking.
(setq enable-local-eval 'maybe)
Allows executing lisp code only if user agrees after asking (asks interactively for every invocation).

Examples:

Assuming that a .pl file loads this library, then:

..., emacs_edit('foo'), ...
Opens file foo for editing in emacs.
..., emacs_eval_nowait("(run-ciao-toplevel)"), ...
Starts execution of a Ciao top-level within emacs.

Usage and interface (emacs)

Documentation on exports (emacs)

PREDICATE: emacs_edit/1:

Usage: emacs_edit(+filename)

PREDICATE: emacs_edit_nowait/1:

Usage: emacs_edit_nowait(+filename)

PREDICATE: emacs_eval/1:

Usage: emacs_eval(+elisp_string)

PREDICATE: emacs_eval_nowait/1:

Usage: emacs_eval_nowait(+elisp_string)

REGTYPE: elisp_string/1:

Usage: elisp_string(L)


Go to the first, previous, next, last section, table of contents.