Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!CS.WISC.EDU!dave From: dave@CS.WISC.EDU (Dave Cohrs) Newsgroups: gnu.emacs Subject: smooth scrolling Message-ID: <8908021543.AA00534@romano.cs.wisc.edu> Date: 2 Aug 89 15:43:14 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 33 Have you ever noticed that sometimes when you (scroll-up) or (scroll-down), emacs (18.54) insists on doing really ugly things to your display, like scrolling the entire display up/down (moving the banner line) and then scrolling it back again? Well, I figured out the reason behind this. When you have a message in the minibuffer, like "Mark set", and you scroll, emacs tries to "optimize" the screen refresh, and, instead of just clearing out the minibuf line, it does this wonderful scrolling stuff. Bletch! That may be more efficient on an ascii terminal (I doubt it), but on a bitmapped display, it is always ALWAYS cheaper to clean up a single line that to scroll the entire window all over the place. Below are two functions, (smooth-scroll-up) and (smooth-scroll-down) that solve the problem without trying to hack the update optimizer. You need to have the (update-display) function defined -- you can find it in the Sun or X11 support. Perhaps (update-display) should be pulled out of these packages and put in a central place? (defun smooth-scroll-up (arg) (interactive "P") (message "") (update-display) (scroll-up arg)) (defun smooth-scroll-down (arg) (interactive "P") (message "") (update-display) (scroll-down arg)) (define-key global-map "\C-v" 'smooth-scroll-up) (define-key esc-map "v" 'smooth-scroll-down)