changeset 6539:b705afc2b2ec

(blink-matching-open): Now three strategies for choosing the text to display when the matching open is off screen.
author Richard M. Stallman <rms@gnu.org>
date Sat, 26 Mar 1994 05:53:18 +0000
parents 815a2d384b6e
children fd0c4b42a63b
files lisp/simple.el
diffstat 1 files changed, 21 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Sat Mar 26 05:37:00 1994 +0000
+++ b/lisp/simple.el	Sat Mar 26 05:53:18 1994 +0000
@@ -2277,17 +2277,32 @@
 		  (goto-char blinkpos)
 		  (message
 		   "Matches %s"
+		   ;; Show what precedes the open in its line, if anything.
 		   (if (save-excursion
 			 (skip-chars-backward " \t")
 			 (not (bolp)))
 		       (buffer-substring (progn (beginning-of-line) (point))
 					 (1+ blinkpos))
-		     (buffer-substring blinkpos
-				       (progn
-					(forward-char 1)
-					(skip-chars-forward "\n \t")
-					(end-of-line)
-					(point)))))))
+		     ;; Show what follows the open in its line, if anything.
+		     (if (save-excursion
+			   (forward-char 1)
+			   (skip-chars-forward " \t")
+			   (not (eolp)))
+			 (buffer-substring blinkpos
+					   (progn (end-of-line) (point)))
+		       ;; Otherwise show the previous nonblank line.
+		       (concat
+			(buffer-substring (progn
+					   (backward-char 1)
+					   (skip-chars-backward "\n \t")
+					   (beginning-of-line)
+					   (point))
+					  (progn (end-of-line)
+						 (skip-chars-backward " \t")
+						 (point)))
+			;; Replace the newline and other whitespace with `...'.
+			"..."
+			(buffer-substring blinkpos (1+ blinkpos))))))))
 	     (cond (mismatch
 		    (message "Mismatched parentheses"))
 		   ((not blink-matching-paren-distance)