155 |
(condition-case () |
(condition-case () |
156 |
(setq pos (scan-sexps (point) dir)) |
(setq pos (scan-sexps (point) dir)) |
157 |
(error (setq pos t mismatch t))) |
(error (setq pos t mismatch t))) |
158 |
|
;; Move back the other way and verify we get back to the |
159 |
|
;; starting point. If not, these two parens don't really match. |
160 |
|
;; Maybe the one at point is escaped and doesn't really count. |
161 |
|
(when (integerp pos) |
162 |
|
(unless (condition-case () |
163 |
|
(eq (point) (scan-sexps pos (- dir))) |
164 |
|
(error nil)) |
165 |
|
(setq pos nil))) |
166 |
;; If found a "matching" paren, see if it is the right |
;; If found a "matching" paren, see if it is the right |
167 |
;; kind of paren to match the one we started at. |
;; kind of paren to match the one we started at. |
168 |
(when (integerp pos) |
(when (integerp pos) |