]> git.eshelyaron.com Git - emacs.git/commitdiff
(blink-matching-open): Work correctly on chars that
authorRichard M. Stallman <rms@gnu.org>
Fri, 29 Aug 2003 16:07:16 +0000 (16:07 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 29 Aug 2003 16:07:16 +0000 (16:07 +0000)
are designated as parens through the syntax-table text property.

lisp/simple.el

index 2a90fa6740c133c9b303c41d5c5de587d6272b14..508569d55fa743af4e36daef2ef19c65b6def7d6 100644 (file)
@@ -3500,7 +3500,8 @@ when it is off screen)."
                           (point)))))
        (let* ((oldpos (point))
              (blinkpos)
-             (mismatch))
+             (mismatch)
+             matching-paren)
         (save-excursion
           (save-restriction
             (if blink-matching-paren-distance
@@ -3514,12 +3515,20 @@ when it is off screen)."
                   (setq blinkpos (scan-sexps oldpos -1)))
               (error nil)))
           (and blinkpos
-               (/= (char-syntax (char-after blinkpos))
-                   ?\$)
-               (setq mismatch
-                     (or (null (matching-paren (char-after blinkpos)))
+               (save-excursion
+                 (goto-char blinkpos)
+                 (not (looking-at "\\s$")))
+               (setq matching-paren
+                     (or (and parse-sexp-lookup-properties
+                              (let ((prop (get-text-property blinkpos 'syntax-table)))
+                                (and (consp prop)
+                                     (eq (car prop) 4)
+                                     (cdr prop))))
+                         (matching-paren (char-after blinkpos)))
+                     mismatch
+                     (or (null matching-paren)
                          (/= (char-after (1- oldpos))
-                             (matching-paren (char-after blinkpos))))))
+                             matching-paren))))
           (if mismatch (setq blinkpos nil))
           (if blinkpos
               ;; Don't log messages about paren matching.