[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch: minor display glitch with show-paren-mode

From: Ben North
Subject: Patch: minor display glitch with show-paren-mode
Date: Tue, 28 Nov 2006 11:54:26 +0000
User-agent: Internet Messaging Program (IMP) 3.2.8

When using `show-paren-mode', I've noticed a slight problem: suppose you
have show-paren-mode turned on, and point is at -!- in the following:

    (setq a -!-(car b))

Then the opening and closing parens of `(car b)' are both highlighted.
Now type a few characters quickly.  If you are quick enough, the
characters you type are also highlighted, because the overlay which
highlights the `(' has not yet had a chance to be moved.  The tiny patch
below (against CVS HEAD, rev 1.69) makes the two relevant overlays
front-advancing, which seems to fix the problem.

--- ORIG/paren.el       2006-11-28 11:14:46.840839000 +0000
+++ NEW/paren.el        2006-11-28 11:16:16.059970000 +0000
@@ -220,7 +220,7 @@
              (if show-paren-overlay-1
                  (move-overlay show-paren-overlay-1 from to (current-buffer))
-               (setq show-paren-overlay-1 (make-overlay from to)))
+               (setq show-paren-overlay-1 (make-overlay from to nil t)))
              ;; Always set the overlay face, since it varies.
              (overlay-put show-paren-overlay-1 'priority show-paren-priority)
              (overlay-put show-paren-overlay-1 'face face)))
@@ -243,7 +243,7 @@
                          (forward-point (- dir))))))
            (if show-paren-overlay
                (move-overlay show-paren-overlay from to (current-buffer))
-             (setq show-paren-overlay (make-overlay from to))))
+             (setq show-paren-overlay (make-overlay from to nil t))))
          ;; Always set the overlay face, since it varies.
          (overlay-put show-paren-overlay 'priority show-paren-priority)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]