diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-08-19 07:54:58 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-08-19 07:54:58 +0200 |
commit | 05ed9a6c1e422761692ca77be3c703f941dc5d5a (patch) | |
tree | 9c91312207ef20191f2d583bbf39d71d5fb49c5d /elisp/geiser-repl.el | |
parent | 203b248cd24a86934fb61183d44b16ceb82eef3b (diff) | |
download | geiser-05ed9a6c1e422761692ca77be3c703f941dc5d5a.tar.gz geiser-05ed9a6c1e422761692ca77be3c703f941dc5d5a.tar.bz2 |
Redisplaying the prompt after empty lines on the REPL.
Diffstat (limited to 'elisp/geiser-repl.el')
-rw-r--r-- | elisp/geiser-repl.el | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index a68f6c9..adcf03f 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -396,11 +396,22 @@ module command as a string") (geiser-syntax--nesting-level)))) (defun geiser-repl--send-input () + (let* ((proc (get-buffer-process (current-buffer))) + (pmark (and proc (process-mark proc))) + (intxt (and pmark (buffer-substring pmark (point))))) + (when intxt + (comint-send-input) + (when (string-match "^\\s-*$" intxt) + (comint-send-string proc + (geiser-eval--scheme-str '((:ge no-values)))) + (comint-send-string proc "\n"))))) + +(defun geiser-repl--maybe-send () (interactive) (let ((p (point))) (end-of-line) (if (<= (geiser-repl--nesting-level) 0) - (comint-send-input) + (geiser-repl--send-input) (goto-char p) (if geiser-repl-auto-indent-p (geiser-repl--newline-and-indent) @@ -411,13 +422,13 @@ module command as a string") \\{geiser-repl-mode-map}" (scheme-mode-variables) (set (make-local-variable 'mode-line-process) nil) - (set (make-local-variable 'comint-use-prompt-regexp) t) + (set (make-local-variable 'comint-use-prompt-regexp) nil) (set (make-local-variable 'comint-prompt-read-only) geiser-repl-read-only-prompt-p) (set (make-local-variable 'beginning-of-defun-function) 'geiser-repl--beginning-of-defun) (set (make-local-variable 'comint-input-ignoredups) - 'geiser-repl-history-no-dups-p) + geiser-repl-history-no-dups-p) (setq geiser-eval--get-module-function 'geiser-repl--module-function) (when geiser-repl-autodoc-p (geiser-autodoc-mode 1)) (setq geiser-autodoc--inhibit-function 'geiser-con--is-debugging) @@ -427,8 +438,8 @@ module command as a string") (compilation-setup t)) (define-key geiser-repl-mode-map "\C-d" 'delete-char) -(define-key geiser-repl-mode-map "\C-m" 'geiser-repl--send-input) -(define-key geiser-repl-mode-map [return] 'geiser-repl--send-input) +(define-key geiser-repl-mode-map "\C-m" 'geiser-repl--maybe-send) +(define-key geiser-repl-mode-map [return] 'geiser-repl--maybe-send) (define-key geiser-repl-mode-map "\C-j" 'geiser-repl--newline-and-indent) (define-key geiser-repl-mode-map "\C-a" 'geiser-repl--bol) |