[Top][All Lists]

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

Re: a simple convenience function

From: Kai Grossjohann
Subject: Re: a simple convenience function
Date: Mon, 15 Nov 2004 10:29:32 +0100
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Paul Pogonyshev <address@hidden> writes:

> +(defun beginning-of-line-smart (&optional n)
> +  "Move to the beginning of the text on this line, or to the beginning of 
> the line.
> +More exactly, if the point is already at the beginning of the
> +line's text (as defined by `beginning-of-line-text'), it is
> +placed at the very beginning of the line.  Otherwise it is moved
> +to the text beginning.
> +
> +With optional argument, different from 1, behave identically to
> +`beginning-of-line-text'."

I used to have something similar, except that I changed the <home> key
to move to beginning of line, then beginning of window, then beginning
of buffer.  But the behavior of that function was different: where it
moved depended on how often you hit the <home> key.  When you first
hit it, it moved to beginning of line, if you then immediately press
it again, it moves to beginning of window, and so on.

I found this to be better because I knew I could always hit <home>
twice to end up at the beginning of the window, and I didn't have to
check whether point was already at the beginning of the line.

But for the proposed binding, it's more difficult: one would expect
C-a to move to the left, so its behavior needs to depend on the
position of point, I think.

What do others think about the tradeoff between the "never move right"
and the "make behavior predictable without looking at text"


reply via email to

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