changeset 47357:97c0efea1010

(show-paren-function): Use syntax-after.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 09 Sep 2002 23:16:49 +0000
parents c4da69acaa79
children fb6838a09b61
files lisp/paren.el
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/paren.el	Mon Sep 09 23:14:13 2002 +0000
+++ b/lisp/paren.el	Mon Sep 09 23:16:49 2002 +0000
@@ -135,11 +135,10 @@
 ;; and show it until input arrives.
 (defun show-paren-function ()
   (if show-paren-mode
-      (let (pos dir mismatch face (oldpos (point)))
-	(cond ((eq (char-syntax (preceding-char)) ?\))
-	       (setq dir -1))
-	      ((eq (char-syntax (following-char)) ?\()
-	       (setq dir 1)))
+      (let ((oldpos (point))
+	    (dir (cond ((eq (car (syntax-after (1- (point)))) 5) -1)
+		       ((eq (car (syntax-after (point))) 4) 1)))
+	    pos mismatch face)
 	;;
 	;; Find the other end of the sexp.
 	(when dir