Variable: electric-pair-text-pairs

electric-pair-text-pairs is a customizable variable defined in elec-pair.el.gz.

Value

((34 . 34) (8216 . 8217) (8220 . 8221))

Documentation

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 no syntax relevant to electric-pair-mode(var)/electric-pair-mode(fun) in the syntax table defined in electric-pair-text-syntax-table.

Each list element should be in one of these forms:
 (CHAR . CHAR)
Where CHAR is character to be used as pair.

 (STRING STRING SPC)
Where STRING is a string to be used as pair and SPC a non-nil value which specifies to insert an extra space after first STRING.

 (STRING . STRING)
This is similar to (STRING STRING SPC) form, except that SPC (space) is ignored and will not be inserted.

In both string pairs forms, the first string pair must be a regular expression.

Unlike character pairs, string pairs do not support inserting pairs in regions and cannot be deleted with electric-pair-delete-pair, thus string pairs should be used only for multi-character pairs.

See also the variable electric-pair-pairs.

This variable was added, or its default value changed, in Emacs 24.4.

Probably introduced at or before Emacs version 24.4.

Source Code

;; Defined in /usr/src/emacs/lisp/elec-pair.el.gz
(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
no syntax relevant to `electric-pair-mode' in the syntax table
defined in `electric-pair-text-syntax-table'.

Each list element should be in one of these forms:
 (CHAR . CHAR)
Where CHAR is character to be used as pair.

 (STRING STRING SPC)
Where STRING is a string to be used as pair and SPC a non-nil value
which specifies to insert an extra space after first STRING.

 (STRING . STRING)
This is similar to (STRING STRING SPC) form, except that SPC (space) is
ignored and will not be inserted.

In both string pairs forms, the first string pair must be a regular
expression.

Unlike character pairs, string pairs do not support
inserting pairs in regions and cannot be deleted with
`electric-pair-delete-pair', thus string pairs should be used only for
multi-character pairs.

See also the variable `electric-pair-pairs'."
  :version "24.4"
  :group 'electricity
  :type '(repeat
          (choice (cons :tag "Characters" character character)
                  (cons :tag "Strings" string string)
                  (list :tag "Strings, plus insert SPC after first string"
                        string string boolean))))