Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-preferred case in GFM language names #59

Closed
jrblevin opened this issue Jan 4, 2016 · 3 comments
Closed

User-preferred case in GFM language names #59

jrblevin opened this issue Jan 4, 2016 · 3 comments
Labels

Comments

@jrblevin
Copy link
Owner

jrblevin commented Jan 4, 2016

For the first GFM fenced code block inserted in a file, the capitalization in the pre-specified language list seems to dominate what is typed by the user. For example, if one enters "Fortran" as the language name the empty code block will be inserted as

``` FORTRAN

```

while one would have expected to instead see

``` Fortran

```

(This was previously discussed in #54, but since that PR was merged I am just opening a new issue as a reminder.)

@jrblevin jrblevin added the bug label Jan 4, 2016
@cosmicexplorer
Copy link
Contributor

Yeah, I didn't think about this too long before I implemented it. I wanted to avoid having miscapitalized versions of languages alongside the real ones, so markdown-add-language-if-new won't add it to the corpus, and will instead return the element of the corpus that does have the "appropriate" capitalization, if the result of completing-read ("Fortran" in this case) is a differently-capitalized version of a language in the corpus.

I'm thinking let's just drop the attempt to squash capitalization and instead add all capitalizations of a language to the buffer-local corpus as they are added, and then return the unmodified language string that the user entered (as you would expect in this case). Do we want to (let ((completion-ignore-case nil)) then so the user has to confirm a different capitalization (just once per capitalization, though)? Or no?

@jrblevin
Copy link
Owner Author

jrblevin commented Jan 5, 2016

I think I misread your comments/commit messages regarding capitalization. I thought you meant for it to do this already. In any case, I think it would be good to add all capitalizations used. I suppose it should ask for confirmation (once) for the sake of consistency within a file.

@cosmicexplorer
Copy link
Contributor

Cool, so if the user enters a capitalization of a language it hasn't seen before, it'll ask to confirm (once) and add it to the corpus just as if it was a new language. I'll make a pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants