Opened 12 years ago

Closed 12 years ago

Last modified 12 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:
Has a Patch: no 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 Changed 12 years ago by wkornewald

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 Changed 12 years ago by wkornewald

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 Changed 12 years ago by axeld

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 ().

comment:4 in reply to:  3 ; Changed 12 years ago by wkornewald

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.

comment:5 in reply to:  4 ; Changed 12 years ago by axeld

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.

comment:6 in reply to:  5 Changed 12 years ago by wkornewald

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.