[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: delete-file default to buffer-file-name if non-nil
From: |
Drew Adams |
Subject: |
RE: delete-file default to buffer-file-name if non-nil |
Date: |
Sun, 16 May 2010 17:28:31 -0700 |
> > 1. Insert the default value in the minibuffer. This assumes that the
> > greatest danger is hitting RET without seeing what the file to be
> > deleted is.
>
> The argument INITIAL-CONTENTS is obsolete and should not be used.
> It's possible to insert the default value to the minibuffer
> with `M-n'.
So it is. But I happen to disagree that it should be obsolete. ;-)
A better approach is to let the user decide the behavior.
I have this option (FWIW):
,----
| icicle-default-value is a variable defined in `icicles-opt.el'.
| Its value is t
|
| Documentation:
| How to treat the default value when reading minibuffer input.
|
| When the default value argument to functions such as
| `completing-read', `read-file-name', `read-from-minibuffer', and
| `read-string' is non-nil and the initial-input argument is nil or
| "", the default value can be added to the prompt as a hint or
| inserted into the minibuffer as the initial input.
|
| Adding it to the prompt is the default behavior and corresponds to the
| behavior of vanilla Emacs.
|
| Inserting the default value in the minibuffer as the initial input has
| the advantage of not requiring you to use `M-n' to retrieve it. It
| has the disadvantage of making you use `M-p' (or do something else) to
| get rid of the default value in the minibuffer if you do not want to
| use or edit it. If you often want to use or edit the default value,
| then set `icicle-default-value' to non-nil and non-t. If you rarely
| do so, then set it to nil or t.
|
| If inserted in the minibuffer, the value of this option also
| determines whether or not the inserted text is preselected and where
| the cursor is left: at the beginning or end of the text.
|
| These are the possible option values:
|
| nil - Do not insert default value or add it to prompt.
| t - Add default value to prompt. Do not insert it.
| `insert-start' - Insert default value and leave cursor at start.
| `insert-end' - Insert default value and leave cursor at end.
| `preselect-start' - Insert and preselect default value;
| leave cursor at beginning.
| `preselect-end' - Insert and preselect default value;
| leave cursor at end.
|
| My own preference is `insert-end'.
|
| Preselection can be useful in Delete Selection mode or PC Selection
| mode. It makes it easy to replace the value by typing characters, or
| delete it by hitting `C-d' or `DEL' (backspace). However, all of the
| initial input is lost if you type or hit `C-d' or `DEL'. That is
| inconvenient if you want to keep most of it and edit it only slightly.
|
| You can customize this variable.
`----
- delete-file default to buffer-file-name if non-nil, Deniz Dogan, 2010/05/15
- Re: delete-file default to buffer-file-name if non-nil, Davis Herring, 2010/05/15
- Re: delete-file default to buffer-file-name if non-nil, Deniz Dogan, 2010/05/15
- Re: delete-file default to buffer-file-name if non-nil, Richard Stallman, 2010/05/16
- RE: delete-file default to buffer-file-name if non-nil, Drew Adams, 2010/05/16
- Re: delete-file default to buffer-file-name if non-nil, Juri Linkov, 2010/05/16
- RE: delete-file default to buffer-file-name if non-nil,
Drew Adams <=
- Re: delete-file default to buffer-file-name if non-nil, Stefan Monnier, 2010/05/17
- RE: delete-file default to buffer-file-name if non-nil, Drew Adams, 2010/05/17
- Re: delete-file default to buffer-file-name if non-nil, Deniz Dogan, 2010/05/17
- Re: delete-file default to buffer-file-name if non-nil, Juri Linkov, 2010/05/17
- Re: delete-file default to buffer-file-name if non-nil, Juri Linkov, 2010/05/18
- Re: delete-file default to buffer-file-name if non-nil, Richard Stallman, 2010/05/17