From f1da10dbcf576a13ca848132ea77c108489b9b2d Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Tue, 8 Nov 2016 11:53:20 +0000 Subject: [PATCH 1/2] Add support for curly quotation marks to electric-pair-mode * lisp/elec-pair.el (electric-pair-pairs, electric-pair-text-pairs): Add entries for left/right single/double quotation marks. Note that this is safe for single quotation marks, unlike with the ASCII apostrophe, since, although the right quotation mark can be used as an apostrophe, it is the left quotation mark that is typed to get a pair (Bug#24901). --- lisp/elec-pair.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index 1162920..3658601 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -28,7 +28,9 @@ ;;; Electric pairing. (defcustom electric-pair-pairs - '((?\" . ?\")) + '((?\" . ?\") + (#x201c . #x201d) ; LEFT/RIGHT SINGLE QUOTATION MARK + (#x2018 . #x2019)) ; LEFT/RIGHT DOUBLE QUOTATION MARK "Alist of pairs that should be used regardless of major mode. Pairs of delimiters in this list are a fallback in case they have @@ -42,7 +44,9 @@ electric-pair-pairs ;;;###autoload (defcustom electric-pair-text-pairs - '((?\" . ?\" )) + '((?\" . ?\" ) + (#x201c . #x201d) ; LEFT/RIGHT SINGLE QUOTATION MARK + (#x2018 . #x2019)) ; LEFT/RIGHT DOUBLE QUOTATION MARK "Alist of pairs that should always be used in comments and strings. Pairs of delimiters in this list are a fallback in case they have -- 2.7.4