[Reported to author(s) by email earlier this year]
Emacs `choose-completion' (choosing a completion from the *Completions* buffer) always replaces text upto (point). So the code which figures out an `unambiguous-completion-length' and places the point there in `slime-expand-abbreviations-and-complete' causes problems: the replacement text gets garbled.
(setq slime-complete-symbol-function 'slime-complete-symbol* slime-complete-symbol*-fancy nil pop-up-windows nil pop-up-frames nil)
In the slime-repl buffer at the prompt, put the string "swank::c-s" and type TAB or M-TAB, and choose any item, say swank::compilation-speed. On finding your way back to the repl buffer, you see the garbled text.
For eg; if the string was "(swank::c-s" M-TAB, on finding your way back to the repl buffer, you'll see: "swank::compilation-speed-s" and no paren.
This has been around for ever. I believe the following Changelog entries apply.
| 2004-02-29 Helmut Eller e9626484@stud3.tuwien.ac.at | 2003-11-03 Helmut Eller e9626484@stud3.tuwien.ac.at
The fix that gets rid of the bogus `unambiguous-completion-length' is appended.
Index: slime.el =================================================================== RCS file: /project/slime/cvsroot/slime/slime.el,v retrieving revision 1.698 diff -u -r1.698 slime.el --- slime.el 7 Dec 2006 11:08:57 -0000 1.698 +++ slime.el 10 Dec 2006 13:00:21 -0000 @@ -6096,15 +6097,10 @@ (set-window-start window (point-min) nil) (let ((other-window-scroll-buffer (window-buffer window))) - (scroll-other-window))))) - (let ((unambiguous-completion-length - (loop for c in completion-set - minimizing (or (mismatch completed-prefix c) - (length completed-prefix))))) - (goto-char (+ beg unambiguous-completion-length)) - (slime-display-completion-list completion-set - completed-prefix) - (slime-complete-delay-restoration)))))))) + (scroll-other-window))))) ; madhu + (slime-display-completion-list completion-set + completed-prefix) + (slime-complete-delay-restoration)))))))
(defun slime-complete-symbol*-fancy-bit () "Do fancy tricks after completing a symbol.