]> git.eshelyaron.com Git - emacs.git/commit
Electric quotes: Improve support for Markdown mode (Bug#24709)
authorPhilipp Stephani <phst@google.com>
Wed, 28 Jun 2017 21:47:57 +0000 (23:47 +0200)
committerPhilipp Stephani <phst@google.com>
Sun, 2 Jul 2017 15:48:23 +0000 (17:48 +0200)
commit34d4720f833bb382b28d9faecf82d34db1eb4494
treef149e3b03da94c7db458610007e82b33ac735018
parentd90b98a2a52abf67b84aa12df282b0defec8505b
Electric quotes: Improve support for Markdown mode (Bug#24709)

Introduce a new user option 'electric-quote-context-sensitive'.  If
non-nil, have ' insert an opening quote if sensible.

Also introduce a new variable 'electric-quote-code-faces'.  Major
modes such as 'markdown-mode' can add faces to this list to treat text
as inline code and disable electric quoting.

* lisp/electric.el (electric-quote-context-sensitive): New user
option.
(electric-quote-code-faces): New variable.
(electric-quote-post-self-insert-function): Treat ' as ` if
desired and applicable; disable electric quoting for given faces.

* test/lisp/electric-tests.el (electric-quote-opening-single)
(electric-quote-closing-single, electric-quote-opening-double)
(electric-quote-closing-double)
(electric-quote-context-sensitive-backtick)
(electric-quote-context-sensitive-bob-single)
(electric-quote-context-sensitive-bob-double)
(electric-quote-context-sensitive-bol-single)
(electric-quote-context-sensitive-bol-double)
(electric-quote-context-sensitive-after-space-single)
(electric-quote-context-sensitive-after-space-double)
(electric-quote-context-sensitive-after-letter-single)
(electric-quote-context-sensitive-after-letter-double)
(electric-quote-context-sensitive-after-paren-single)
(electric-quote-context-sensitive-after-paren-double)
(electric-quote-markdown-in-text)
(electric-quote-markdown-in-code): New unit tests.
etc/NEWS
lisp/electric.el
test/lisp/electric-tests.el