Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As the subject title says, has anyone any suggestions for how to achieve smooth scrolling of the text display in emacs?

The various approaches suggested on the Emacs wiki seem to work only in Linux. I'm using EmacsW32 for what it matters, but I tested with the standard Emacs distribution as well, with no results.

As a long time Vim user, I'm fairly surprised that Emacs cannot scroll smoothly by itself.

share|improve this question

As a long time emacs user, I rarely think to use my mouse's wheel for scrolling... however, others have. There's a page on smooth scrolling on the emacs wiki.

Update: I found a better answer on the NextLineBehavior page: "Change scroll-conservatively to 1 or other suitably small number, not zero."

share|improve this answer
Well, I didn't mean with my mouse either. Just standard Ctrl-N or the arrow down key on your keyboard. But as I mentioned, the wiki stuff doesn't work for Windows at all (well the upwards direction is semi-tolerable, downwards not at all) – Svend Apr 26 '10 at 19:36
Interesting stuff. I must be so used to the standard emacs behavior that I never noticed that it doesn't scroll a line at a time. This is emacs, however, there must be a way to customize this. – Doug Harris Apr 26 '10 at 19:40
Sadly, neither solutions offered on that page does anything in Windows (might work on Linux, didn't test). It works when I just press downwards once, but if I keep it down, the screen does not update until I let go (well the scroll does move...), which is clearly not really useful at all. – Svend Apr 26 '10 at 20:16
I'm new to Emacs and almost always use scrolling. How do you usually jump to specific bits of code you need to adjust? – Dante Sep 14 '12 at 7:57
Most frequently by incremental search (C-s / C-r) next by big navigation commands (C-v/M-v) and then using per-line or per-word jumps. – Doug Harris Sep 14 '12 at 18:41

In my searching I found this:

(setq default-truncate-lines t)
(defun point-of-beginning-of-bottom-line ()
    (move-to-window-line -1)

(defun point-of-beginning-of-line ()

(defun next-one-line () (interactive)
  (if (= (point-of-beginning-of-bottom-line) (point-of-beginning-of-line))
      (progn (scroll-up 1)
             (next-line 1))
    (next-line 1)))

(defun point-of-beginning-of-top-line ()
    (move-to-window-line 0)

(defun previous-one-line () (interactive)
  (if (= (point-of-beginning-of-top-line) (point-of-beginning-of-line))
      (progn (scroll-down 1)
             (previous-line 1))
    (previous-line 1)))

(global-set-key (kbd "<down>") 'next-one-line)
(global-set-key (kbd "<up>") 'previous-one-line)

Which sort of helped me in aquamacs and mac os x. Maybe can be useful for WIN as well.

I took it from the emacs' wiki

share|improve this answer

Not exactly sure what you mean by smooth scrolling.. but this is what I use:

(global-set-key [(meta up)] '(lambda(amount) (interactive "p") (scroll-up amount)))
(global-set-key [(meta down)] '(lambda(amount) (interactive "p") (scroll-down amount)))

This works fine for me with the regular GNU win32 emacs build.

share|improve this answer
 ;;; scrollers
 (global-set-key "\M-n" '"\C-u1\C-v")
 (global-set-key "\M-p" '"\C-u1\M-v")

I use this for scrolling. I remember I have copied this from SO only.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .