diff options
author | Juri Linkov <juri@linkov.net> | 2019-05-05 22:34:03 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2019-05-05 22:34:03 +0300 |
commit | c64cb02cca320811032bb300ea6d12cf59acf65d (patch) | |
tree | e6b5afd1a573cea8bf17db10b826f7237d3031cf /lisp/emacs-lisp/lisp.el | |
parent | df9b56ecff43b64f39e98ab118fe9a0f299882c4 (diff) | |
download | emacs-c64cb02cca320811032bb300ea6d12cf59acf65d.tar.gz |
* lisp/emacs-lisp/lisp.el (insert-pair-alist): Precompute default value.
Use unicode-property-table-internal with 'paired-bracket to append
pairs of open/close characters to the default value (bug#35480).
Diffstat (limited to 'lisp/emacs-lisp/lisp.el')
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index d10d5f0d101..f73dbb269d8 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -646,7 +646,13 @@ Interactively, the behavior depends on `narrow-to-defun-include-comments'." (narrow-to-region beg end)))) (defvar insert-pair-alist - '((?\( ?\)) (?\[ ?\]) (?\{ ?\}) (?\< ?\>) (?\" ?\") (?\' ?\') (?\` ?\')) + (append '((?\< ?\>) (?\" ?\") (?\' ?\') (?\` ?\')) + (let (alist) + (map-char-table + (lambda (open close) + (when (< open close) (push (list open close) alist))) + (unicode-property-table-internal 'paired-bracket)) + (nreverse alist))) "Alist of paired characters inserted by `insert-pair'. Each element looks like (OPEN-CHAR CLOSE-CHAR) or (COMMAND-CHAR OPEN-CHAR CLOSE-CHAR). The characters OPEN-CHAR and CLOSE-CHAR |