From: "Drew Adams" <drew.adams@oracle.com>
To: "'Miles Bader'" <miles@gnu.org>
Cc: emacs-devel@gnu.org
Subject: RE: by default, point should not enter the minibuffer prompt
Date: Wed, 8 Oct 2008 09:52:33 -0700 [thread overview]
Message-ID: <001301c92966$43d33d10$c2b22382@us.oracle.com> (raw)
In-Reply-To: <87abdf3vi6.fsf@catnip.gol.com>
> > I'll change my minibuffer C-a command to DTRT. Thx.
>
> If you just use the default C-a binding (move-beginning-of-line), it
> should work correctly.
Not a possibility. If I wanted the default C-a I never would have written a
different command. ;-)
The command I want moves to bol (modulo the prompt) the first time, but to bol
of the previous line if repeated. And it respects the N prefix arg (like
`beginning-of-line').
It's not important, but here is the command, so you get the idea:
;; Bound to `C-a' in minibuffer and in *Completions*.
(defun icicle-beginning-of-line+ (&optional n)
"Move cursor to beginning of current line or next line if repeated.
This is the similar to `beginning-of-line', but:
1. With arg N, the direction is the opposite: this command moves
backward, not forward, N lines.
2. If called interactively with no prefix arg:
If the previous command was also `beginning-of-line+', then move
to the beginning of the previous line. Else, move to the
beginning of the current line.
Otherwise, move to the beginning of the Nth previous line (Nth next
line if N<0). Command `beginning-of-line', by contrast, moves to
the beginning of the (N-1)th next line."
(interactive
(list (if current-prefix-arg
(prefix-numeric-value current-prefix-arg)
0)))
(unless n (setq n 0)) ; non-interactive with no arg
(let ((minibuffer-prompt-properties ; Unfortunately, has no effect
(append '(point-entered minibuffer-avoid-prompt)
minibuffer-prompt-properties)))
(if (and (eq this-command last-command)
(not current-prefix-arg))
(forward-line -1)
(forward-line (- n)))))
C-e in the minibuffer and *Completions* works similarly but it moves down when
repeated, not up.
next prev parent reply other threads:[~2008-10-08 16:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 0:34 by default, point should not enter the minibuffer prompt Drew Adams
2008-10-08 1:59 ` Stefan Monnier
2008-10-08 2:07 ` Miles Bader
2008-10-08 6:08 ` Drew Adams
2008-10-08 8:08 ` Miles Bader
2008-10-08 15:13 ` Drew Adams
2008-10-08 16:24 ` Miles Bader
2008-10-08 16:52 ` Drew Adams [this message]
2008-10-08 16:34 ` Drew Adams
2008-10-09 0:22 ` Miles Bader
2008-10-09 16:03 ` Drew Adams
2008-10-08 20:22 ` Richard M. Stallman
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001301c92966$43d33d10$c2b22382@us.oracle.com' \
--to=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
--cc=miles@gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).