]> git.eshelyaron.com Git - emacs.git/commitdiff
Say that we were unable to find the match within the limit
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 13 Jul 2011 14:57:28 +0000 (16:57 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 13 Jul 2011 14:57:28 +0000 (16:57 +0200)
* 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
lisp/simple.el

index 87d62690f7c5cb6c1ec3a5ea3cd61335b53dcc6b..60639bcffb25e569784e05dfa5d1f3ab6be8a377 100644 (file)
@@ -1,5 +1,8 @@
 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * 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).
 
index 2c792a2c78ea794c80b23ff3b246c2a66ba46dd8..383f66a5a136a55ed1b4db0863285075c89ea38e 100644 (file)
@@ -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