Function: electric-pair--with-syntax-1

electric-pair--with-syntax-1 is a byte-compiled function defined in elec-pair.el.gz.

Signature

(electric-pair--with-syntax-1 STRING-OR-COMMENT BODY-FUN)

Source Code

;; Defined in /usr/src/emacs/lisp/elec-pair.el.gz
(defun electric-pair--with-syntax-1 (string-or-comment body-fun)
  (if (not string-or-comment)
      (funcall body-fun)
    ;; Here we assume that the `syntax-ppss' cache has already been filled
    ;; past `string-or-comment' with data corresponding to the "normal" syntax
    ;; (this should be the case because STRING-OR-COMMENT was returned
    ;; in the `nth 8' of `syntax-ppss').
    ;; Maybe we should narrow-to-region so that `syntax-ppss' uses the narrow
    ;; cache?
    (syntax-ppss-flush-cache string-or-comment)
    (let ((syntax-propertize-function nil))
       (unwind-protect
           (with-syntax-table electric-pair-text-syntax-table
             (funcall body-fun))
         (syntax-ppss-flush-cache string-or-comment)))))