Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs scrolling behaviour after changing font size

Emacs23 GUI in Ubuntu 10.04 LTS. I've previously not changed any settings relating to Emacs scrolling behaviour. However, today I noticed a peculiar jumping behaviour when scrolling down in a buffer -- the cursor down key would scroll down as normal to a point and then the next keypress down would sometimes scroll the buffer down instead or sometimes appear to scroll the buffer up and then move the selected line down. It appeared to be more buggy behaviour rather than the normal or predictable jumping of the buffer. If I held down the down cursor the screen would jump and scroll and stutter and then lurch forward and then stutter.

I searched for some answers and tried a few mentioned here, but nothing solved the problem. Only then did I realize that this behaviour is new -- it only appeared after I changed the font in the buffer with C-x C--. When I returned the font to the "default" with C-x C-+, the scrolling behaviour returned to normal (the point moves to the last line, then the next press scrolls a few lines and moves the point up and displays the lines below; this is the default I think and I'm happy with it). Ideas?

Edit: Scrolling up works fine (as expected/default) regardless of font-size changes. Changing the font smaller a second time only makes the scrolling more bizarre.

Edit: Temporary workaround: return to using emacs -nw

Update: Tested on another Ubuntu 10.04 machine (desktop). Launched Emacs 23 and loaded a log file. Maximized Emacs. Help down cursor and scrolling worked as normal -- the cursor gets to the bottom, the buffer scrolls and the cursor moves to the middle of the screen. C-x C-- to reduce font size. Scroll down again. Same strange jerky behaviour, where some jumps don't seem to even move the buffer properly. Enlarge font once, and scrolling returns to normal. Scrolling up is fine regardless of font size. I searched the Emacs bug tracker briefly but did not find a bug which matched.

like image 887
SabreWolfy Avatar asked Jun 29 '11 08:06

SabreWolfy


2 Answers

I've had this problem (or something very similar) for a long time. I finally found something (on EmacsWiki) that's working:

(setq auto-window-vscroll nil)

Without this, the buffer will not scroll down correctly when I've altered the font size, regardless of my scroll settings, which are, for what it's worth,

(setq scroll-conservatively 10)
(setq scroll-margin 7)
like image 136
harpo Avatar answered Sep 20 '22 12:09

harpo


Consider filing an Emacs bug: M-x report-emacs-bug.

like image 34
Drew Avatar answered Sep 18 '22 12:09

Drew