September 10, 2007 — jao

A quick and sweet tip for one of those things surprisingly difficult to get right in emacs: buffer scrolling. If you find awkward the way emacs makes your buffers jump when you move the cursor near their begin or end, try putting this file in your load path and (require 'smooth-scrolling) . You can control when scrolling starts by setting the variable smooth-scroll-margin : when the cursor is that far from the top or bottom borders, scrolling begins (default is 10 lines). Works like a charm here.

By the way, as Adam (the author of the code above) points out in the comments below, the problem is trickier than it seems. If you’re curious, this EmacsWiki page gives the details.