]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/syntax.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / emacs-lisp / syntax.el
index 654f234fa625f342c70c7941433c4734d493e9c7..31fc67ec8156fe1c44ab9a8b93a446ea540df24f 100644 (file)
@@ -417,6 +417,9 @@ point (where the PPSS is equivalent to nil).")
              (error nil)))
          syntax-ppss-stats))
 
+(defvar-local syntax-ppss-table nil
+  "Syntax-table to use during `syntax-ppss', if any.")
+
 (defun syntax-ppss (&optional pos)
   "Parse-Partial-Sexp State at POS, defaulting to point.
 The returned value is the same as that of `parse-partial-sexp'
@@ -432,6 +435,7 @@ running the hook."
   (unless pos (setq pos (point)))
   (syntax-propertize pos)
   ;;
+  (with-syntax-table (or syntax-ppss-table (syntax-table))
   (let ((old-ppss (cdr syntax-ppss-last))
        (old-pos (car syntax-ppss-last))
        (ppss nil)
@@ -568,7 +572,7 @@ running the hook."
        ;; we may end up calling parse-partial-sexp with a position before
        ;; point-min.  In that case, just parse from point-min assuming
        ;; a nil state.
-       (parse-partial-sexp (point-min) pos)))))
+       (parse-partial-sexp (point-min) pos))))))
 
 ;; Debugging functions