summaryrefslogtreecommitdiff
path: root/elisp/geiser-completion.el
diff options
context:
space:
mode:
Diffstat (limited to 'elisp/geiser-completion.el')
-rw-r--r--elisp/geiser-completion.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/elisp/geiser-completion.el b/elisp/geiser-completion.el
index 814a587..22b36a1 100644
--- a/elisp/geiser-completion.el
+++ b/elisp/geiser-completion.el
@@ -26,6 +26,7 @@
(require 'geiser-eval)
(require 'geiser-log)
+(require 'geiser-syntax)
(require 'geiser-base)
@@ -172,13 +173,13 @@ terminates a current completion."
(defvar geiser-completion--module-history nil)
-(defun geiser-completion--read-module ()
- (let ((minibuffer-local-completion-map geiser-completion--module-minibuffer-map)
- (modules (geiser-completion--module-list))
- (prompt "Module name: "))
- (if modules
- (completing-read prompt modules nil nil nil geiser-completion--module-history)
- (read-string prompt nil geiser-completion--module-history))))
+(defun geiser-completion--read-module (&optional prompt default history)
+ (let ((minibuffer-local-completion-map geiser-completion--module-minibuffer-map))
+ (completing-read (or prompt "Module name: ")
+ (geiser-completion--module-list)
+ nil nil
+ (or default (geiser-syntax--buffer-module))
+ (or history geiser-completion--module-history))))
(defun geiser--respecting-message (format &rest format-args)
"Display TEXT as a message, without hiding any minibuffer contents."