help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Word wrap and horizontal scrolling


From: Le Wang
Subject: Re: Word wrap and horizontal scrolling
Date: Mon, 14 Mar 2011 13:58:09 +0800

On Sun, Mar 13, 2011 at 11:53 PM, Alexander Stepanov <address@hidden> wrote:
I am still trying to make emacs work as usual Windows text editor such
as Notepad++ and MS Visual Studio. I can turn off word wrap in Notepad+
+ and it will show horizontal scrollbar. To do such in emacs i must
input M-x toggle-truncate-lines and scroll to the left and to the
right using C-PgDn and C-PgUp. But this method scrolls code with too
big offset. For example my current task at work is to make some
changes in such code:
if(...){
       if(...){
               if(...){
                       ...
               }
               else{
                       if(...){
                               if(...){
                                       if(...){
                                               else{
                                                       if(...){
                                                       }
                                                       else{
I can edit this code in Notepad++. But Emacs wrap lines. When i turn
of line wrapping C-PgDn moves me to the last if and C-PgUp moves me to
the first if. If I want to edit center part of code I move using left
and write arrows at the keyboard. This Emacs behaviour is shameful. Is
there some way to emulate horizontal scrollbar?

I agree that the lack of horizontal scroll-bar is _ridiculous_, perhaps even shameful :).  When I switched from XEmacs to GNU Emacs, this worried me.  However, having used GNU Emacs for a few years now, I just don't find myself missing it.

I stay away from scroll-left and scroll-right as they confuse the hell out of me -- how is the cursor being off the screen helpful to anyone?  Which is why it's disabled by default, I presume.

Just move the point(cursor) across the long line and let auto-horizontal-scroll take care of the scrolling.  It's not a big deal.  Maybe you're hesitant because you want to leave the point at an interesting location?  You can save the location of the point in Emacs by pressing C-SPC.  When want to go back just press C-u C-SPC.

If you don't want to "plan ahead" by saving interesting points to the mark-ring, I strongly suggest you take a look at the C-xC-/ feature of "session.el" that I discussed in the "_under publicized_ features thread.

--
Le

reply via email to

[Prev in Thread] Current Thread [Next in Thread]