Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Bug reports ➜ Tab-Expansion problems

Tab-Expansion problems

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Hve   Germany  (11 posts)  Bio
Date Mon 28 Jul 2003 07:00 AM (UTC)
Message
Hello,

I'm very fond of the tab-expansion feature. Unfortunately, the result of the expansion is not always what I'd like it to be.
It appears that most interpunction is considered part of a word.
Hence, after the following output

Jim o'Conner says to Josephine: "Hello, my 'special' friend!"

"j<tab>" becomes "Jim"
"jo<tab>" becomes "Josepine:"
"f<tab>" becomes "friend!"
"sp<tab>" becomes "special"
"o<tab>" no expansion
"o'<tab>" no expansion

In the first case, I had expected "Josephine" since this match is both longer and more recent, but that's another story: Apparently, the routine goes backwards linewise but takes the first match per line (since the builtin regexp engine does).
Cases 2 and 3 show how interpunction is unexpectedly (and unwantedly) added.
Case 4 shows that single quotes are treated as interpunction and not part of the word (and so are double quotes).
Cases 5 and 6 show that "o'Conner" is therefore not considered a single word.

IMHO, it would be nicer to exclude *all* interpunction characters from expansion.
On the other hand, especially fantastic names with interpunction characters in the middle are quite common in MUDs. Hence an ever nicer solution would be to ignore (one or more) interpunction characters only at the beginning or end of a word, i.e. to match something like [a-zA-Z0-9][-'"_!(and others)a-zA-Z0-9]*[a-zA-Z0-9]

I don't know what others feel about this, and, hey, maybe the match expression for tab expansion could even be made configurable?

Yours,
hve
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #1 on Mon 28 Jul 2003 07:18 AM (UTC)
Message
You can go to File > General Preferences > General, and change world delimiters to whatever you like.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Mon 28 Jul 2003 10:27 PM (UTC)
Message
Poromenos is right, you can configure that.

To address your other issues ...

First, this is not a bug, it is behaving as designed.

Tab-completion is designed to match on:


  • Your tab completion defaults first
  • The last line in the output buffer
  • The second last line, and so on, backwards


For each line, it matches the first match it can. See this documentation page:


http://www.gammon.com.au/scripts/doc.php?dialog=IDR_MUSHCLTYPE


I think this is desirable behaviour, for instance, if you received:


Josephine tells you, John told a joke.


And you pressed: Jo<tab>

You probably want to reply to Josephine, not "John" or "joke".

The other issues, like the single quotes, and the ! and : characters appearing, can all be controlled by the tab-completion configuration, see "word delimiters" in:


http://www.gammon.com.au/scripts/doc.php?dialog=IDD_GLOBAL_PREFSP2



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Hve   Germany  (11 posts)  Bio
Date Reply #3 on Tue 29 Jul 2003 05:46 AM (UTC)
Message
Thanks a lot for the hint to the delimiter thing - I had only stumbled across tab completion defaults, which don't apply here.
As for the other thing (matching order), I didn't want it to be changed. In fact, I only noticed it when preparing the hand-crafted example text :)

It is quite likely that a human being misconceives the notion "most recent word starting with 'jo'" in the very same manner (i.e. the first occurence of such a word in the last possible line) as a consequence of our reading (english) lines from left to right. Hence tampering with the underlying matching mechanism (which is probably optimized for left to right matching as well) might cause behaviour that is further away from human intuition and hence unwanted.

But note that the current algorithm produces different results with the same text if lines wrap differently:

Inspired by the joyful moment,
Josephine tells you, John told a joke.
=> jo<tab> = Josephine

Inspired by the joyful moment, Josephine
tells you, John told a joke.
=> jo<tab> = John

But let me repeat that this is probably best suited for the human psychological notion of "last match" in a multiline text and that my major concern was the delimiter thing which I will start playing with rigt now ;)

hve
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


17,447 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.