From 1ab0fac670b7575a683282e2f8c86b6525d6cca1 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 25 Nov 2001 22:05:17 +0000 Subject: [PATCH] Don't profile syntax-ppss any more. (syntax-after): New fun. --- lisp/emacs-lisp/syntax.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index f00c8752dd4..68b2eaabbcb 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -279,7 +279,13 @@ Point is at POS when this function returns." ;; (with-current-buffer (or buffer (current-buffer)) ;; (syntax-ppss-depth (syntax-ppss)))) -(elp-instrument-list '(syntax-ppss)) +(defun syntax-after (pos) + "Return the syntax of the char after POS." + (unless (or (< pos (point-min)) (>= pos (point-max))) + (let ((st (if parse-sexp-lookup-properties + (get-char-property pos 'syntax-table)))) + (if (consp st) st + (aref (or st (syntax-table)) (char-after pos)))))) (provide 'syntax) ;;; syntax.el ends here -- 2.39.5