Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1161 closed bug (fixed)

Trac should not detect GetMouse() as wiki entry

Reported by: axeld Owned by: wkornewald
Priority: normal Milestone: Website R2 (Drupal 5)
Component: Website/Trac Version:
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

When we use function names in the text (like GetMouse()), Trac will turn "GetMouse" into a missing page. Even worse, when I search for "GetMouse" the search returns empty, even though there are several occurences in the bug descriptions (for example bug #901).

Change History (6)

comment:1 by wkornewald, 18 years ago

You can escape GetMouse by putting a "!" in front: GetMouse

The search field at the top acts as a quickjump if it detects a certain pattern (you can also enter revision numbers like hrev123 or ticket numbers like #1161 there). In this case, Trac recognizes a wiki word and tries to bring you to the wiki page. In order to work around this, you can enter GetMouse ("!" at the beginning disables the quickjump when searching).

Is that good enough? It can only be disabled by hacking the Trac source, but it might be a one-liner, so not too difficult. OTOH, the less modifications we have the better. And the quickjump can be very handy. :)

comment:2 by wkornewald, 18 years ago

Milestone: R1Website R2
Resolution: invalid
Status: newclosed
Version: R1 development

Well, if you insist on it you can still reopen the ticket. Otherwise, there's no reason to keep it open. :)

comment:3 by axeld, 18 years ago

Resolution: invalid
Status: closedreopened

I think this functionality is misplaced in the search field - it should be the other way around, ie. it should only do a quickjump if you prepend the name with '!'. Also, it shouldn't detect names when they end in ().

in reply to:  3 ; comment:4 by wkornewald, 18 years ago

Replying to axeld:

I think this functionality is misplaced in the search field - it should be the other way around, ie. it should only do a quickjump if you prepend the name with '!'.

Done. BTW, the search results still show a hint that a quickjump is possible. With '!' you can explicitly do a quickjump.

Also, it shouldn't detect names when they end in ().

I don't understand that one. I think my patch makes this change superfluous, anyway.

in reply to:  4 ; comment:5 by axeld, 18 years ago

Resolution: fixed
Status: reopenedclosed

Replying to wkornewald:

Done. BTW, the search results still show a hint that a quickjump is possible. With '!' you can explicitly do a quickjump.

Thanks, that definitely sounds like the best solution.

Also, it shouldn't detect names when they end in ().

I don't understand that one. I think my patch makes this change superfluous, anyway.

Go to #901 comment 7 and see what it does to GetMouse(). That only makes the text harder to read, and doesn't server any purpose :-) But anyway, the search thing was the most important.

in reply to:  5 comment:6 by wkornewald, 18 years ago

Replying to axeld:

Replying to wkornewald:

Done. BTW, the search results still show a hint that a quickjump is possible. With '!' you can explicitly do a quickjump.

Thanks, that definitely sounds like the best solution.

I had to change '!' to ':' because otherwise it's inconsistent. '!' is used to prevent "wikifying".

Also, it shouldn't detect names when they end in ().

I don't understand that one. I think my patch makes this change superfluous, anyway.

Go to #901 comment 7 and see what it does to GetMouse(). That only makes the text harder to read, and doesn't server any purpose :-)

Well, here I can't change anything because that's normal wiki syntax. What you can do is prefix wiki words with '!', so GetMouse() doesn't get transformed.

BTW, you can write comment:ticket:901:7 (weird syntax :).

Note: See TracTickets for help on using tickets.