summaryrefslogtreecommitdiff
path: root/lisp/elec-pair.el
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2016-11-08 11:53:20 +0000
committerReuben Thomas <rrt@sc3d.org>2016-12-02 14:43:58 +0000
commitb6a8025eed3349ef98701ef07fa47e4abf22d1cc (patch)
tree8424438933973f2e74b1da533cb4c2c26ab8b638 /lisp/elec-pair.el
parent66d6e7e9ecf5e481f8c2c3a4f88411f66c869a6e (diff)
downloademacs-b6a8025eed3349ef98701ef07fa47e4abf22d1cc.tar.gz
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, from electric-quote-chars. 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).
Diffstat (limited to 'lisp/elec-pair.el')
-rw-r--r--lisp/elec-pair.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el
index 116292027cd..47d44b1cfcc 100644
--- a/lisp/elec-pair.el
+++ b/lisp/elec-pair.el
@@ -28,7 +28,9 @@
;;; Electric pairing.
(defcustom electric-pair-pairs
- '((?\" . ?\"))
+ '((?\" . ?\")
+ ((nth 0 electric-quote-chars) . (nth 1 electric-quote-chars))
+ ((nth 2 electric-quote-chars) . (nth 3 electric-quote-chars)))
"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 @@ See also the variable `electric-pair-text-pairs'."
;;;###autoload
(defcustom electric-pair-text-pairs
- '((?\" . ?\" ))
+ '((?\" . ?\" )
+ ((nth 0 electric-quote-chars) . (nth 1 electric-quote-chars))
+ ((nth 2 electric-quote-chars) . (nth 3 electric-quote-chars)))
"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