emacs-devel
[Top][All Lists]
Advanced

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

Re: Start value in minibuffer


From: Lars Hansen
Subject: Re: Start value in minibuffer
Date: Mon, 14 Nov 2005 11:56:21 +0100
User-agent: Debian Thunderbird 1.0.2 (X11/20051002)

Drew Adams wrote:

>Different users will prefer different behaviors. Each approach has something
>to be recommended. And, in the case where each approach is not optimal, it
>still lets you get what you need with at most one keystroke:
>
>1. `M-n' to pull in the default, in straight Emacs - because
>   it's not there to begin with.
>
>2. `C-SPC' to deselect a preselected init value in PC-selection
>   mode or delete-selection mode - because you want to edit it
>   slightly.
>
>3. some keystroke (e.g. M-S-backspace) to erase the minibuffer
>   (in the mode I use: init value without preselection) - when I
>   don't want the value at all.
>
>That is:
>
>#1 makes you go through an extra step to get the default value.
>
>#2 makes you go through an extra step to deactivate the selection.
>
>#3 makes you go through an extra step to get rid of the value.
>
>#1 and #2 are optimal when you don't want to edit the default value (just
>take it or leave it).  #3 is optimal when you do want to edit it.
>  
>
I think you are right and clear! But then the most sensible thing would
be to make it optional. What about something like:

(defcustom minibuffer-insert-default-value nil
  "Insert DEFAULT-VALUE into minibuffer.
If non-nil, `read-from-minibuffer' inserts DEFAULT-VALUE into the
minibuffer if
INITIAL-CONTENTS is nil. If the value is 'select, the minibuffer
contents will
be selected."
  :type '(choice
    (const :tag "Don't insert default value" nil)
    (const :tag "Insert default value" t)
    (const :tag "Insert and select default value" select)))

With this option it is a good decision to use DEFAULT-VALUE rather than
INITIAL-CONTENTS in calls to read-from-minibuffer. Because then the
minibuffer will be empty when minibuffer-insert-default-value is nil.

I suggest to add this in etc/TODO to be looked at after the release.
What do people think?





reply via email to

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