]> git.eshelyaron.com Git - emacs.git/commitdiff
(blink-matching-open): Don't display message when no
authorMartin Rudalics <rudalics@gmx.at>
Sat, 15 Sep 2007 09:37:00 +0000 (09:37 +0000)
committerMartin Rudalics <rudalics@gmx.at>
Sat, 15 Sep 2007 09:37:00 +0000 (09:37 +0000)
paren is found within blink-matching-paren-distance characters.
Don't search prompt in blink-matching-paren-distance nil case.

admin/FOR-RELEASE
lisp/ChangeLog
lisp/simple.el

index 51dd86929a136ddc4adb8c9cf6cbb055ad36ee54..58a3e63e9610437af250e48340ac2e0ccc512966 100644 (file)
@@ -99,10 +99,6 @@ http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00020.html
 ** Bug/Patch view.el
 http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00073.html
 
-** jbw@macs.hw.ac.uk: parentheses matching failure on valid sexp
-http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01140.html
-
-
 * FIXES FOR EMACS 22.3
 
 Here we list any small fixes that arrived too late for Emacs 22.2, but
index 31754a63bc54ca84b66f21dfb94746c92b46241e..cf557b581c3fbfb09eec343ddf8475d5de550ff5 100644 (file)
@@ -1,3 +1,9 @@
+2007-09-15  Martin Rudalics  <rudalics@gmx.at>
+
+       * simple.el (blink-matching-open): Don't display message when no
+       paren is found within blink-matching-paren-distance characters.
+       Don't search prompt in blink-matching-paren-distance nil case.
+
 2007-09-14  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * term/xterm.el (terminal-init-xterm): Add C-M- bindings.
index 2aee3e43cfecbd92192db8416ca523b83ce7e7c1..dec4111e86397ea991dc6a1f5c151bc3121d952e 100644 (file)
@@ -4481,15 +4481,20 @@ it skips the contents of comments that end before point."
                                 (point))))))
     (let* ((oldpos (point))
           blinkpos
-          message-log-max  ; Don't log messages about paren matching.
+          message-log-max    ; Don't log messages about paren matching.
           matching-paren
-          open-paren-line-string)
+          open-paren-line-string
+          old-start
+          new-start)
       (save-excursion
        (save-restriction
-         (if blink-matching-paren-distance
-             (narrow-to-region (max (minibuffer-prompt-end)
-                                    (- (point) blink-matching-paren-distance))
-                               oldpos))
+         ;; Don't search for matching paren within minibuffer prompt.
+         (setq old-start (minibuffer-prompt-end))
+         (setq new-start
+               (if blink-matching-paren-distance
+                   (max old-start (- (point) blink-matching-paren-distance))
+                 old-start))
+         (narrow-to-region new-start oldpos)
          (condition-case ()
              (let ((parse-sexp-ignore-comments
                     (and parse-sexp-ignore-comments
@@ -4505,15 +4510,18 @@ it skips the contents of comments that end before point."
                          (eq (syntax-class syntax) 4)
                          (cdr syntax)))))
        (cond
+        ((not blinkpos)
+         (unless (and blink-matching-paren-distance (> new-start old-start))
+           ;; When `blink-matching-paren-distance' is non-nil and we
+           ;; didn't find a matching paren within that many characters
+           ;; don't display a message.
+           (message "Unmatched parenthesis")))
         ((not (or (eq matching-paren (char-before oldpos))
-                   ;; The cdr might hold a new paren-class info rather than
-                   ;; a matching-char info, in which case the two CDRs
-                   ;; should match.
-                   (eq matching-paren (cdr (syntax-after (1- oldpos))))))
+                  ;; The cdr might hold a new paren-class info rather than
+                  ;; a matching-char info, in which case the two CDRs
+                  ;; should match.
+                  (eq matching-paren (cdr (syntax-after (1- oldpos))))))
          (message "Mismatched parentheses"))
-        ((not blinkpos)
-         (if (not blink-matching-paren-distance)
-             (message "Unmatched parenthesis")))
         ((pos-visible-in-window-p blinkpos)
          ;; Matching open within window, temporarily move to blinkpos but only
          ;; if `blink-matching-paren-on-screen' is non-nil.