diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-15 19:54:14 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-15 19:54:14 +0100 |
commit | e7b2ec5d5d2e9f57840ab08adbbce03ccff48956 (patch) | |
tree | 809527b0a37017b3fa7a5a6fe47aef792415fea0 /elisp | |
parent | 1af411071098d87188a6a479dd6741c65034de62 (diff) | |
download | geiser-guile-e7b2ec5d5d2e9f57840ab08adbbce03ccff48956.tar.gz geiser-guile-e7b2ec5d5d2e9f57840ab08adbbce03ccff48956.tar.bz2 |
Avoing REPL modeline message flickering on redirection.
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-connection.el | 16 | ||||
-rw-r--r-- | elisp/geiser-repl.el | 7 |
2 files changed, 15 insertions, 8 deletions
diff --git a/elisp/geiser-connection.el b/elisp/geiser-connection.el index 7a73adc..b78982c 100644 --- a/elisp/geiser-connection.el +++ b/elisp/geiser-connection.el @@ -135,20 +135,18 @@ (defun geiser-con--cleanup-connection (c) (geiser-con--connection-cancel-timer c)) -(defun geiser-con--setup-connection (buffer) +(defun geiser-con--setup-connection (buffer prompt-regexp) (with-current-buffer buffer (when geiser-con--connection (geiser-con--cleanup-connection geiser-con--connection)) (setq geiser-con--connection (geiser-con--make-connection buffer)) - (geiser-con--setup-comint) + (geiser-con--setup-comint prompt-regexp) (geiser-con--connection-start-timer geiser-con--connection) (message "Geiser REPL up and running!"))) -(defconst geiser-con--prompt-regex "^[^() \n]+@([^)]*?)> ") - -(defun geiser-con--setup-comint () +(defun geiser-con--setup-comint (prompt-regexp) (set (make-local-variable 'comint-redirect-insert-matching-regexp) nil) - (set (make-local-variable 'comint-redirect-finished-regexp) geiser-con--prompt-regex) + (set (make-local-variable 'comint-redirect-finished-regexp) prompt-regexp) (add-hook 'comint-redirect-hook 'geiser-con--comint-redirect-hook nil t)) @@ -203,6 +201,12 @@ (geiser-con--process-completed-request req) (geiser-con--connection-clean-current-request geiser-con--connection))))) +(defadvice comint-redirect-setup + (after geiser-con--advice (output-buffer comint-buffer finished-regexp &optional echo)) + (with-current-buffer comint-buffer + (when geiser-con--connection (setq mode-line-process nil)))) +(ad-activate 'comint-redirect-setup) + ;;; Message sending interface: diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index dbf277a..5b58a0a 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -67,6 +67,8 @@ REPL buffer." (defvar geiser-repl--buffer nil "The buffer in which the Guile REPL is running.") +(defconst geiser-repl--prompt-regex "^[^() \n]+@([^)]*?)> ") + (defun geiser-repl--buffer () (if (buffer-live-p geiser-repl--buffer) geiser-repl--buffer (with-current-buffer (get-buffer-create "*Geiser REPL*") @@ -83,7 +85,7 @@ REPL buffer." nil "-L" (concat geiser-scheme-dir "/guile/") "-q") (geiser-repl--wait-for-prompt 10000) - (geiser-con--setup-connection (current-buffer)))) + (geiser-con--setup-connection (current-buffer) geiser-repl--prompt-regex))) (defun geiser-repl--process (&optional start) (or (and (buffer-live-p (geiser-repl--buffer)) @@ -138,7 +140,8 @@ REPL buffer." (define-derived-mode geiser-repl-mode comint-mode "Geiser REPL" "Major mode for interacting with an inferior Guile repl process. \\{geiser-repl-mode-map}" - (set (make-local-variable 'comint-prompt-regexp) geiser-con--prompt-regex) + (set (make-local-variable 'mode-line-process) nil) + (set (make-local-variable 'comint-prompt-regexp) geiser-repl--prompt-regex) (set (make-local-variable 'comint-use-prompt-regexp) t) (set (make-local-variable 'comint-prompt-read-only) t)) |