Function: js--read-symbol

js--read-symbol is a byte-compiled function defined in js.el.gz.

Signature

(js--read-symbol SYMBOLS-TABLE PROMPT &optional INITIAL-INPUT)

Documentation

Helper function for js-find-symbol.

Read a symbol from SYMBOLS-TABLE, which is a hash table like the one from js--get-all-known-symbols, using prompt PROMPT and initial input INITIAL-INPUT. Return a cons of (SYMBOL-NAME
. LOCATION), where SYMBOL-NAME is a string and LOCATION is a
marker.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/js.el.gz
(defun js--read-symbol (symbols-table prompt &optional initial-input)
  "Helper function for `js-find-symbol'.
Read a symbol from SYMBOLS-TABLE, which is a hash table like the
one from `js--get-all-known-symbols', using prompt PROMPT and
initial input INITIAL-INPUT.  Return a cons of (SYMBOL-NAME
. LOCATION), where SYMBOL-NAME is a string and LOCATION is a
marker."
  (let ((choice (completing-read
                 prompt
                 (cl-loop for key being the hash-keys of symbols-table
                          collect key)
                 nil t initial-input 'js--symbol-history)))
    (cons choice (gethash choice symbols-table))))