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

completing-read gfm code languages #54

Merged
merged 20 commits into from
Jan 4, 2016

Conversation

cosmicexplorer
Copy link
Contributor

Fixes #38.

Does a few other things (although I swept the truly extraneous stuff to #53):

  1. defcustoms for additional languages for gfm to complete outside of the given set, and also one to toggle whether or not to use electric-backquote at all.
  2. Flattens the markdown-regex-gfm-code-block-open/close into a single regex, and uses that for highlighting. It was impossible to detect which line was supposed to contain a valid language otherwise.
  3. Parses the current buffer for languages that aren't in the corpus and adds them to a buffer-local list, which is part of the completing-read input.
  4. Consistently uses markdown-replace-regexp-in-string.

Concerns:
I use helm, so it's always somewhat slower to load than the default, but 335 candidates is proving to be pretty slow to bring up (and it's not the cl-find call, that only takes about .05 seconds once byte-compiled according to (benchmark)). So I was thinking many of the languages in linguist are pretty nonimportant, and I tried selecting about 100 of them which had names I could recognize, but that didn't seem to improve it for me at all, so I think it's just that helm's completing-read is slow. Let me know if you have those performance concerns and we can probably just triage the languages (although it'd have to be a pretty heavy triage since 100 candidates is still taking just over a third of a second to bring up the completions buffer).

@cosmicexplorer cosmicexplorer changed the title Feat/complete gfm code langs completing-read gfm code languages Jan 3, 2016
@jrblevin
Copy link
Owner

jrblevin commented Jan 4, 2016

Fantastic—thanks for working on this. I don't have any performance issues on my end (nor do I use helm). Looks great to me so far. I will test it a bit more before merging.

@jrblevin
Copy link
Owner

jrblevin commented Jan 4, 2016

One small thing I noticed regarding capitalization: For the first fenced code block in a file, the capitalization in the pre-specified language list seems to dominate what is typed by the user. For example, if I type "Fortran" as the language name the empty code block will be inserted as

``` FORTRAN

```

while I would have expected

``` Fortran

```

I won't have time to poke around the code until later today at the earliest, but I'll take a look.

jrblevin added a commit that referenced this pull request Jan 4, 2016
@jrblevin jrblevin merged commit 58a52e2 into jrblevin:master Jan 4, 2016
@cosmicexplorer
Copy link
Contributor Author

Yeah, check out my response in #59.

@blaenk
Copy link

blaenk commented Jan 11, 2016

For what it's worth, I didn't really notice any performance issues and I use helm as well.

@cosmicexplorer
Copy link
Contributor Author

Cool! Guess my laptop is just slow.

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.

Ability to disable markdown-insert-gfm-code-block prompt
3 participants