summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-08-19 07:54:58 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-08-19 07:54:58 +0200
commita0784b20c60d4b5d32ec441dc8e56839bfe40f08 (patch)
treee452f16e963c6aba547075a553ce6412bf8fe973
parent4c25551e639bb19a60211d30e6c7adb2bc51c59e (diff)
downloadgeiser-chez-a0784b20c60d4b5d32ec441dc8e56839bfe40f08.tar.gz
geiser-chez-a0784b20c60d4b5d32ec441dc8e56839bfe40f08.tar.bz2
Redisplaying the prompt after empty lines on the REPL.
-rw-r--r--elisp/geiser-repl.el21
-rw-r--r--scheme/guile/geiser/emacs.scm4
-rw-r--r--scheme/racket/geiser/main.rkt4
3 files changed, 22 insertions, 7 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)
diff --git a/scheme/guile/geiser/emacs.scm b/scheme/guile/geiser/emacs.scm
index 72cd3db..05c525e 100644
--- a/scheme/guile/geiser/emacs.scm
+++ b/scheme/guile/geiser/emacs.scm
@@ -1,6 +1,6 @@
;;; emacs.scm -- procedures for emacs interaction: entry point
-;; Copyright (C) 2009 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010 Jose Antonio Ortega Ruiz
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the Modified BSD License. You should
@@ -26,11 +26,13 @@
ge:callers
ge:callees
ge:find-file)
+ #:export (ge:no-values)
#:use-module (geiser evaluation)
#:use-module ((geiser modules) :renamer (symbol-prefix-proc 'ge:))
#:use-module ((geiser completion) :renamer (symbol-prefix-proc 'ge:))
#:use-module ((geiser xref) :renamer (symbol-prefix-proc 'ge:))
#:use-module ((geiser doc) :renamer (symbol-prefix-proc 'ge:)))
+(define (ge:no-values) (values))
;;; emacs.scm ends here
diff --git a/scheme/racket/geiser/main.rkt b/scheme/racket/geiser/main.rkt
index de1c21c..4915b68 100644
--- a/scheme/racket/geiser/main.rkt
+++ b/scheme/racket/geiser/main.rkt
@@ -22,7 +22,8 @@
geiser:module-location
geiser:module-exports
geiser:autodoc
- geiser:help)
+ geiser:help
+ geiser:no-values)
(require geiser/eval
geiser/modules
@@ -43,5 +44,6 @@
(define geiser:module-location module-location)
(define geiser:module-exports module-exports)
(define geiser:macroexpand macroexpand)
+(define (geiser:no-values) (values))
;;; main.rkt ends here