changeset 9434:d79ecfc2776c

(blink-matching-open): Check there is a previous nonblank line before trying to display it. No need for backward-char before the skip-chars-backward.
author Richard M. Stallman <rms@gnu.org>
date Tue, 11 Oct 1994 07:29:05 +0000
parents 06c286dec485
children 3a157cdf395c
files lisp/simple.el
diffstat 1 files changed, 18 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Tue Oct 11 05:29:55 1994 +0000
+++ b/lisp/simple.el	Tue Oct 11 07:29:05 1994 +0000
@@ -2412,19 +2412,24 @@
 			   (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))))))))
+		       ;; Otherwise show the previous nonblank line,
+		       ;; if there is one.
+		       (if (save-excursion
+			     (skip-chars-backward "\n \t")
+			     (not (bobp)))
+			   (concat
+			    (buffer-substring (progn
+					       (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)))
+			 ;; There is nothing to show except the char itself.
+			 (buffer-substring blinkpos (1+ blinkpos))))))))
 	     (cond (mismatch
 		    (message "Mismatched parentheses"))
 		   ((not blink-matching-paren-distance)