summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2012-10-27 22:58:38 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2012-10-27 22:58:44 +0200
commit8bf3f70f6aba159461612be8577bd4193ee7c6e6 (patch)
tree9314c9abf9718ad3c4d58f00a07c1ba4848b8511
parentde6fc09551730fe87f7f3d6f532bafd189c97236 (diff)
downloadgeiser-chez-8bf3f70f6aba159461612be8577bd4193ee7c6e6.tar.gz
geiser-chez-8bf3f70f6aba159461612be8577bd4193ee7c6e6.tar.bz2
Filename completion also in scheme buffers
By means of a new entry in completion-at-point-functions that uses the handy comint-filename-completion.
-rw-r--r--NEWS7
-rw-r--r--elisp/geiser-completion.el11
-rw-r--r--elisp/geiser-repl.el2
3 files changed, 13 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 6458861..4644bc7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,9 @@
* 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).
+ - TAB in a string context in the REPL and Scheme buffers triggers
+ filename completion.
+ - Indentation of scheme forms improved (specially for those of you
+ using a single implementation).
* Version 0.2.2 (Sep 30, 2012)
diff --git a/elisp/geiser-completion.el b/elisp/geiser-completion.el
index 0b39776..94de459 100644
--- a/elisp/geiser-completion.el
+++ b/elisp/geiser-completion.el
@@ -1,6 +1,6 @@
;;; geiser-completion.el -- tab completion
-;; Copyright (C) 2009, 2010, 2011 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010, 2011, 2012 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
@@ -17,6 +17,7 @@
(require 'geiser-syntax)
(require 'geiser-base)
+(require 'comint)
(require 'minibuffer)
@@ -147,10 +148,16 @@ we're looking for a module name.")
(defun geiser-completion--for-module (&optional predicate)
(geiser-completion--thing-at-point t predicate))
+(defun geiser-completion--for-filename ()
+ (when (geiser-syntax--in-string-p)
+ (comint-filename-completion)))
+
(defun geiser-completion--setup (enable)
(set (make-local-variable 'completion-at-point-functions)
(if enable
- '(geiser-completion--for-symbol geiser-completion--for-module)
+ '(geiser-completion--for-symbol
+ geiser-completion--for-module
+ geiser-completion--for-filename)
(default-value 'completion-at-point-functions))))
(defun geiser-completion--complete-module ()
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 1a83565..d7be7cf 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -547,8 +547,6 @@ buffer."
(interactive "p")
(if (>= (point) (geiser-repl--last-prompt-end))
(or (completion-at-point)
- (and (geiser-syntax--in-string-p)
- (comint-replace-by-expanded-filename))
(lisp-indent-line))
(compilation-next-error n)))