emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master c64cb02: * lisp/emacs-lisp/lisp.el (insert-pair-ali


From: Juri Linkov
Subject: [Emacs-diffs] master c64cb02: * lisp/emacs-lisp/lisp.el (insert-pair-alist): Precompute default value.
Date: Sun, 5 May 2019 15:34:10 -0400 (EDT)

branch: master
commit c64cb02cca320811032bb300ea6d12cf59acf65d
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    * 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).
---
 lisp/emacs-lisp/lisp.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index d10d5f0..f73dbb2 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]