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

Ability to disable markdown-insert-gfm-code-block prompt #38

Closed
mcandre opened this issue Nov 11, 2015 · 4 comments · Fixed by #54
Closed

Ability to disable markdown-insert-gfm-code-block prompt #38

mcandre opened this issue Nov 11, 2015 · 4 comments · Fixed by #54

Comments

@mcandre
Copy link

mcandre commented Nov 11, 2015

I appreciate the option to specify a language name for gfm triple backticks pre-formatted code blocks, but 99% of the time, I always want to skip it.

Could we introduce a configurable variable for whether the prompt is raised, or nil, or some preferred default language name is used?

@jrblevin
Copy link
Owner

This sounds good to me. I envision a minibuffer prompt with completion based on previously used language keywords in the current buffer (using read-from-minibuffer with the hist and default-value arguments). A global fallback default (for the first code block in a buffer) could be defined in a custom variable. There are other things I need to work on first, so if anyone else wants to write a patch in the meantime that would speed things up.

As a workaround for now you could re-bind </kbd> to self-insert-commandin thegfm-mode-hook` (just added today).

@cosmicexplorer
Copy link
Contributor

I would think it'd be more appropriate to have a list of all the recognized languages gfm provides (which we'd have to update every so often) and do a completing-read (with history and default-value, and global default like you said) from that list instead of just read-from-minibuffer. Does that sound good? I'll take a look at this one.

@jrblevin
Copy link
Owner

jrblevin commented Jan 3, 2016

Having a pre-specified list of languages is a great idea. I agree that completion would be preferred. I actually thought read-from-minibuffer did that, but I given the names I suppose it only provides history, not history and completion. If you could take a look at this, that would be great!

@jrblevin
Copy link
Owner

jrblevin commented Jan 4, 2016

We now have completion for programming language names as described above with some additional enhancements. Also see the new variable markdown-gfm-use-electric-backquote, which determines whether to use markdown-electric-backquote when backquote is pressed three times (default: t). Thanks to @cosmicexplorer for implementing this!

@jrblevin jrblevin closed this as completed Jan 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants