[Top][All Lists]

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

Re: Patch: Syntax and Hard Newlines

From: David Reitter
Subject: Re: Patch: Syntax and Hard Newlines
Date: Fri, 8 Dec 2006 09:03:09 +0000

On 6 Dec 2006, at 14:24, Richard Stallman wrote:

What behavior did you implement for the <down> and <up> keys?
What behavior did you implement for the C-n and C-p keys?

<down> -> visual-line-down
<up> -> visual-line-up
<C-n> -> (default - normally next-line)
<C-p> -> (default - normally previous-line)

`kill-visual-line' and `kill-whole-visual-line', `beginning/end- of-
    visual-line' are provided as well and do the obvious.

It isn't obvious to me.  I could try to guess, but I should not,
because guessing is unreliable.  What do these commands do?

except that they will only affect the current screen line as shown on screen.

`end-of-visual-line' moves the point to the end of the current screen line, that is, to the right hand side boundary. `beginning-of-visual-line' moves to the beginning of the current screen line, that is, to the left hand side boundary.

kill-visual-line and kill-whole-visual-line work just like their kill- line and kill-whole-line pendants, except that they will only kill the text to `end-of-visual-line', and in the case of kill-whole- visual-line, text beginning from `beginning-of-visual-line'.

visual-line-up is an interactive Lisp function in `osxkeys.el'.
(visual-line-up num-lines)

Move cursor vertically up num-lines lines.
Interactively, vscroll tall lines if `auto-window-vscroll' is
enabled.  If there is no character in the target line exactly
over the current horizontal pixel position, the cursor is
positioned close to the character in that line at the same position,
or at the end of the line if it is not long enough.

The command C-x C-n can be used to create
a semipermanent goal column for this command.
Then instead of trying to move exactly vertically (or as close as possible), this command moves to the specified goal column (or as close as possible).
The goal column is stored in the variable `goal-column', which is nil
when there is no goal column.

This function differs from `previous-line' as it moves vertically
in the visual sense: the cursor will be positioned as horizontally close as possible, and one visual line up. The result differs when variable- width font is
used or when characters of non-standard width (e.g. TABs) are used, and
when lines are wrapped.

If you are thinking of using this in a Lisp program, consider using
`forward-line' with a negative argument instead.  It is usually easier
to use and more reliable (no dependence on goal column, etc.).

visual-line-down is analogous.

reply via email to

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