Typing M, U, L, <TAB> in the SLIME REPL produces "multiple-value|-" where | represents the cursor/point. Is this a bug? If it'd produce "multiple-value-|" then "multiple-value-bind" and such would be just a tad easier to type.
Regards,
Dirk Gerrits
Dirk Gerrits dirk@dirkgerrits.com writes:
Typing M, U, L, <TAB> in the SLIME REPL produces "multiple-value|-" where | represents the cursor/point. Is this a bug? If it'd produce "multiple-value-|" then "multiple-value-bind" and such would be just a tad easier to type.
It puts the cursor at the point of the first ambiguous completion; blame MULTIPLE-VALUES-LIST. I find it easier to type m-v-b <TAB>.
Zach
Zach Beane wrote:
Dirk Gerrits dirk@dirkgerrits.com writes:
Typing M, U, L, <TAB> in the SLIME REPL produces "multiple-value|-" where | represents the cursor/point. Is this a bug? If it'd produce "multiple-value-|" then "multiple-value-bind" and such would be just a tad easier to type.
It puts the cursor at the point of the first ambiguous completion; blame MULTIPLE-VALUES-LIST.
Ah I see. But why "multiple-value|-" instead of "multiple-value|"? That would make typing both MULTIPLE-VALUE-BIND and MULTIPLE-VALUES-LIST easier.
I find it easier to type m-v-b <TAB>.
Hey neat trick. Only 6 keystrokes. :)
Dirk Gerrits
Dirk Gerrits dirk@dirkgerrits.com writes:
Ah I see. But why "multiple-value|-" instead of "multiple-value|"? That would make typing both MULTIPLE-VALUE-BIND and MULTIPLE-VALUES-LIST easier.
The completion treats the dashes as a kind of template, and completes individual words in the template as much as possible before moving to the first ambiguous point. I like the behavior, but yeah, it's a bit lossy for MULTIPLE-VALUE-BIND (one of the most frequently used unwieldy symbols).
(BTW, I had the name of the other symbol wrong, it's MULTIPLE-VALUES-LIMIT.)
Zach
Zach Beane wrote:
The completion treats the dashes as a kind of template, and completes individual words in the template as much as possible before moving to the first ambiguous point. I like the behavior,
Well I didn't know about it. Now that I do, I'll see if I like it.
but yeah, it's a bit lossy for MULTIPLE-VALUE-BIND (one of the most frequently used unwieldy symbols).
Well if it's just MULTIPLE-VALUE-BIND, it's not much of a problem...
(BTW, I had the name of the other symbol wrong, it's MULTIPLE-VALUES-LIMIT.)
Well, I use neither frequently. And besides, tab completion would ensure correct typing. :P
Dirk Gerrits
Dirk Gerrits dirk@dirkgerrits.com writes:
Well I didn't know about it. Now that I do, I'll see if I like it.
People like me, who don't it, can set slime-complete-symbol-function to 'slime-simple-complete-symbol. This works more like Emacs' default completion and doesn't expand abbreviations. The other difference is that the simple variant only completes the string _before_ point, not the around point.
Helmut.
Helmut Eller e9626484@stud3.tuwien.ac.at writes:
Dirk Gerrits dirk@dirkgerrits.com writes:
Well I didn't know about it. Now that I do, I'll see if I like it.
People like me, who don't it, can set slime-complete-symbol-function to 'slime-simple-complete-symbol. This works more like Emacs' default completion and doesn't expand abbreviations. The other difference is that the simple variant only completes the string _before_ point, not the around point.
I have updated the manual with information about completion. Exerpt:
`slime-complete-symbol-function' The function to use for completion of Lisp symbols. Two completion styles are available. The default `slime-complete-symbol*' performs completion "in parallel" over the hyphen-delimited sub-words of a symbol name. Formally this means that `a-b-c' can complete to any symbol matching the regular expression `^a.*-b.*-c.*' (where "dot" matches anything but a hyphen). Examples give a more intuitive feeling: * `m-v-b' completes to `multiple-value-bind'.
* `w-open' is ambiguous: it completes to either `with-open-file' or `with-open-stream'. The symbol is expanded to the longest common completion (`with-open-') and the point is placed at the first point of ambiguity, which in this case is the end.
* `w--stream' completes to `with-open-stream'. The alternative is `slime-simple-complete-symbol', which completes in the usual Emacs way.
I hope that explains the "fancy" completion style, if not then please ask! I think it's pretty subtle (my first implementation was wildly wrong).
-Luke
Luke Gorrie luke@bluetail.com writes:
expression `^a.*-b.*-c.*' (where "dot" matches anything but a hyphen). Examples give a more intuitive feeling:
Currently 'mu' expands to 'mu-', with possible completions among others muffle-warning and multiple-value-bind. Is that a bug?
Helmut Eller e9626484@stud3.tuwien.ac.at writes:
Luke Gorrie luke@bluetail.com writes:
expression `^a.*-b.*-c.*' (where "dot" matches anything but a hyphen). Examples give a more intuitive feeling:
Currently 'mu' expands to 'mu-', with possible completions among others muffle-warning and multiple-value-bind. Is that a bug?
The code does this because every possible completion has a hyphen. If muffle-warning was called muffle-the-warning all of them would have two hyphens, and the completion would be 'mu--' (with the point placed after 'u').
The documentation is obscure but correct I think. I had meant to cover this case by putting the '^' in the regexp and not having a '$' at the end, i.e. the regexp doesn't have to match to the end of the string. The partial completion is then computed from the commonality of the available completions, without reference to the input string.
That make sense?
(This is a pretty hard feature to document clearly. I'll see if there is a good description to swipe from completer.el.)
-Luke
Luke Gorrie luke@bluetail.com writes:
The documentation is obscure but correct I think. I had meant to cover this case by putting the '^' in the regexp and not having a '$' at the end, i.e. the regexp doesn't have to match to the end of the string. The partial completion is then computed from the commonality of the available completions, without reference to the input string.
That make sense?
Hmm.. yes, that last sentence was quite helpful. Still, I prefer the simple completion function. It drives me crazy when TAB moves point backward :-)
Helmut.