Function: antlr-read-value
antlr-read-value is a byte-compiled function defined in
antlr-mode.el.gz.
Signature
(antlr-read-value INITIAL-CONTENTS PROMPT &optional AS-STRING TABLE TABLE-X)
Documentation
Read a string from the minibuffer, possibly with completion.
If INITIAL-CONTENTS is non-nil, insert it in the minibuffer initially.
PROMPT is a string to prompt with, normally it ends in a colon and a
space. If AS-STRING is t or is a member (comparison done with eq) of
antlr-options-style, return printed representation of the user input,
otherwise return the user input directly.
If TABLE or TABLE-X is non-nil, read with completion. The completion table is the resulting alist of TABLE-X concatenated with TABLE where TABLE can also be a function evaluation to an alist.
Used inside antlr-options-alists.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/antlr-mode.el.gz
;;;===========================================================================
;;; Insert options: in `antlr-options-alists'
;;;===========================================================================
(defun antlr-read-value (initial-contents prompt
&optional as-string table table-x)
"Read a string from the minibuffer, possibly with completion.
If INITIAL-CONTENTS is non-nil, insert it in the minibuffer initially.
PROMPT is a string to prompt with, normally it ends in a colon and a
space. If AS-STRING is t or is a member \(comparison done with `eq') of
`antlr-options-style', return printed representation of the user input,
otherwise return the user input directly.
If TABLE or TABLE-X is non-nil, read with completion. The completion
table is the resulting alist of TABLE-X concatenated with TABLE where
TABLE can also be a function evaluation to an alist.
Used inside `antlr-options-alists'."
(let* ((completion-ignore-case t) ; dynamic
(table0 (and (or table table-x)
(append table-x
(if (functionp table) (funcall table) table))))
(input (if table0
(completing-read prompt table0 nil nil initial-contents)
(read-from-minibuffer prompt initial-contents))))
(if (and as-string
(or (eq as-string t)
(cdr (assq as-string antlr-options-style))))
(format "%S" input)
input)))