campugnatus
campugnatus

Reputation: 125

hl-line-mode + scroll-step + highlight-parentheses -> emacs goes crazy

Yesterday I was customizing my emacs. Today I've been working in emacs when suddenly stumbled upon an interesting effect. After some investigation I figured out the minimal initialization that leads to this effect. Still effect does not seem stable. I hope you will be able to reproduce it.

First, evaluate the following elisp code:

(add-to-list 'load-path "~/.emacs.d/")
(require 'highlight-parentheses)
(global-hl-line-mode 1)
(setq scroll-step 1)

In order to be sure no other extension gets on the way, I use the file with this code as init file.

You will also need the highlight-parentheses module, of course.

Then you will need a file where the effect could be revealed. Unfortunately, I wasn't able to figure out the exact conditions that reveal the effect. Try the README.md file of the Visible bookmarks extension. I'm sorry for asking do download some specific files to observe the effect, but I don't know the other way.

If you're still not scared away then open the README.md file and turn on the highlight-parentheses mode:

M-x highlight-parentheses-mode RET

Then press and hold the down-arrow key. The pointer will start moving down line-by-line. But when it leaves the line 45 (which is at the bottom of the screen at the moment) it suddenly jumps back to the middle of the screen (line 24). W-what!?

And it happens every time you approach line 46 when it is right below the bottom edge of the screen. Moreover, it seems to effect other extensions too (e.g. visual bookmarks start to make strange things like messing up the bookmarks order).

I'm new to elisp so I hardly can find a bug in the source of these three modes. If this is a bug at all.

If it matters, I use emacs 23.2.1 under Debian squeeze. Sorry for my english and thanks for your attention.

Upvotes: 1

Views: 305

Answers (1)

Stefan
Stefan

Reputation: 28541

This is supposed to be fixed in Emacs-24, IIUC. BTW, please remove your (add-to-list 'load-path "~/.emacs.d/") because the .emacs.d directory includes files whose name would clash. I.e. if you want to put Elisp packages somewhere in ~/.emacs.d, put them in a subdirectory of it.

Upvotes: 2

Related Questions