Skip to content

Support keeping entirely capitalized words (optionally) #30

Open
@ideasman42

Description

@ideasman42

Often fully capitalized words are initials, and should not be changed, e.g.

  • ISO Standard references - APA Style
  • GNU General Public License
  • Optimizing RAM Usage

... in these cases, instead of maintaining a list of acronyms, I think a reasonable rule of thumb is not to adjust fully capitalized words. Or at least have a rule to do so.

Note that this is how my much shorter script worked: https://emacs.stackexchange.com/a/66362/2418

Activity

duckwork

duckwork commented on Jan 18, 2022

@duckwork
Owner

Dammit, this means my implementation still has bugs. I was just about to come over here to open an issue about capital letters at the end of a region not staying capitalized ...

However, the current main should properly keep these ALL-CAPS words capitalized; can you make sure it does?

EDIT on reading this comment over again I want to make it clear that the "dammit" at the beginning of it is directed at myself --- this issue has plagued me for some hours now!

DOUBLE EDIT I do want to note that on my Emacs at least, when capitalizing the phrases you've provided the acronyms stay capitalized. I'm running the latest main of titlecase.

ideasman42

ideasman42 commented on Jan 18, 2022

@ideasman42
ContributorAuthor

Ah, then this is a bug, some titles I tried failed so I assumed it was unsupported, but as you state, this works sometimes too.

These fails for me:

  • Emacs: API 29 -> Emacs: Api 29
  • API API API -> Api Api Api
  • API Three API -> API Three Api
duckwork

duckwork commented on Jan 19, 2022

@duckwork
Owner

Hm, this is something. I thought at first it was just the last word logic being weird, but it might be something else.

However, the second one

  • API API API -> Api Api Api

is correct, at least for this version of titlecase.el. If it detects the whole text is all-caps before title-casing, it lowercases everything first. Of course, I made this configurable too (see titlecase-normalize-functions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Support keeping entirely capitalized words (optionally) · Issue #30 · duckwork/titlecase.el