Skip to content

Emacs Traditional Precise Scrolling

suntong edited this page Jul 3, 2021 · 11 revisions

What's improved?

Are you one of the die-hard Emacs users that start your Emacs with:

(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)

Well, you don't have to now, if you use Emacs Traditional, because it does not have the menu-bar or tool-bar mode built in at all.

And most importantly, it brings back the traditional "Precise Scrolling", as I call it.

What is it?

First of all, what is this "Precise Scrolling"?

Here is how people describe (and miss) it:

wdc on 2003-07-08 reporting to redhat:

We just went to Red Hat 9.0, and I noticed that the behavior of scrollbars changed.

The old (and documented within emacs) behavior is:

Left mouse click: scroll the line next to the scroll bar mouse position to the top of the window.

Right mouse click: scroll the top line down to the location of the scroll bar mouse click.

. . .

I am REALLY disheartened that somehow Emacs would end up becoming infected by the bad Microsoft-style scrollbar behavior. Ideally, I'd be able to tell ALL my scrollbars to behave the way the Emacs scrollbars USED to. CMU got this right in 1986, but apparently the value of this style has been lost

Does anyone know how to fix this?

soborobo on April 22nd, 2010 in ubuntuforums:

Scrolling is all messed up in emacs!
. . .

Correct scrolling activity in a window:

A left-click in the scroll-bar will scroll down the window the amount relative to the top of the visible window port. So, if you click near the bottom of the scroll-bar the window scrolls down one page! If you do the same near the top of the scroll-bar then only a few lines are scrolled down.

A right-click in the scroll bar currently does nothing! :mad: Its operation should be the opposite of the left-click, basically scrolling up the window port based on where in the scroll-bar it is activated. If you scrolled down with a left-click, then a right-click at the exact same position will return the window to the same position that it was at before that initial left-click!

Can this be corrected within emacs? Or will gnome or linux need modification? 😕

How it works?

Emacs-Traditional-Precise-Scrolling.gif

Here is the video version of the above screencast.

How the GNU Emacs Manual describes it officially​​​​​​​?

The following is the GNU Emacs Manual version as of 12 Oct 2007:

Scroll Bars

On graphical displays, Emacs normally makes a scroll bar at the left of each Emacs window. The scroll bar runs the height of the window, and shows a moving rectangular inner box which represents the portion of the buffer currently displayed. The entire height of the scroll bar represents the entire length of the buffer.

You can use Mouse-2 (normally, the middle button) in the scroll bar to move or drag the inner box up and down. If you move it to the top of the scroll bar, you see the top of the buffer. If you move it to the bottom of the scroll bar, you see the bottom of the buffer.

The left and right buttons in the scroll bar scroll by controlled increments. Mouse-1 (normally, the left button) moves the line at the level where you click up to the top of the window. Mouse-3 (normally, the right button) moves the line at the top of the window down to the level where you click. By clicking repeatedly in the same place, you can scroll by the same distance over and over.

Where is it available?