full screen background image

sosto.net blog - montagne del ticino
sosto.net blog - montagne del ticino
#linux

Mouse scroll with Emacs

Picture the scene: you have just completed the installation of your brand new Ubuntu Linux. Now, you download and install Emacs and you are ready to start developing a great application. It is then when you realize that you cannot scroll up and down the page using the mouse wheel. How to fix this problem? Just add the code below to the .emacs file in your home folder and that's it!


(defun up-slightly () (interactive) (scroll-up 5))
(defun down-slightly () (interactive) (scroll-down 5))
(global-set-key [mouse-4] 'down-slightly)
(global-set-key [mouse-5] 'up-slightly)

(defun up-one () (interactive) (scroll-up 1))
(defun down-one () (interactive) (scroll-down 1))
(global-set-key [S-mouse-4] 'down-one)
(global-set-key [S-mouse-5] 'up-one)


(defun up-a-lot () (interactive) (scroll-up))
(defun down-a-lot () (interactive) (scroll-down))
(global-set-key [C-mouse-4] 'down-a-lot)
(global-set-key [C-mouse-5] 'up-a-lot)


Save and restart Emacs.

sosto.net tombstone

coshomments
Do you want to say something?


name* (max 20 characters)

contact e-mail* (it won't be published)

comment*


hastags

View all hashtags.

search


links sosto.net

Instagram

clemspace.ch


archive

March (1)
February (1)
January (2)

Archives

popular posts

Da Bosco Gurin alla Val Bedretto, via Basodino

Gazzirola e Camoghè

Via alta della Val Carassina

settings

A–   A+

italiano
français
english

sosto.net - top of the page


cross cross cross sandwich fullscreen fullscreen resize resize fullscreen fullscreen fullscreen fullscreen fullscreen fullscreen fullscreen