changeset 12893:3ae9326907aa

(blink-matching-paren-dont-ignore-comments): New var. (blink-matching-open): Use it. Also, if the matching char hasn't paren syntax, call that mismatch.
author Richard M. Stallman <rms@gnu.org>
date Sat, 19 Aug 1995 16:59:43 +0000
parents 8b902b24d749
children b2a75405de3c
files lisp/simple.el
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Sat Aug 19 16:54:27 1995 +0000
+++ b/lisp/simple.el	Sat Aug 19 16:59:43 1995 +0000
@@ -2611,6 +2611,9 @@
 (defconst blink-matching-delay 1
   "*The number of seconds that `blink-matching-open' will delay at a match.")
 
+(defconst blink-matching-paren-dont-ignore-comments nil
+  "*Non-nil means `blink-matching-paren' should not ignore comments.")
+
 (defun blink-matching-open ()
   "Move cursor momentarily to the beginning of the sexp before point."
   (interactive)
@@ -2632,13 +2635,18 @@
 					(- (point) blink-matching-paren-distance))
 				   oldpos))
 	     (condition-case ()
-		 (setq blinkpos (scan-sexps oldpos -1))
+		 (let ((parse-sexp-ignore-comments
+			(and parse-sexp-ignore-comments
+			     (not blink-matching-paren-dont-ignore-comments))))
+		   (setq blinkpos (scan-sexps oldpos -1)))
 	       (error nil)))
-	   (and blinkpos (/= (char-syntax (char-after blinkpos))
-			     ?\$)
+	   (and blinkpos
+		(/= (char-syntax (char-after blinkpos))
+		    ?\$)
 		(setq mismatch
-		      (/= (char-after (1- oldpos))
-			  (matching-paren (char-after blinkpos)))))
+		      (or (null (matching-paren (char-after blinkpos)))
+			  (/= (char-after (1- oldpos))
+			      (matching-paren (char-after blinkpos))))))
 	   (if mismatch (setq blinkpos nil))
 	   (if blinkpos
 	       (progn