aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-03-26 05:53:18 +0000
committerRichard M. Stallman1994-03-26 05:53:18 +0000
commite9f1d66d7c3229ae443a8cd742ba1adf1f63716e (patch)
tree325f121d550198cc10c78d0705bf0eb795c92eb2
parent5b5bb5e486eccb82d10174a96cee31078637eabf (diff)
downloademacs-e9f1d66d7c3229ae443a8cd742ba1adf1f63716e.tar.gz
emacs-e9f1d66d7c3229ae443a8cd742ba1adf1f63716e.zip
(blink-matching-open): Now three strategies for choosing
the text to display when the matching open is off screen.
-rw-r--r--lisp/simple.el27
1 files changed, 21 insertions, 6 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index cc2e4c6d801..05e011395f2 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2277,17 +2277,32 @@ in the mode line."
2277 (goto-char blinkpos) 2277 (goto-char blinkpos)
2278 (message 2278 (message
2279 "Matches %s" 2279 "Matches %s"
2280 ;; Show what precedes the open in its line, if anything.
2280 (if (save-excursion 2281 (if (save-excursion
2281 (skip-chars-backward " \t") 2282 (skip-chars-backward " \t")
2282 (not (bolp))) 2283 (not (bolp)))
2283 (buffer-substring (progn (beginning-of-line) (point)) 2284 (buffer-substring (progn (beginning-of-line) (point))
2284 (1+ blinkpos)) 2285 (1+ blinkpos))
2285 (buffer-substring blinkpos 2286 ;; Show what follows the open in its line, if anything.
2286 (progn 2287 (if (save-excursion
2287 (forward-char 1) 2288 (forward-char 1)
2288 (skip-chars-forward "\n \t") 2289 (skip-chars-forward " \t")
2289 (end-of-line) 2290 (not (eolp)))
2290 (point))))))) 2291 (buffer-substring blinkpos
2292 (progn (end-of-line) (point)))
2293 ;; Otherwise show the previous nonblank line.
2294 (concat
2295 (buffer-substring (progn
2296 (backward-char 1)
2297 (skip-chars-backward "\n \t")
2298 (beginning-of-line)
2299 (point))
2300 (progn (end-of-line)
2301 (skip-chars-backward " \t")
2302 (point)))
2303 ;; Replace the newline and other whitespace with `...'.
2304 "..."
2305 (buffer-substring blinkpos (1+ blinkpos))))))))
2291 (cond (mismatch 2306 (cond (mismatch
2292 (message "Mismatched parentheses")) 2307 (message "Mismatched parentheses"))
2293 ((not blink-matching-paren-distance) 2308 ((not blink-matching-paren-distance)