Skip to content

Independent case-sensitivity for command aliases#1878

Merged
rolandwalker merged 1 commit intomainfrom
RW/separate-alias-command-case-sensitivity
May 2, 2026
Merged

Independent case-sensitivity for command aliases#1878
rolandwalker merged 1 commit intomainfrom
RW/separate-alias-command-case-sensitivity

Conversation

@rolandwalker
Copy link
Copy Markdown
Contributor

Description

  • convert SpecialCommand from a named tuple to a dataclass
  • add SpecialCommandAlias to hold alias strings and case preference for the alias alone
  • always use "alias" instead of "shortcut" internally
  • always use list or None when setting aliases internally, deferring the choice of the first element until presentation
  • make sure every special command passes a non-None usage, and make the argument a str type
  • vertical format when registering a special command, for readability

Motivation: to set case-sensitivity in the way that makes the most sense for each command and alias. For example, most non-alias commands such as \edit can probably become case-insensitive. But the short form \e might remain case-sensitive.

Thinking ahead, we may want to add more properties to the dataclass to support nicer help on special commands.

The intention is that there is no functional change in this refactor.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this May 2, 2026
 * convert SpecialCommand from a named tuple to a dataclass
 * add SpecialCommandAlias to hold alias strings and case preference for
   the alias alone
 * always use "alias" instead of "shortcut" internally
 * always use list or None when setting aliases internally, deferring
   the choice of the first element until presentation
 * make sure every special command passes a non-None usage, and make
   the argument a str type
 * vertical format when registering a special command, for readability

Motivation: to set case-sensitivity in the way that makes the most sense
for each command and alias.  For example, most non-alias commands such
as "\edit" can probably become case-insensitive.  But the short form
"\e" might remain case-sensitive.

Thinking ahead, we may want to add more properties to the dataclass
to support help on special commands.

The intention is that there is no functional change in this refactor.
@rolandwalker rolandwalker force-pushed the RW/separate-alias-command-case-sensitivity branch from abbfa80 to f89d5f6 Compare May 2, 2026 13:52
@rolandwalker rolandwalker requested review from amjith and scottnemes May 2, 2026 14:59
@rolandwalker rolandwalker merged commit a28264e into main May 2, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/separate-alias-command-case-sensitivity branch May 2, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant