branch: elpa/smartparens commit 8459f2f7f025baa8c0c98d18531a5fa32f63d949 Author: Matus Goljer <matus.gol...@gmail.com> Commit: Matus Goljer <matus.gol...@gmail.com>
fix(latex): add renamed lowercase function variants latex mode renamed some functions which used TeX and LaTeX to just all lowercase. We added these functions to the list of "special self insert commands" so smartparens runs the appropriate hooks afterwards. Fixes #834 --- smartparens.el | 9 ++++++++- test/smartparens-latex-test.el | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/smartparens.el b/smartparens.el index d45616b877..15cb58ecaa 100644 --- a/smartparens.el +++ b/smartparens.el @@ -2027,7 +2027,8 @@ BODY, do nothing." (defvar sp--self-insert-commands '(self-insert-command org-self-insert-command - LaTeX-insert-left-brace) + LaTeX-insert-left-brace + latex-insert-left-brace) "List of commands that are some sort of `self-insert-command'. Many modes rebind \"self-inserting\" keys to \"smart\" versions @@ -2041,6 +2042,12 @@ of pairs and wraps.") '( TeX-insert-dollar TeX-insert-quote + ;; At some point the TeX and LaTeX functions were renamed to + ;; lower-case names. This broke some code dealing with these + ;; modes, so we just add both versions for now. + tex-insert-dollar + tex-insert-quote + latex-insert-quote quack-insert-opening-paren quack-insert-closing-paren quack-insert-opening-bracket diff --git a/test/smartparens-latex-test.el b/test/smartparens-latex-test.el index 7d44112476..c5ed6ee8be 100644 --- a/test/smartparens-latex-test.el +++ b/test/smartparens-latex-test.el @@ -92,3 +92,11 @@ thesmeves and would not break unrelated pair)" (latex-mode) (execute-kbd-macro "``") (sp-buffer-equals "$foo ``| baz$"))) + +;; #834 +(ert-deftest sp-test-latex-wrap-with-trigger () + "A region should be wrapped with a pair if trigger key is pressed." + (sp-test-with-temp-buffer "foo Mbar baz| bam" + (latex-mode) + (execute-kbd-macro "\"") + (sp-buffer-equals "foo ``bar baz''| bam")))