aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-06-25 01:20:11 +0000
committerRichard M. Stallman1994-06-25 01:20:11 +0000
commitd196a64d03b44cbb514f6b1dda795f30f7acb3cd (patch)
tree1eb0ef2e62aa199d9a0aa9f5b746c037057ae00c
parentfb38ca867d26fa7aa524879fa63efef00d53e2d9 (diff)
downloademacs-d196a64d03b44cbb514f6b1dda795f30f7acb3cd.tar.gz
emacs-d196a64d03b44cbb514f6b1dda795f30f7acb3cd.zip
(show-paren-command-hook): Use matching-paren.
Call overlay-put once for each overlay. Wait .1 sec to see if any input comes in.
-rw-r--r--lisp/paren.el15
1 files changed, 6 insertions, 9 deletions
diff --git a/lisp/paren.el b/lisp/paren.el
index 7ed85b56dfe..c1237f9733e 100644
--- a/lisp/paren.el
+++ b/lisp/paren.el
@@ -45,7 +45,7 @@
45 ;; Do nothing if no window system to display results with. 45 ;; Do nothing if no window system to display results with.
46 ;; Do nothing if executing keyboard macro. 46 ;; Do nothing if executing keyboard macro.
47 ;; Do nothing if input is pending. 47 ;; Do nothing if input is pending.
48 (if (and window-system (not executing-kbd-macro) (sit-for 0)) 48 (if (and window-system (not executing-kbd-macro) (sit-for 0 100))
49 (let (pos dir mismatch (oldpos (point)) 49 (let (pos dir mismatch (oldpos (point))
50 (face show-paren-face)) 50 (face show-paren-face))
51 (cond ((eq (char-syntax (preceding-char)) ?\)) 51 (cond ((eq (char-syntax (preceding-char)) ?\))
@@ -72,10 +72,7 @@
72 (and (/= (char-syntax (char-after beg)) ?\$) 72 (and (/= (char-syntax (char-after beg)) ?\$)
73 (setq mismatch 73 (setq mismatch
74 (/= (char-after (1- end)) 74 (/= (char-after (1- end))
75 (logand (lsh (aref (syntax-table) 75 (matching-paren (char-after beg)))))))
76 (char-after beg))
77 -8)
78 255))))))
79 ;; If they don't properly match, use a different face, 76 ;; If they don't properly match, use a different face,
80 ;; or print a message. 77 ;; or print a message.
81 (if mismatch 78 (if mismatch
@@ -104,8 +101,8 @@
104 (+ (point) dir) (point) 101 (+ (point) dir) (point)
105 (current-buffer)) 102 (current-buffer))
106 (setq show-paren-overlay-1 103 (setq show-paren-overlay-1
107 (make-overlay (- pos dir) pos))) 104 (make-overlay (- pos dir) pos))
108 (overlay-put show-paren-overlay-1 'face face)) 105 (overlay-put show-paren-overlay-1 'face face)))
109 ;; Otherwise, turn off any such highlighting. 106 ;; Otherwise, turn off any such highlighting.
110 (and show-paren-overlay-1 107 (and show-paren-overlay-1
111 (overlay-buffer show-paren-overlay-1) 108 (overlay-buffer show-paren-overlay-1)
@@ -115,8 +112,8 @@
115 (move-overlay show-paren-overlay (- pos dir) pos 112 (move-overlay show-paren-overlay (- pos dir) pos
116 (current-buffer)) 113 (current-buffer))
117 (setq show-paren-overlay 114 (setq show-paren-overlay
118 (make-overlay (- pos dir) pos))) 115 (make-overlay (- pos dir) pos))
119 (overlay-put show-paren-overlay 'face face)) 116 (overlay-put show-paren-overlay 'face face)))
120 (t 117 (t
121 ;; If not at a paren that has a match, 118 ;; If not at a paren that has a match,
122 ;; turn off any previous paren highlighting. 119 ;; turn off any previous paren highlighting.