From c54ebd679ac7702dd92da9686f0d2ec2f229b0d5 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Fri, 5 Nov 2010 02:57:15 +0100 Subject: Fix for TAB in REPL, and BACKTAB going to previous error --- elisp/geiser-repl.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'elisp') diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index 57111f4..b84613b 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -505,11 +505,19 @@ With a prefix argument, force exit by killing the scheme process." (insert "\n")))))) (defun geiser-repl--tab (n) + "If we're after the last prompt, complete symbol or indent (if +there's no symbol at point). Otherwise, go to next error in the REPL +buffer." (interactive "p") (if (> (point) (geiser-repl--last-prompt-end)) (geiser-completion--maybe-complete) (compilation-next-error n))) +(defun geiser-repl--previous-error (n) + "Go to previous error in the REPL buffer." + (interactive "p") + (compilation-next-error (- n))) + (define-derived-mode geiser-repl-mode comint-mode "REPL" "Major mode for interacting with an inferior scheme repl process. \\{geiser-repl-mode-map}" @@ -535,13 +543,14 @@ With a prefix argument, force exit by killing the scheme process." (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 (kbd "TAB") 'geiser-repl--tab) +(define-key geiser-repl-mode-map [backtab] 'geiser-repl--previous-error) (define-key geiser-repl-mode-map "\C-a" 'geiser-repl--bol) (define-key geiser-repl-mode-map (kbd "") 'geiser-repl--bol) (geiser-menu--defmenu repl geiser-repl-mode-map - ("Complete symbol" ((kbd "TAB") (kbd "M-TAB")) - geiser-completion--complete-symbol :enable (symbol-at-point)) + ("Complete symbol" ((kbd "M-TAB")) + geiser-repl--tab :enable (symbol-at-point)) ("Complete module name" ((kbd "C-.") (kbd "M-`")) geiser-completion--complete-module :enable (symbol-at-point)) ("Edit symbol" "\M-." geiser-edit-symbol-at-point -- cgit v1.2.3