Function: eshell-emit-prompt
eshell-emit-prompt is a byte-compiled function defined in
em-prompt.el.gz.
Signature
(eshell-emit-prompt)
Documentation
Emit a prompt if eshell is being used interactively.
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/em-prompt.el.gz
(defun eshell-emit-prompt ()
"Emit a prompt if eshell is being used interactively."
(when (boundp 'ansi-color-context-region)
(setq ansi-color-context-region nil))
(run-hooks 'eshell-before-prompt-hook)
(if (not eshell-prompt-function)
(set-marker eshell-last-output-end (point))
(let* ((prompt (funcall eshell-prompt-function))
(len (length prompt))
(sticky-props '(field)))
(put-text-property 0 len 'field 'prompt prompt)
(when eshell-highlight-prompt
(add-text-properties
0 len '(read-only t font-lock-face eshell-prompt) prompt)
(setq sticky-props `(read-only font-lock-face . ,sticky-props)))
(eshell--append-text-property 0 len 'front-sticky sticky-props prompt)
(eshell--append-text-property 0 len 'rear-nonsticky sticky-props prompt)
(eshell-interactive-filter nil prompt)))
(run-hooks 'eshell-after-prompt-hook))