Edgewall Software
Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 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: cboos
Priority: normal Milestone: 0.12
Component: wiki system Version: none
Severity: normal Keywords: bitesized
Cc:
Release Notes:
API 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 Changed 4 years ago by Ryan Ollos <ryano@…>

  • Summary changed from MacroList should be case insensitive to MacroList should only display one help entry when there are multiple macros defined that differ only by case

comment:2 Changed 4 years ago by rblank

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 Changed 4 years ago by cboos

  • Milestone set to next-minor-0.12.x

comment:4 Changed 4 years ago by rblank

  • Keywords bitesized added

comment:5 follow-up: Changed 4 years ago by 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().

comment:6 in reply to: ↑ 5 Changed 4 years ago by cboos

  • Component changed from general to wiki system
  • Resolution set to fixed
  • Status changed from new to closed

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 Changed 4 years ago by cboos

  • Owner set to cboos

comment:8 Changed 4 years ago by cboos

  • Milestone changed from next-minor-0.12.x to 0.12

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed The owner will remain cboos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from cboos to the specified user.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.