[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  Tab-Expansion problems

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Tab-Expansion problems

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Hve   Germany  (11 posts)  [Biography] bio
Date Mon 28 Jul 2003 07:00 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #1 on Mon 28 Jul 2003 07:18 AM (UTC)  quote  ]
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!
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Mon 28 Jul 2003 10:27 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Hve   Germany  (11 posts)  [Biography] bio
Date Reply #3 on Tue 29 Jul 2003 05:46 AM (UTC)  quote  ]
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
[Go to top] 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.


1,707 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]