all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Richard Riley'" <rileyrgdev@gmail.com>, <help-gnu-emacs@gnu.org>
Subject: RE: Selecting default prompt text
Date: Thu, 12 Feb 2009 09:34:11 -0800	[thread overview]
Message-ID: <00fb01c98d38$1f604e60$c2b22382@us.oracle.com> (raw)
In-Reply-To: <gn18jd$lq3$1@rileyrgdev.motzarella.org>

> > Something like this ?
> >
> > (defun minibuffer-select-inital-input ()
> >   (let ((start (next-single-char-property-change 1 'read-only)))
> >     (when (< start (point-max))
> >       (set-mark start) (setq mark-active t))))
> >
> > (add-hook 'minibuffer-setup-hook 'minibuffer-select-inital-input)
> > (read-string "> " "Hallo")
> >
> > -ap
> 
> Yes, thanks. But I released I was hoping for too much here since
> region/mark etc works so many different ways depending on settings. As
> "dim" in the #emacs said, probably best to rely on C-a C-k. 
> e.g With my setting hitting right arrow there results in
> "end of buffer" error.

1. I was going to suggest something like what ap said.

That seems to respond to your request, so I'm not sure what you meant above - in
particular about using the right arrow. If point is at the end of the input (end
of buffer), then why would you hit the right arrow? What would you like the
right arrow to do in that context?


2. [You won't like this related answer, but it might help someone else. ;-)]

In Icicles you can elect to always insert the default value as initial text. And
if you do that, you can also elect to automatically select it (as the active
region). And you can choose where to leave the cursor: before or after the
default text (whether or not you choose to auto-select it).

This means that if you use, say, Delete Selection mode, and you choose to
auto-select the default input, then you can just type other text to replace it,
or hit `C-d' or Backspace (DEL) to delete it.

And even if you choose not to auto-select the default text, you can use `M-k'
anytime to clear the minibuffer (easier than `C-a C-k').

http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-d
efault-value






  reply	other threads:[~2009-02-12 17:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-11 23:29 Selecting default prompt text Richard Riley
2009-02-12  2:53 ` Kevin Rodgers
     [not found] ` <mailman.497.1234407233.31690.help-gnu-emacs@gnu.org>
2009-02-12  9:54   ` Richard Riley
2009-02-12 12:27     ` Andreas Politz
2009-02-12 13:35       ` Richard Riley
2009-02-12 17:34         ` Drew Adams [this message]
2009-02-12 17:48           ` Richard Riley
     [not found]           ` <mailman.573.1234460908.31690.help-gnu-emacs@gnu.org>
2009-02-12 19:02             ` Richard Riley

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='00fb01c98d38$1f604e60$c2b22382@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=rileyrgdev@gmail.com \
    /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.