Function: run-prolog

run-prolog is an autoloaded, interactive and byte-compiled function defined in prolog.el.gz.

Signature

(run-prolog ARG)

Documentation

Run an inferior Prolog process, input and output via buffer *prolog*.

With prefix argument ARG, restart the Prolog process if running before.

Key Bindings

Aliases

switch-to-prolog (obsolete since 24.1)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/prolog.el.gz
(define-obsolete-function-alias 'switch-to-prolog 'run-prolog "24.1") ; "24.4" ; for grep
;;;###autoload
(defun run-prolog (arg)
  "Run an inferior Prolog process, input and output via buffer *prolog*.
With prefix argument ARG, restart the Prolog process if running before."
  (interactive "P")
  ;; FIXME: It should be possible to interactively specify the command to use
  ;; to run prolog.
  (if (and arg (get-process "prolog"))
      (progn
        (process-send-string "prolog" "halt.\n")
        (while (get-process "prolog") (sit-for 0.1))))
  (prolog-ensure-process)
  (let ((buff (buffer-name)))
    (if (not (string= buff "*prolog*"))
        (prolog-goto-prolog-process-buffer))
    ;; Load SICStus debugger if suitable
    (if (and (eq prolog-system 'sicstus)
             (prolog-atleast-version '(3 . 7))
             prolog-use-sicstus-sd)
        (prolog-enable-sicstus-sd))
    (prolog-mode-variables)
    ))