From 922ee90127e6f17cd180287e77de9b3a745b60b1 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 26 Jun 2010 02:14:24 -0700 Subject: [PATCH] Fix broken implementation of completion. --- src/runtime/swank.scm | 56 ++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/src/runtime/swank.scm b/src/runtime/swank.scm index 789ddf3b6..08c0626cd 100644 --- a/src/runtime/swank.scm +++ b/src/runtime/swank.scm @@ -33,14 +33,16 @@ USA. ;;; Suggested for .emacs: #| - (defun mit-scheme-init (file encoding) +(when (require 'slime nil t) + + (defun mit-scheme-start-swank (file encoding) (format "%S\n\n" `(start-swank ,file))) (defun mit-scheme-find-buffer-package () (save-excursion (let ((case-fold-search t)) - (beginning-of-buffer) - (and (re-search-forward "^;+ package: \\((.+)\\).*$" nil t) + (goto-char (point-min)) + (and (re-search-forward "^;+ package: \\(([^)]+)\\)" nil t) (match-string-no-properties 1))))) (defun mit-scheme-slime-mode-init () @@ -48,15 +50,14 @@ USA. (make-local-variable 'slime-find-buffer-package-function) (setq slime-find-buffer-package-function 'mit-scheme-find-buffer-package)) - (when (require 'slime nil t) - (slime-setup) - (if (not (memq 'mit-scheme slime-lisp-implementations)) - (setq slime-lisp-implementations - (cons '(mit-scheme ("mit-scheme") :init mit-scheme-init) - slime-lisp-implementations))) - (setq slime-default-lisp 'mit-scheme) - (add-hook 'scheme-mode-hook 'mit-scheme-slime-mode-init) - (setq inferior-lisp-program "mit-scheme")) + (slime-setup) + (if (not (memq 'mit-scheme slime-lisp-implementations)) + (setq slime-lisp-implementations + (cons '(mit-scheme ("mit-scheme") + :init mit-scheme-start-swank) + slime-lisp-implementations))) + (setq slime-default-lisp 'mit-scheme) + (add-hook 'scheme-mode-hook 'mit-scheme-slime-mode-init)) |# (declare (usual-integrations)) @@ -680,24 +681,29 @@ swank:xref (define (swank:simple-completions socket string package) socket - (let ((strings (all-completions string (user-env package) string-prefix?))) + (let ((strings (all-completions string (user-env package)))) (list (sort strings string