Subject: 23.2; One-line scrolling & jit-lock (or font-lock)

From: Eli Barzilay <[email-masked]>
Date: Mon, 11 Apr 2011 09:59:43 -0400

Like many others, I've been trying to get Emacs to scroll the display
by one line when the cursor goes out of the displayed area.  In my
settings I have

  scroll-step 1
  scroll-conservatively 10000
  scroll-margin 0

I know that in theory only the second is needed, but I still got the
recentering behavior.  However, this is not consistent -- sometimes it
does work, but a buffer that presents the bad behavior usually
persists in doing so.

I just tried disabling `jit-lock-mode', and to my surprise that made
the problem go away, but it also disabled highlighting new text.  But
if I go through the whole buffer (so it gets the highlights) and then
disable it, scrolling works fine.  There are some guesses around that
its bold font that makes thing too slow, but that doesn't look like
the problem given what I see.

In GNU Emacs 23.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.21.4)
 of 2010-07-08 on x86-10.phx2.fedoraproject.org
Windowing system distributor `Fedora Project', version 11.0.10904000
configured using `configure  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-optimize-sibling-calls''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: POSIX
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US
  value of $XMODIFIERS: @im=none
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  whitespace-mode: t
  desktop-save-mode: t
  cua-mode: t
  display-time-mode: t
  minibuffer-electric-default-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Features:
(shadow mailalias vm-reply vm-rfaddons vm-menu vm-window vm-toolbar
vm-folder vm-mime vm-undo vm-virtual vm-summary-faces vm-summary
vm-mouse vm-page vm-motion vm-minibuf vm-message vm-misc vm-macro
vm-autoloads vm-version vm-vars vm emacsbug debug apropos find-func
jka-compr w32-vars cal-menu calendar cal-loaddefs gnus-score
score-mode gnus-async nntp gnus-sum nnoo gnus-group gnus-undo nnmail
mail-source format-spec gnus-start gnus-spec gnus-int gnus-range
message idna byte-opt sendmail ecomplete rfc822 mml mml-sec
password-cache mm-decode mm-bodies mm-encode mailcap mail-parse
rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev gmm-utils mailheader
canlock sha1 sha1-el hex-util hashcash gnus-win gnus gnus-ems nnheader
gnus-util netrc time-date mail-utils mm-util mail-prsvr completion
complete cus-edit cus-start cus-load wid-edit longlines
mode-compile-kill mode-compile cl cl-19 bytecomp byte-compile compile
comint ring pp help-mode easymenu view multi-isearch vc-git whitespace
regexp-opt desktop filladapt scroll-in-place cua-base time
minibuf-eldef paren mic-paren uniquify advice help-fns advice-preload
disp-table tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win
x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode
register page menu-bar rfn-eshadow timer select scroll-bar mldrag
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
loaddefs button minibuffer faces cus-face files text-properties
overlay md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
system-font-setting font-render-setting gtk x-toolkit x multi-tty
emacs)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!