aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-08-29 16:07:16 +0000
committerRichard M. Stallman2003-08-29 16:07:16 +0000
commit01ce617af9ffa87beaf24bf427f7246b13cbd2a8 (patch)
treeb3faf1691adaa9611e0c2ecce219fced00c942a9
parent749eb4018ac32b337a14d18a8ca41e1aa6a15621 (diff)
downloademacs-01ce617af9ffa87beaf24bf427f7246b13cbd2a8.tar.gz
emacs-01ce617af9ffa87beaf24bf427f7246b13cbd2a8.zip
(blink-matching-open): Work correctly on chars that
are designated as parens through the syntax-table text property.
-rw-r--r--lisp/simple.el21
1 files changed, 15 insertions, 6 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 2a90fa6740c..508569d55fa 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3500,7 +3500,8 @@ when it is off screen)."
3500 (point))))) 3500 (point)))))
3501 (let* ((oldpos (point)) 3501 (let* ((oldpos (point))
3502 (blinkpos) 3502 (blinkpos)
3503 (mismatch)) 3503 (mismatch)
3504 matching-paren)
3504 (save-excursion 3505 (save-excursion
3505 (save-restriction 3506 (save-restriction
3506 (if blink-matching-paren-distance 3507 (if blink-matching-paren-distance
@@ -3514,12 +3515,20 @@ when it is off screen)."
3514 (setq blinkpos (scan-sexps oldpos -1))) 3515 (setq blinkpos (scan-sexps oldpos -1)))
3515 (error nil))) 3516 (error nil)))
3516 (and blinkpos 3517 (and blinkpos
3517 (/= (char-syntax (char-after blinkpos)) 3518 (save-excursion
3518 ?\$) 3519 (goto-char blinkpos)
3519 (setq mismatch 3520 (not (looking-at "\\s$")))
3520 (or (null (matching-paren (char-after blinkpos))) 3521 (setq matching-paren
3522 (or (and parse-sexp-lookup-properties
3523 (let ((prop (get-text-property blinkpos 'syntax-table)))
3524 (and (consp prop)
3525 (eq (car prop) 4)
3526 (cdr prop))))
3527 (matching-paren (char-after blinkpos)))
3528 mismatch
3529 (or (null matching-paren)
3521 (/= (char-after (1- oldpos)) 3530 (/= (char-after (1- oldpos))
3522 (matching-paren (char-after blinkpos)))))) 3531 matching-paren))))
3523 (if mismatch (setq blinkpos nil)) 3532 (if mismatch (setq blinkpos nil))
3524 (if blinkpos 3533 (if blinkpos
3525 ;; Don't log messages about paren matching. 3534 ;; Don't log messages about paren matching.