Function: prolog-read-predicate

prolog-read-predicate is a byte-compiled function defined in prolog.el.gz.

Signature

(prolog-read-predicate)

Documentation

Read a PredSpec from the user.

Returned value is a string "FUNCTOR/ARITY". Interaction supports completion.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/prolog.el.gz
(defun prolog-read-predicate ()
  "Read a PredSpec from the user.
Returned value is a string \"FUNCTOR/ARITY\".
Interaction supports completion."
  (let ((default (prolog-atom-under-point)))
    ;; If the predicate index is not yet built, do it now
    (if (not prolog-info-alist)
        (prolog-build-info-alist))
    ;; Test if the default string could be the base for completion.
    ;; Discard it if not.
    (if (eq (try-completion default prolog-info-alist) nil)
        (setq default nil))
    ;; Read the PredSpec from the user
    (completing-read (format-prompt "Help on predicate" default)
                     prolog-info-alist nil t nil nil default)))