]> code.delx.au - gnu-emacs/commitdiff
(blink-matching-open): Restore point before calling minibuffer-message.
authorNoah Friedman <friedman@splode.com>
Mon, 17 Aug 2015 19:59:12 +0000 (12:59 -0700)
committerNoah Friedman <friedman@splode.com>
Mon, 17 Aug 2015 19:59:12 +0000 (12:59 -0700)
lisp/simple.el

index 00c25db07d780bd0cfed3e0f2ac45041538730c3..a9ef93e191c09e6a755991ae379a8664d75d77b6 100644 (file)
@@ -7005,8 +7005,11 @@ The function should return non-nil if the two tokens do not match.")
                  (delete-overlay blink-matching--overlay)))))
        (t
         (save-excursion
-          (goto-char blinkpos)
-          (let ((open-paren-line-string
+          (let* ((orig-pos (prog1
+                               (point)
+                             (goto-char blinkpos)))
+
+                 (open-paren-line-string
                  ;; Show what precedes the open in its line, if anything.
                  (cond
                   ((save-excursion (skip-chars-backward " \t") (not (bolp)))
@@ -7034,6 +7037,9 @@ The function should return non-nil if the two tokens do not match.")
                     (buffer-substring blinkpos (1+ blinkpos))))
                   ;; There is nothing to show except the char itself.
                   (t (buffer-substring blinkpos (1+ blinkpos))))))
+            ;; Because minibuffer-message causes a full redisplay, go back
+            ;; to the original point before that happens.
+            (goto-char orig-pos)
             (minibuffer-message
              "Matches %s"
              (substring-no-properties open-paren-line-string)))))))))