(forward-sexp 1))
;; Now check that like matches like.
(goto-char start)
- (while (progn (skip-syntax-forward "^(")
- (not (eobp)))
- (let ((match (matching-paren (following-char))))
- (save-excursion
+ (while (re-search-forward "\\s(" nil t)
+ (save-excursion
+ (let ((pos (match-beginning 0)))
+ (goto-char pos)
(forward-sexp 1)
- (or (= (preceding-char) match)
- (error "Mismatched parentheses"))))
- (forward-char 1)))
+ (or (eq (preceding-char) (cdr (syntax-after pos)))
+ (eq (char-after pos) (cdr (syntax-after (1- (point)))))
+ (error "Mismatched parentheses"))))))
(error
(skip-syntax-forward " .>")
(setq failure-point (point)))))