Subject: Re: bug#35480: insert-wide-parentheses

From: Juri Linkov <[email-masked]>
Date: Tue, 07 May 2019 23:21:57 +0300

>> Also tried to add a button that would pre-fill the default value
>> with Unicode bracket pairs, but I see no way to do this because
>> customize's :options is limited to ‘hook’, ‘plist’, ‘alist’ types
>> only, alas.
>
> Can't you use the alist type?  The options is called insert-pair-ALIST
> after all.

I tried the alist type:

(defcustom insert-pair-alist
  '((?\( ?\)) (?\[ ?\]) (?\{ ?\}) (?\< ?\>) (?\" ?\") (?\' ?\') (?\` ?\'))
  "Alist of paired characters inserted by `insert-pair'."
  :type '(alist :key-type (character :tag "Open/Command")
                :value-type (choice
                             (list :tag "Pair"
                                   (character :tag "Close"))
                             (list :tag "Triplet"
                                   (character :tag "Open")
                                   (character :tag "Close"))))
  :options '(?\（)
  :group 'lisp
  :version "27.1")

but its :options allows specifying only keys, not alist values.