aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/paren.el20
1 files changed, 12 insertions, 8 deletions
diff --git a/lisp/paren.el b/lisp/paren.el
index 66d27fbb6af..51b75388b83 100644
--- a/lisp/paren.el
+++ b/lisp/paren.el
@@ -104,7 +104,7 @@ after `show-paren-delay' seconds of Emacs idle time."
104 (let ((beg (min pos oldpos)) (end (max pos oldpos))) 104 (let ((beg (min pos oldpos)) (end (max pos oldpos)))
105 (and (/= (char-syntax (char-after beg)) ?\$) 105 (and (/= (char-syntax (char-after beg)) ?\$)
106 (setq mismatch 106 (setq mismatch
107 (not (eq (char-after (1- end)) 107 (not (eq (char-before end)
108 ;; This can give nil. 108 ;; This can give nil.
109 (matching-paren (char-after beg)))))))) 109 (matching-paren (char-after beg))))))))
110 ;; If they don't properly match, use a different face, 110 ;; If they don't properly match, use a different face,
@@ -137,9 +137,9 @@ after `show-paren-delay' seconds of Emacs idle time."
137 ;; highlight the paren at point to indicate misbalance. 137 ;; highlight the paren at point to indicate misbalance.
138 (let ((from (if (= dir 1) 138 (let ((from (if (= dir 1)
139 (point) 139 (point)
140 (1- (point)))) 140 (forward-point -1)))
141 (to (if (= dir 1) 141 (to (if (= dir 1)
142 (1+ (point)) 142 (forward-point 1)
143 (point)))) 143 (point))))
144 (if show-paren-overlay-1 144 (if show-paren-overlay-1
145 (move-overlay show-paren-overlay-1 145 (move-overlay show-paren-overlay-1
@@ -157,11 +157,15 @@ after `show-paren-delay' seconds of Emacs idle time."
157 ;; If it's an unmatched paren, turn off any such highlighting. 157 ;; If it's an unmatched paren, turn off any such highlighting.
158 (or (and (not (integerp pos)) 158 (or (and (not (integerp pos))
159 (delete-overlay show-paren-overlay)) 159 (delete-overlay show-paren-overlay))
160 (if show-paren-overlay 160 (save-excursion
161 (move-overlay show-paren-overlay (- pos dir) pos 161 (goto-char pos)
162 (current-buffer)) 162 (if show-paren-overlay
163 (setq show-paren-overlay 163 (move-overlay show-paren-overlay
164 (make-overlay (- pos dir) pos)))) 164 (forward-point (- dir))
165 pos
166 (current-buffer))
167 (setq show-paren-overlay
168 (make-overlay (forward-point (- dir)) pos)))))
165 ;; Always set the overlay face, since it varies. 169 ;; Always set the overlay face, since it varies.
166 (overlay-put show-paren-overlay 'face face)) 170 (overlay-put show-paren-overlay 'face face))
167 (t 171 (t