[OS X Emacs] Re: Aquamacs Cursor movement and word wrapping: C-e, C-a, C-n, C-p

Howard Melman hmelman at verizon.net
Thu Apr 29 19:02:35 EDT 2010


Tom Van Vleck <thvv <at> multicians.org> writes:

> 
> 
> On Apr 23, 2010, at 1:49 PM, Howard Melman wrote:
> > Please make it work based on visual line. This is what emacs has done
> > for decades (long before there was soft wrapping).
> >
> > backwards-paragraph can move to the beginning of a paragraph
> > nothing else would move to the beginning of a visual line.
> 
> Howard, I think you are partly mistaken.
> 
> What Emacs has done for decades is to work on the buffer line,
> as defined by newlines, regardless of how the text on a long line
> is wrapped.  If you wish I will get Bernie Greenberg to
> send a note to that effect.
> 
> I did some experiments.
> 
> 1. I have a Fedora 12 Linux machine with Emacs 23.1.1  I do C-f goo to  
> create
> a new window in fundamental mode.  Then I type a bunch of text
> and C-a C-k C-k C-k .. to make more text than will fit across the  
> window,
> so the text wraps.  (Mode is "Fundamental.")
> 
> If I now do a C-a, the cursor flies back to before the very first
> character.  Hah, says I, just what I wanted.  Then I do a C-n.
> Ack! it goes down one visual line.  C-p goes up one visual line.
> C-e goes to the end of the whole text.  This is a mixture of
> the behaviors, which will probably confuse everybody.
> 
> Is this in some mode that doesn't show in the modeline?
> Customize Emacs says that the option "line-move-visual" is ON.
> Turning it OFF restores traditional operation.  The help for
> C-n says it is bound to (next-line) and explains the dependence
> on 'line-move-visual'.
> 
> Changing the default in Emacs 23 seems like a mistake to me.
> I also think line-move-visual should be shown in the modeline.
> 
> 2. Emacs 22 on a Ubuntu works on buffer semantics, that is
> in the experiment above C-n goes to the next line as delimited
> by newlines, not the next visual line.
> 
> 3. So does the Emacs 22.1 in Leopard and the Emacs 22.3 in FreeBSD 7.2.
> 
> On Apr 23, 2010, at 3:16 PM, David Reitter wrote:
> 
> > MA, Tom, Art, do you guys use the visual-line-mode with soft word  
> > wrapping much?
> 
> I never voluntarily use visual line mode or soft word wrap.
> None of the first 5 options in my Aquamacs options menu are set.
> 
> > I also want to note that it would be relatively easy to condition  
> > the behavior on whether we're recording or executing a keyboard  
> > macro.  That may or may not be a good thing.
> 
> This sounds like a hack to partially undo the bad effects of a  
> previous hack.
> I would worry that we would need an anti-anti hack for some other  
> situation
> we haven't thought of yet.

I had replied but it didn't go through and I was away for a few
days. I've read the other followups. 

I have not used Emacs 23, so I'm unfamiliar with what it's doing, and
generally don't care about default settings as I can change them.
When I tried to describe what emacs had done for decades I was
thinking back to 18.54. I've been using Aquamacs for a few years but
have not used 2.0.  

The point I was trying to make was that way back when (say Emacs 18)
there was just hard-wrapping so yes movement was by buffer-line but
this was the same as visual line. C-a moved you to the start of the
current line not the start of the paragraph (even with contiguous
previous lines of text) because the paragraph contained hard line
endings. Now there's soft wraping and while paragraphs look the same
(contiguous lines of text), the paragraph (with soft wrapping) doesn't
contain hard line endings and C-a moves you to the start of the
paragraph. This is what has bothered me.  I viewed it as I was using
more modern wrapping, and text looked the same, but C-a (and friends)
behaved differently (and to be clear I understand the reasons). 

I did try just turning off soft wrapping but then cut and paste to
other apps is problematic. I "think" I want to use soft wrapping but
have C-a move to the start of a line and not the paragraph. I also
think I'd be fine with a solution that used hard wrapping but when
using mac text copy (cmd-c), converted the text in the pasteboard (I
think that's the right mac term) to soft wrapping so other apps
receive what they are expecting. I have no idea if such a thing
exists. I have written an unwrap-line function and use it explicitly
on occasion, but it's awkward.

There is another case I had forgotten which reading the thread of the
thread reminded me of. With all wrapping turned off, lines longer than
the window width can be displayed truncated or not (that is with a \
at the line end and the text continuing on the next line). I'm not
sure what visual-line-mode would do, but I would expect C-a to move to
the beginning of the buffer line in this case and not the "visual
line". If this discussion was referring only to this case and I had
misunderstood, I apologize.






More information about the MacOSX-Emacs mailing list