Function: dape-repl-mode
dape-repl-mode is a natively compiled function defined in dape.el.
Signature
(dape-repl-mode)
Documentation
Major mode for interacting with Dape and the debugger.
Uses the interface provided by comint-mode.
In addition to any hooks its parent mode might have run, this mode
runs the hook dape-repl-mode-hook, as the final or penultimate step
during initialization.
Source Code
;; Defined in /nix/store/1fiaif8pifqj2jh65rbg3fkhg3i56q42-emacs-packages-deps/share/emacs/site-lisp/elpa/dape-0.27.1/dape.el
(define-derived-mode dape-repl-mode comint-mode "REPL"
"Major mode for interacting with Dape and the debugger.
Uses the interface provided by `comint-mode'."
:group 'dape
:interactive nil
(setq-local revert-buffer-function #'dape--repl-revert-region
dape--repl-marker (make-marker)
comint-prompt-read-only t
comint-scroll-to-bottom-on-input t
;; Always keep prompt at the bottom of the window
scroll-conservatively 101
comint-input-sender 'dape--repl-input-sender
comint-prompt-regexp (concat "^" (regexp-quote dape--repl-prompt))
comint-process-echoes nil)
(add-to-list 'overlay-arrow-variable-list 'dape--repl-marker)
(add-hook 'completion-at-point-functions
#'dape--repl-completion-at-point nil t)
;; Stolen from ielm
;; Start a dummy process just to please comint
(unless (comint-check-proc (current-buffer))
(let ((process (start-process "dape repl" (current-buffer) nil)))
(add-hook 'kill-buffer-hook (lambda () (delete-process process)) nil t))
(set-process-query-on-exit-flag (get-buffer-process (current-buffer))
nil)
(set-process-filter (get-buffer-process (current-buffer))
#'comint-output-filter)
(insert
(format
"* Welcome to the Dape REPL *
Available Dape commands:
%s
Any other input or input starting with a space is sent directly to the
debugger. An empty line will repeat the last command.\n\n"
(with-temp-buffer
(insert " "
(mapconcat (pcase-lambda (`(,str . ,command))
(setq str (concat str))
(when dape-repl-use-shorthand
(set-text-properties
0 (thread-last (dape--repl-shorthand-alist)
(rassoc command)
(car)
(length))
'(font-lock-face help-key-binding)
str))
str)
dape-repl-commands
", "))
(let ((fill-column 72)
(adaptive-fill-mode t))
(fill-region (point-min) (point-max)))
(buffer-string))))
(set-marker (process-mark (get-buffer-process (current-buffer))) (point))
(comint-output-filter (get-buffer-process (current-buffer))
dape--repl-prompt)))