This one is for those that want to prevent Emacs from getting pwned by advanced modern applications like… Notepad. Heh.

“MS-DOG” users that have been “brain damaged” by Windows generally think of text editors as… well… a text editor. They like Notepad because it’s fast, easy, and it doesn’t do anything to your files behind the scenes like just about every other frickin’ Windows program.

Now, for just the general “I’m not going to do any serious editing, I just want to rt-click -> Open this text file and scroll around on it to see what’s going on” type of thing, Notepad has this truly tremendous feature called “Word Wrap.” If it’s on, you get soft word wraps added to your text to make it more readable. As is standard in the Notepad way, this does not do anything to your file, it’s just a feature to make it look good on the screen whether you resize it or not. If you turn word-wrap off then you don’t get any wrapping at all– this is good for looking at files that have fixed length columns.

Emacs defaults to a form of wrapping that puts in “soft line breaks” where ever a line goes off the screen. These are marked on either side with little squiggle arrows. This approach has its merits in that you can see all of your file on screen at one time in a mostly sort-of kind-of the way it is sort-of way. To turn this off, type M-x toggle-truncate-lines. Now you will have a text editor that’s almost as good as notepad with “Word Wrap” turned off! 😉 This should make the wrapping lines extend off the right side of the screen. Note that this command makes using the SQL mode much nicer… though sql-ms/isql still screws up your column headings with the timer text: “1> 2> 3> 4>”.

One core NotePad feature has only recently become available to Emacs users via Emacs 22. M-x longlines turns the feature on, after which M-x longlines-mode toggles it on and off. Longlines mode gives you the easy reading soft word wrapping of NotePad with “Word Wrap” turned on.

Note that, splitting the screen horizontally vertically with C-x 3 seems to give you “Word Wrap Off” huge lines scrolling off the screen whether you want it or not. And no horizontal scroll bar for you, either! The only way to see the text that is off-screen in this case appears to be to scroll by hitting C-x > and/or C-x <. Alternately you can resize the windows a bit by hitting C-x } and/or C-x {. (For that last one you may want to use the repeat command of C-x z and then as many z‘s as you want after that. But don’t blame me if you accidentally shut down Emacs when you try But don’t blame me if you accidentally shut down Emacs when you try this!) If you really have to use the mouse, then you can click on the arrows on either side of the frame/window/whatever.

Share this: Twitter

Facebook

Like this: Like Loading... Related