aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/lisp.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index f73dbb269d8..38df920f17a 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -645,14 +645,8 @@ Interactively, the behavior depends on `narrow-to-defun-include-comments'."
645 (re-search-backward "^\n" (- (point) 1) t) 645 (re-search-backward "^\n" (- (point) 1) t)
646 (narrow-to-region beg end)))) 646 (narrow-to-region beg end))))
647 647
648(defvar insert-pair-alist 648(defcustom insert-pair-alist
649 (append '((?\< ?\>) (?\" ?\") (?\' ?\') (?\` ?\')) 649 '((?\( ?\)) (?\[ ?\]) (?\{ ?\}) (?\< ?\>) (?\" ?\") (?\' ?\') (?\` ?\'))
650 (let (alist)
651 (map-char-table
652 (lambda (open close)
653 (when (< open close) (push (list open close) alist)))
654 (unicode-property-table-internal 'paired-bracket))
655 (nreverse alist)))
656 "Alist of paired characters inserted by `insert-pair'. 650 "Alist of paired characters inserted by `insert-pair'.
657Each element looks like (OPEN-CHAR CLOSE-CHAR) or (COMMAND-CHAR 651Each element looks like (OPEN-CHAR CLOSE-CHAR) or (COMMAND-CHAR
658OPEN-CHAR CLOSE-CHAR). The characters OPEN-CHAR and CLOSE-CHAR 652OPEN-CHAR CLOSE-CHAR). The characters OPEN-CHAR and CLOSE-CHAR
@@ -661,7 +655,16 @@ or without modifiers, are inserted by `insert-pair'.
661 655
662If COMMAND-CHAR is specified, it is a character that triggers the 656If COMMAND-CHAR is specified, it is a character that triggers the
663insertion of the open/close pair, and COMMAND-CHAR itself isn't 657insertion of the open/close pair, and COMMAND-CHAR itself isn't
664inserted.") 658inserted."
659 :type '(repeat (choice (list :tag "Pair"
660 (character :tag "Open")
661 (character :tag "Close"))
662 (list :tag "Triple"
663 (character :tag "Command")
664 (character :tag "Open")
665 (character :tag "Close"))))
666 :group 'lisp
667 :version "27.1")
665 668
666(defun insert-pair (&optional arg open close) 669(defun insert-pair (&optional arg open close)
667 "Enclose following ARG sexps in a pair of OPEN and CLOSE characters. 670 "Enclose following ARG sexps in a pair of OPEN and CLOSE characters.