# HG changeset patch # User Chong Yidong # Date 1177003297 0 # Node ID 276c15b45d4bab2eff7e6a307a17ba8c6652804c # Parent 822ad5dba2394494e405687e33da7b74195300a7 (show-paren-function): Reset window-start to avoid recentering. diff -r 822ad5dba239 -r 276c15b45d4b lisp/paren.el --- a/lisp/paren.el Thu Apr 19 17:18:55 2007 +0000 +++ b/lisp/paren.el Thu Apr 19 17:21:37 2007 +0000 @@ -143,6 +143,7 @@ (let ((oldpos (point)) (dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1) ((eq (syntax-class (syntax-after (point))) 4) 1))) + (window-start (window-start)) pos mismatch face) ;; ;; Find the other end of the sexp. @@ -247,7 +248,12 @@ ;; ;; Always set the overlay face, since it varies. (overlay-put show-paren-overlay 'priority show-paren-priority) - (overlay-put show-paren-overlay 'face face))) + (overlay-put show-paren-overlay 'face face)) + ;; If there are continued lines, the above operations can + ;; force redisplay to recenter the window (since there is no + ;; way for it to know that the overlay changes to the buffer + ;; are harmless). So reset the window-start. + (set-window-start (selected-window) window-start)) ;; show-paren-mode is nil in this buffer. (and show-paren-overlay (delete-overlay show-paren-overlay))