changeset 41515:1df0e35d264c

Don't profile syntax-ppss any more. (syntax-after): New fun.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 25 Nov 2001 22:05:17 +0000
parents 6fbc91a79b0b
children 52c9115c94be
files lisp/emacs-lisp/syntax.el
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/syntax.el	Sun Nov 25 22:03:45 2001 +0000
+++ b/lisp/emacs-lisp/syntax.el	Sun Nov 25 22:05:17 2001 +0000
@@ -279,7 +279,13 @@
 ;;   (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