From c26fdcf522246239b2399422b9a1900826ef69b1 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Wed, 13 Jul 2011 16:57:28 +0200 Subject: [PATCH] Say that we were unable to find the match within the limit * simple.el (blink-matching-open): Say that we were unable to find the match within the limit, if we're limited (bug#5122). --- lisp/ChangeLog | 3 +++ lisp/simple.el | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 87d62690f7c..60639bcffb2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-07-13 Lars Magne Ingebrigtsen + * simple.el (blink-matching-open): Say that we were unable to find + the match within the limit, if we're limited (bug#5122). + * international/mule-cmds.el (prefer-coding-system): Add an example (bug#4869). diff --git a/lisp/simple.el b/lisp/simple.el index 2c792a2c78e..383f66a5a13 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5487,15 +5487,19 @@ The function should return non-nil if the two tokens do not match.") (when (and (not (bobp)) blink-matching-paren) (let* ((oldpos (point)) + (limit-message "") (message-log-max nil) ; Don't log messages about paren matching. (blinkpos (save-excursion (save-restriction - (if blink-matching-paren-distance - (narrow-to-region - (max (minibuffer-prompt-end) ;(point-min) unless minibuf. - (- (point) blink-matching-paren-distance)) - oldpos)) + (when blink-matching-paren-distance + (let ((start (- (point) blink-matching-paren-distance))) + (when (> start (minibuffer-prompt-end)) + (setq limit-message " within the limit")) + (narrow-to-region + (max (minibuffer-prompt-end) ;(point-min) unless minibuf. + start) + oldpos))) (let ((parse-sexp-ignore-comments (and parse-sexp-ignore-comments (not blink-matching-paren-dont-ignore-comments)))) @@ -5517,11 +5521,11 @@ The function should return non-nil if the two tokens do not match.") (mismatch (if blinkpos (if (minibufferp) - (minibuffer-message "Mismatched parentheses") - (message "Mismatched parentheses")) + (minibuffer-message "Mismatched parentheses%s" limit-message) + (message "Mismatched parentheses%s" limit-message)) (if (minibufferp) - (minibuffer-message "Unmatched parenthesis") - (message "Unmatched parenthesis")))) + (minibuffer-message "Unmatched parenthesis%s" limit-message) + (message "Unmatched parenthesis%s" limit-message)))) ((not blinkpos) nil) ((pos-visible-in-window-p blinkpos) ;; Matching open within window, temporarily move to blinkpos but only -- 2.39.5