Mercurial > emacs
comparison lisp/paren.el @ 77851:5d313ba2e8de
(show-paren-function): Undo 2007-04-19 and 2007-04-20 changes.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Fri, 01 Jun 2007 13:47:44 +0000 |
parents | 97456f440211 |
children | 9355f9b7bbff 31beec9ee600 |
comparison
equal
deleted
inserted
replaced
77850:18f27a3ca811 | 77851:5d313ba2e8de |
---|---|
141 (defun show-paren-function () | 141 (defun show-paren-function () |
142 (if show-paren-mode | 142 (if show-paren-mode |
143 (let ((oldpos (point)) | 143 (let ((oldpos (point)) |
144 (dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1) | 144 (dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1) |
145 ((eq (syntax-class (syntax-after (point))) 4) 1))) | 145 ((eq (syntax-class (syntax-after (point))) 4) 1))) |
146 (window-start (window-start)) | |
147 pos mismatch face) | 146 pos mismatch face) |
148 ;; | 147 ;; |
149 ;; Find the other end of the sexp. | 148 ;; Find the other end of the sexp. |
150 (when dir | 149 (when dir |
151 (save-excursion | 150 (save-excursion |
246 (move-overlay show-paren-overlay from to (current-buffer)) | 245 (move-overlay show-paren-overlay from to (current-buffer)) |
247 (setq show-paren-overlay (make-overlay from to nil t)))) | 246 (setq show-paren-overlay (make-overlay from to nil t)))) |
248 ;; | 247 ;; |
249 ;; Always set the overlay face, since it varies. | 248 ;; Always set the overlay face, since it varies. |
250 (overlay-put show-paren-overlay 'priority show-paren-priority) | 249 (overlay-put show-paren-overlay 'priority show-paren-priority) |
251 (overlay-put show-paren-overlay 'face face)) | 250 (overlay-put show-paren-overlay 'face face))) |
252 ;; If there are continued lines, the above operations can | |
253 ;; force redisplay to recenter the window (since there is no | |
254 ;; way for it to know that the overlay changes to the buffer | |
255 ;; are harmless). So reset the window-start. | |
256 (unless (window-minibuffer-p) | |
257 (set-window-start (selected-window) window-start))) | |
258 ;; show-paren-mode is nil in this buffer. | 251 ;; show-paren-mode is nil in this buffer. |
259 (and show-paren-overlay | 252 (and show-paren-overlay |
260 (delete-overlay show-paren-overlay)) | 253 (delete-overlay show-paren-overlay)) |
261 (and show-paren-overlay-1 | 254 (and show-paren-overlay-1 |
262 (delete-overlay show-paren-overlay-1)))) | 255 (delete-overlay show-paren-overlay-1)))) |