summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-05 02:57:15 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-05 02:57:15 +0100
commitc54ebd679ac7702dd92da9686f0d2ec2f229b0d5 (patch)
treeb72457b7cde8aaa657038ab25c35b0eaa313d811
parent01300e3ee00e07a97cbb14e9c871823cc6b5e9a4 (diff)
downloadgeiser-c54ebd679ac7702dd92da9686f0d2ec2f229b0d5.tar.gz
geiser-c54ebd679ac7702dd92da9686f0d2ec2f229b0d5.tar.bz2
Fix for TAB in REPL, and BACKTAB going to previous error
-rw-r--r--doc/cheat.texi7
-rw-r--r--elisp/geiser-repl.el13
2 files changed, 18 insertions, 2 deletions
diff --git a/doc/cheat.texi b/doc/cheat.texi
index 6087949..d83a540 100644
--- a/doc/cheat.texi
+++ b/doc/cheat.texi
@@ -110,6 +110,13 @@
@item M-.
@tab geiser-edit-symbol-at-point
@tab Edit identifier at point
+@item TAB
+@tab geiser-completion--tab
+@tab Complete identifier at point or indent if none; away from
+last prompt, go to next error in the buffer.
+@item S-TAB (backtab)
+@tab geiser-completion--previous-error
+@tab Go to previous error in the REPL buffer
@item TAB, M-TAB
@tab geiser-completion--complete-symbol
@tab Complete identifier at point
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 "<home>") '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