Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs navigation in new versions acts like Notepad

This is a bit difficult to explain, so please bear with me.

I am running emacs 23.0.60.2 (from CVS) in order to have truetype support. (in case anyone wonders why I'm running the bleeding edge). I'm experiencing some oddness in navigation within documents with this version that I want to have STOP.

When a window is narrow enough that a long line wraps, it used to be that navigating down one line in the text would move the cursor to the next literal line in the file at the same offset into the line. Now, however, the cursor is moved to the next logical line in the window -- which is the continuation of the current line -- at the same relative offset from the window edge. Basically, before it was emacs-like and now it's notepad-like. I don't want notepad-like behaviour.

Does anyone know how to turn this off? Bonus points if you know how to turn it off in .emacs in such a way as to have my .emacs continue to work with emacs 21-22 as well :)

Thanks!

like image 221
Chris R Avatar asked Feb 05 '09 13:02

Chris R


2 Answers

Try to put (setq line-move-visual nil) in the .emacs file.

like image 151
paradoja Avatar answered Nov 03 '22 08:11

paradoja


I can't answer the main question, but the bonus question is easy:

(if (>= emacs-major-version 23) 
    ... )

Unfortunately, if you want to be more specific than that (e.g., you want exactly version 23.0.60.2) you'll have to parse emacs-version, which might look something like

"GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.14.3) of 2008-10-13 on rothera, modified by Debian"

Also, if you're running a Debian-based distro, look at the emacs-snapshot-gtk package—the edge might bleed a little less.

like image 44
Chris Conway Avatar answered Nov 03 '22 09:11

Chris Conway