summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2012-10-24 05:17:34 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2012-10-24 05:17:34 +0200
commitde6fc09551730fe87f7f3d6f532bafd189c97236 (patch)
tree7ece6ed4393a6db6a195701ddb32e6023b1f7881
parent5b77d598ee04f324cbaf4eaacfe71e534bb2ed34 (diff)
downloadgeiser-guile-de6fc09551730fe87f7f3d6f532bafd189c97236.tar.gz
geiser-guile-de6fc09551730fe87f7f3d6f532bafd189c97236.tar.bz2
Completing file names at the REPL, but only in string contexts
-rw-r--r--NEWS1
-rw-r--r--elisp/geiser-repl.el4
-rw-r--r--elisp/geiser-syntax.el3
3 files changed, 7 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 290d0b3..6458861 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
* Version 0.2.3 ()
+ - TAB in a string context in the REPL triggers filename completion.
- Indentation of scheme forms improved (specially for those of you
using a single implementation).
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index dce6143..1a83565 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -15,6 +15,7 @@
(require 'geiser-autodoc)
(require 'geiser-edit)
(require 'geiser-completion)
+(require 'geiser-syntax)
(require 'geiser-impl)
(require 'geiser-eval)
(require 'geiser-connection)
@@ -546,7 +547,8 @@ buffer."
(interactive "p")
(if (>= (point) (geiser-repl--last-prompt-end))
(or (completion-at-point)
- (comint-replace-by-expanded-filename)
+ (and (geiser-syntax--in-string-p)
+ (comint-replace-by-expanded-filename))
(lisp-indent-line))
(compilation-next-error n)))
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index 46ee350..46374a2 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -241,6 +241,9 @@ implementation-specific entries for font-lock-keywords.")
(defsubst geiser-syntax--nesting-level ()
(or (nth 0 (syntax-ppss)) 0))
+(defsubst geiser-syntax--in-string-p ()
+ (nth 3 (syntax-ppss)))
+
(defsubst geiser-syntax--pair-length (p)
(if (cdr (last p)) (1+ (safe-length p)) (length p)))