diff options
| author | Philipp Stephani | 2017-07-02 18:14:21 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2017-07-09 21:55:31 +0200 |
| commit | bb2ea81bc569bdc51e1c9af1c503a22fb95e4384 (patch) | |
| tree | 6daac769532574d017f24fe386d23f136072bd56 /test | |
| parent | 633db417fc3e905b28b017facdf596b36914b44d (diff) | |
| download | emacs-bb2ea81bc569bdc51e1c9af1c503a22fb95e4384.tar.gz emacs-bb2ea81bc569bdc51e1c9af1c503a22fb95e4384.zip | |
Further improve electric quote support for Markdown (Bug#24709)
Markdown sets both 'comment-start' and 'comment-use-syntax' to non-nil
values. Therefore 'electric-quote-mode' recognized it as a
programming mode. Fix this by first checking whether the current
major mode is derived from 'text-mode'.
* lisp/electric.el (electric-quote-post-self-insert-function): Treat
'text-mode' as stronger signal than comment syntax.
* test/lisp/electric-tests.el (electric-quote-markdown-in-text)
(electric-quote-markdown-in-code): Adapt unit tests.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/electric-tests.el | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el index c4ccec7a0d8..c6ffccc0794 100644 --- a/test/lisp/electric-tests.el +++ b/test/lisp/electric-tests.el | |||
| @@ -694,6 +694,8 @@ baz\"\"" | |||
| 694 | :bindings '((electric-quote-context-sensitive . t)) | 694 | :bindings '((electric-quote-context-sensitive . t)) |
| 695 | :test-in-comments nil :test-in-strings nil) | 695 | :test-in-comments nil :test-in-strings nil) |
| 696 | 696 | ||
| 697 | ;; Simulate ‘markdown-mode’: it sets both ‘comment-start’ and | ||
| 698 | ;; ‘comment-use-syntax’, but derives from ‘text-mode’. | ||
| 697 | (define-electric-pair-test electric-quote-markdown-in-text | 699 | (define-electric-pair-test electric-quote-markdown-in-text |
| 698 | "" "'" :expected-string "’" :expected-point 2 | 700 | "" "'" :expected-string "’" :expected-point 2 |
| 699 | :modes '(text-mode) | 701 | :modes '(text-mode) |
| @@ -703,6 +705,7 @@ baz\"\"" | |||
| 703 | (lambda () | 705 | (lambda () |
| 704 | (save-excursion (search-backward "`" nil t))) | 706 | (save-excursion (search-backward "`" nil t))) |
| 705 | nil :local)) | 707 | nil :local)) |
| 708 | :bindings '((comment-start . "<!--") (comment-use-syntax . t)) | ||
| 706 | :test-in-comments nil :test-in-strings nil) | 709 | :test-in-comments nil :test-in-strings nil) |
| 707 | 710 | ||
| 708 | (define-electric-pair-test electric-quote-markdown-in-code | 711 | (define-electric-pair-test electric-quote-markdown-in-code |
| @@ -714,6 +717,7 @@ baz\"\"" | |||
| 714 | (lambda () | 717 | (lambda () |
| 715 | (save-excursion (search-backward "`" nil t))) | 718 | (save-excursion (search-backward "`" nil t))) |
| 716 | nil :local)) | 719 | nil :local)) |
| 720 | :bindings '((comment-start . "<!--") (comment-use-syntax . t)) | ||
| 717 | :test-in-comments nil :test-in-strings nil) | 721 | :test-in-comments nil :test-in-strings nil) |
| 718 | 722 | ||
| 719 | (provide 'electric-tests) | 723 | (provide 'electric-tests) |