Function: read--expression

read--expression is a byte-compiled function defined in simple.el.gz.

Signature

(read--expression PROMPT &optional INITIAL-CONTENTS)

Documentation

Read an Emacs Lisp expression from the minibuffer.

PROMPT and optional argument INITIAL-CONTENTS do the same as in function read-from-minibuffer.

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defun read--expression (prompt &optional initial-contents)
  "Read an Emacs Lisp expression from the minibuffer.

PROMPT and optional argument INITIAL-CONTENTS do the same as in
function `read-from-minibuffer'."
  (minibuffer-with-setup-hook
      (lambda ()
        ;; FIXME: instead of just applying the syntax table, maybe
        ;; use a special major mode tailored to reading Lisp
        ;; expressions from the minibuffer? (`emacs-lisp-mode'
        ;; doesn't preserve the necessary keybindings.)
        (set-syntax-table emacs-lisp-mode-syntax-table)
        (add-hook 'completion-at-point-functions
                  #'elisp-completion-at-point nil t)
        (setq-local trusted-content :all)
        (run-hooks 'eval-expression-minibuffer-setup-hook))
    (read-from-minibuffer prompt initial-contents
                          read--expression-map t
                          'read-expression-history)))