Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 14 years ago

#2532 closed defect (duplicate)

Search for Camelcase ends up with newpage (ex. search for WikiFormatter)

Reported by: anonymous Owned by: Christian Boos
Priority: low Milestone:
Component: search system Version: 0.9.2
Severity: trivial Keywords: Camelcase Search
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

When you search for a Word in CamelCase you get redirected to create a "new Page".

Please don't do that! (or at least provide a solution to remove it from the core-code manualy)

  1. It makes problems with JavaClasses, WinAPI-Functions, …
  2. It's neither professional nor elegant

Attachments (1)

no_camelcase.patch (577 bytes ) - added by anonymous 19 years ago.
No more Camel Case

Download all attachments as: .zip

Change History (10)

comment:1 by Matthew Good, 19 years ago

Milestone: 0.9.3
Priority: highnormal
Resolution: invalid
Severity: blockernormal
Status: newclosed

If you feel like dealing with this professionally you can search for the related existing tickets or ask on the MailingList or IrcChannel about this, however I don't intend to dignify this flamebait with a response.

comment:2 by anonymous, 19 years ago

Patch for no_camelcase (no more camel_sh*) As discussed in: #425 #476 #1490 #1604 #2526

--- wiki/api.py (Original)
+++ wiki/api.py (Patch)
@@ -185,7 +185,10 @@
     # IWikiSyntaxProvider methods
     def get_wiki_syntax(self):
-        ignore_missing = self.config.get('wiki', 'ignore_missing_pages')
+        no_camelcase = self.config.get('wiki', 'no_camelcase')
+       if no_camelcase in TRUE:
+           return
+       ignore_missing = self.config.get('wiki', 'ignore_missing_pages')
         ignore_missing = ignore_missing in TRUE
         yield (r"!?(?<!/)\b[A-Z][a-z]+(?:[A-Z][a-z]*[a-z/])+"
                 "(?:#[A-Za-z0-9]+)?(?=\Z|\s|[.,;:!?\)}\]])",

in your trac.ini do

    [wiki]
    no_camelcase = true

There should be a Script which converts all CamelCase (if there is a page to it) to [wiki:link] and leave all others basicaly (Class Names etc.) alone…

comment:3 by anonymous, 19 years ago

Resolution: invalid
Status: closedreopened

by anonymous, 19 years ago

Attachment: no_camelcase.patch added

No more Camel Case

comment:4 by Christian Boos, 19 years ago

Description: modified (diff)
Summary: Search for Camelcase fails with newpage (ex. search forWikiFormatter)Search for Camelcase ends upwith newpage (ex. search for WikiFormatter)

Well, ignoring the offending tone of our anonymous reporter, this "feature" seems to be requested often enough (even in more polite manner) to be at least considered. While I'm not at all in this school of thought (to me, a wiki without CamelCase doesn't even look like a Wiki :) ), I think we could keep the discussion opened. That discussion is actually two fold:

  • disable CamelCase entirely in the wiki (like the patch suggests)
  • disable the quick jump to a Wiki page when a CamelCase word is entered. This is even considered as a feature by some, in order to be able to quickly create a new page (and of course, this is the best way to

end

up with orphaned pages…)

(/me cleaning up the description a bit…)

comment:5 by dserodio@…, 19 years ago

I agree that CamelCase links are the "soul" of a Wiki, but I think disabling the quick jump Wiki page when a CamelCase word is entered would be really nice. Should we open a separate ticket for this?

comment:6 by Christian Boos, 19 years ago

Milestone: 1.0
Owner: changed from Jonas Borgström to Christian Boos
Priority: normallow
Severity: normaltrivial
Status: reopenednew

I would say, let's keep this one focused on the disable the quick jump to a Wiki page when a CamelCase word is entered topic, as the summary and the description indicate. The disabling of CamelCase links is already discussed at length in #476. I'll copy there the patch proposed above, for further discussion. In the meantime, the disabling of quickjump would be something like that:

Index: Search.py
===================================================================
--- Search.py   (revision 2689)
+++ Search.py   (working copy)
@@ -223,9 +223,10 @@
             if re.match (r, kwd[len('wiki:'):]):
                 return self.env.href.wiki(kwd[len('wiki:'):])
         elif kwd[0].isupper() and kwd[1].islower():
-            r = "((^|(?<=[^A-Za-z]))[!]?[A-Z][a-z/]+(?:[A-Z][a-z/]+)+)"
-            if re.match (r, kwd):
-                return self.env.href.wiki(kwd)
+            if self.config.getbool('search', 'camelcase_quickjump'):
+                r =
"((^|(?<=[^A-Za-z]))[!]?[A-Z][a-z/]+(?:[A-Z][a-z/]+)+)"
+                if re.match (r, kwd):
+                    return self.env.href.wiki(kwd)
     # IWikiSyntaxProvider methods

comment:7 by Matthew Good, 19 years ago

cboos: I don't think we should be special-caseing the quickjump method for this, but should actually be switching that method to use the WikiSystem's known syntax providers instead of all the hardcoded quickjump tests. In that case if CamelCase was disabled as a TracLinks syntax, then it would not be recognized for the quickjump, but I think that all TracLinks syntaxes should be treated equally. Maybe we should disable the quickjump when using the "Search" page and only use it on the search box above the menu.

comment:8 by Christian Boos, 19 years ago

Milestone: 1.0
Resolution: duplicate
Status: newclosed

See #1269.

comment:9 by Christian Boos, 14 years ago

See #7658.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.