Function: rcirc--electric-pair-inhibit

rcirc--electric-pair-inhibit is a byte-compiled function defined in rcirc.el.gz.

Signature

(rcirc--electric-pair-inhibit CHAR)

Documentation

Check whether CHAR should be paired by electric-pair-mode(var)/electric-pair-mode(fun).

This uses the default value inhibition predicate (as set by electric-pair-inhibit-predicate), but ignores all text prior to the prompt so that mismatches parentheses by some other message does not confuse the pairing.

Source Code

;; Defined in /usr/src/emacs/lisp/net/rcirc.el.gz
(defun rcirc--electric-pair-inhibit (char)
  "Check whether CHAR should be paired by `electric-pair-mode'.
This uses the default value inhibition predicate (as set by
`electric-pair-inhibit-predicate'), but ignores all text prior to
the prompt so that mismatches parentheses by some other message
does not confuse the pairing."
  (let ((fallback (default-value 'electric-pair-inhibit-predicate)))
    ;; The assumption is that this function is only bound by
    ;; `rcirc-mode', and should never be the global default.
    (cl-assert (not (eq fallback #'rcirc--electric-pair-inhibit)))
    (save-restriction
      (widen)
      (narrow-to-region rcirc-prompt-start-marker (point-max))
      (funcall fallback char))))