all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kai Grossjohann <kai@emptydomain.de>
Subject: Re: a simple convenience function
Date: Mon, 15 Nov 2004 10:29:32 +0100	[thread overview]
Message-ID: <86pt2fo3yb.fsf@ketchup.de.uu.net> (raw)
In-Reply-To: 200411142336.00131.pogonyshev@gmx.net

Paul Pogonyshev <pogonyshev@gmx.net> 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"
constraints?

Kai

  parent reply	other threads:[~2004-11-15  9:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-14 21:36 a simple convenience function Paul Pogonyshev
2004-11-14 23:34 ` Miles Bader
2004-11-15  0:22   ` Lennart Borgman
2004-11-15  1:49     ` Paul Pogonyshev
2004-11-15  5:01       ` Dhruva Krishnamurthy
2004-11-15  7:28       ` Lennart Borgman
2004-11-15  1:50   ` Paul Pogonyshev
2004-11-15  6:45 ` Thien-Thi Nguyen
2004-11-15  9:29 ` Kai Grossjohann [this message]
2004-11-15 23:14   ` Alex Schroeder
2004-11-15 23:27     ` Lennart Borgman
2004-11-16 17:11     ` Kai Grossjohann
2004-11-16 17:14     ` Kai Grossjohann
2004-11-16 17:20     ` Kai Grossjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86pt2fo3yb.fsf@ketchup.de.uu.net \
    --to=kai@emptydomain.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.