Function: prolog-help-info
prolog-help-info is a byte-compiled function defined in prolog.el.gz.
Signature
(prolog-help-info PREDICATE)
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/prolog.el.gz
(defun prolog-help-info (predicate)
(let ((buffer (current-buffer))
oldp
(str (concat "^\\* " (regexp-quote predicate) " */")))
(pop-to-buffer nil)
(Info-goto-node prolog-info-predicate-index)
(if (not (re-search-forward str nil t))
(error "Help on predicate `%s' not found" predicate))
(setq oldp (point))
(if (re-search-forward str nil t)
;; Multiple matches, ask user
(let ((max 2)
n)
;; Count matches
(while (re-search-forward str nil t)
(setq max (1+ max)))
(goto-char oldp)
(re-search-backward "[^ /]" nil t)
(recenter 0)
(setq n (read-string ;; was read-input, which is obsolete
(format "Several matches, choose (1-%d): " max) "1"))
(forward-line (- (string-to-number n) 1)))
;; Single match
(re-search-backward "[^ /]" nil t))
(Info-follow-nearest-node)
(re-search-forward (concat "^`" (regexp-quote predicate)) nil t)
(beginning-of-line)
(recenter 0)
(pop-to-buffer buffer)))