Please note that LinuxExchange will be shutting down on December 31st, 2016. Visit this thread for additional information and to provide feedback.

1
3

My mouse wheel scrolls 3 lines at a time (in the Emacs screen) !

I tried the following link, but it didn't succeed. http://www.emacswiki.org/emacs/SmoothScrolling

Kindly guide.

asked 16 Jun '10, 09:19

anishakaul's gravatar image

anishakaul
1315
accept rate: 0%

edited 16 Jun '10, 09:42

What exactly, from the many solutions at the link you supplied, did you try? Did you try "mouse wheel & keyboard scroll one line at a time"?

(16 Jun '10, 10:34) Jazz ♦

Jazz,

I tried the following: 1. "mouse wheel & keyboard scroll one line at a time" 2. "Sniplets: (setq scroll-conservatively 10000)"

I added the above two codes in ~/.emacs but they didn't have any effect !

(16 Jun '10, 11:56) anishakaul
1

@anishakaul: Did you re-evaluate your .emacs file once you'd added the code so that the changes were picked up? (If in doubt make the changes and then restart emacs).

(18 Jun '10, 11:08) Amos

I shall try that and let you know after 2 days,

Thanks

(19 Jun '10, 13:10) anishakaul



I just tried the following, and it worked just as expected:

;; scroll one line at a time (less "jumpy" than defaults) 
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time
(setq mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling
(setq mouse-wheel-follow-mouse 't) ;; scroll window under mouse
(setq scroll-step 1) ;; keyboard scroll one line at a time

Do you get errors when you start emacs? Have you, in any other way, configured mouse behaviour in emacs?

Try a default .emacs configuration and add those lines, to see if something else interferes.

link

answered 17 Jun '10, 17:32

Jazz's gravatar image

Jazz ♦
7811312
accept rate: 33%

Jazz,

I do get errors when I evaluate the expressions using, Ctrl-x Ctrl-e My mouse cursor was on (right side) 1 in the below code: (setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) I pressed Ctrl-x Ctrl-e to evaluate the expression and it resulted in the following errors : and my above code dis appeared !

(25 Jun '10, 05:35) anishakaul

Debugger entered--Lisp error: (invalid-read-syntax ".") read(#<buffer .emacs="">) preceding-sexp() eval-last-sexp-1(nil) eval-last-sexp(nil) call-interactively(eval-last-sexp nil nil) recursive-edit() byte-code("306^P @307=203!^@310311312"210313311!211^ZA@)242314=203!^@310315312"210316^K!210317 210320 !2$ debug(error (invalid-read-syntax ".")) read(#<buffer .emacs="">) preceding-sexp() eval-last-sexp-1(nil) eval-last-sexp(nil) call-interactively(eva

(25 Jun '10, 05:35) anishakaul

Since this seems to be a syntax error, try the following: (setq mouse-wheel-scroll-amount '(0.01))

(25 Jun '10, 17:23) Jazz ♦

Jazz,

Many thanks to you bothering to reply,

I want to show my .emacs file here, where should I post it ? This comments box is too small for that file !!

(17 Jul '10, 05:07) anishakaul

I'm happy to help. You could use a site like http://pastebin.com/ for posting your .emacs file. Remember to set the post expiration to one month.

(17 Jul '10, 23:31) Jazz ♦

Thanks Jazz, All that code I was trying till now was w.r.t -nw option i.e. When Emacs is opened like this : emacs -nw abc.c

Now I tried that code after opening Emacs like : emacs abc.c

But

Now when I scroll the wheel of my mouse, the cursor remains still and the screen scrolls, that is very annoying, I want the cursor to move not the screen.

(18 Jul '10, 07:49) anishakaul

The cursor should automatically be set to the top or bottom of your current display if you scroll down/up far enough. Per default, the cursor doesn't follow your scrolling, though.

The following minor mode probably matches your needs: http://www.emacswiki.org/emacs/centered-cursor-mode.el

(19 Jul '10, 17:48) Jazz ♦
showing 5 of 7 show 2 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×5

Asked: 16 Jun '10, 09:19

Seen: 5,174 times

Last updated: 17 Jun '10, 17:32

powered by OSQA