Edgewall Software
Modify

Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#8782 closed defect (fixed)

MacroList should only display one help entry when there are multiple macros defined that differ only by case

Reported by: Ryan Ollos <ryano@…> Owned by: Christian Boos
Priority: normal Milestone: 0.12
Component: wiki system Version: none
Severity: normal Keywords: bitesized
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The MacroList macro should only display a single entry when multiple macros are defined that differ only in case.

As an example, the th:wiki:EmailProcessorMacro allows #Email and #email. This results in two entries in the list of macros generated by MacroList, [[email]] and [[Email]]. I briefly discussed this with the author in th:5713 (screen capture is shown there).

With my limited knowledge of Trac, I believe this is due to the two entries in get_macros.

def get_macros(self):
    """Yield the name of the macro based on the class name."""
    yield 'email'
    yield 'Email'

Would it be reasonable to alter MacroList so that only one help entry is displayed? Perhaps the header can show [[Email]] or [[email]] followed by the help entry.

Attachments (0)

Change History (8)

comment:1 by Ryan Ollos <ryano@…>, 15 years ago

Summary: MacroList should be case insensitiveMacroList should only display one help entry when there are multiple macros defined that differ only by case

comment:2 by Remy Blank, 15 years ago

I don't think assuming that macros whose name only differ in case are the same is a good idea.

We could, however, group them if the documentation strings are non-empty and identical, as this would be a reasonable condition that they operate the same. I would be +0 on that.

The [[MacroList]] macro is implemented in trac/wiki/macros.py (in case you want to try to implement the change yourself :-).

comment:3 by Christian Boos, 14 years ago

Milestone: next-minor-0.12.x

comment:4 by Remy Blank, 14 years ago

Keywords: bitesized added

comment:5 by Christian Boos, 14 years ago

Rather, create one entry for each macro_provider, grouping the macro_provider.get_macros() names as the macro names corresponding to the macro_provider.get_description().

in reply to:  5 comment:6 by Christian Boos, 14 years ago

Component: generalwiki system
Resolution: fixed
Status: newclosed

Replying to cboos:

Rather, create one entry for each macro_provider, grouping the macro_provider.get_macros() names as the macro names corresponding to the macro_provider.get_description().

A bit more involved than just that, but it was the general idea ;-)

Fixed in r9309.

comment:7 by Christian Boos, 14 years ago

Owner: set to Christian Boos

comment:8 by Christian Boos, 14 years ago

Milestone: next-minor-0.12.x0.12

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.