Subject: Re: bug#148: [Bernardo Dal Seno]: scroll-margin and scroll-preserve-screen-position cause refresh problem

From: "Bernardo Dal Seno" <[email-masked]>
Date: Tue, 22 Apr 2008 16:53:58 +0200

> This behavior is not a bug in itself, it's just a symptom: it means that
> redisplay was interrupted by user input before it had time
> to terminate.  See redisplay-dont-pause.

I tried the following .emacs:
---BEGIN---
(custom-set-variables
 '(scroll-margin 2)
 '(scroll-preserve-screen-position t)
 '(redisplay-dont-pause t)
)
---END---
and the bug appeared as before.

> This may of
> course depend on the file's content and the major-mode (since part of the
> redisplay time might be used by font-locking, for example).

In order to avoid font-locking and strange hooks, I copied a plain
text file to '/tmp/xxyyzz' and opened it with Emacs.  Same problem.

Actually, the display isn't updated if I scroll the buffer when the
cursor is in the first two lines of the window.  A partial work-around
I've found is adding this to .emacs:
---CUT---
(add-hook 'find-file-hook
    (function (lambda ()
                      (goto-line (+ 1 scroll-margin))
                  )))
---CUT---
When I open a file I can scroll it immediately, as the cursor is on
the third line, but whenever I move the cursor to the beginning of the
buffer, the bug shows up again.

I don't know anything about Emacs internals, but it seems a very
strange behavior.

Bernardo