unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7747: Please put current file name in the prompt for rename-file
@ 2010-12-28  0:41 Lennart Borgman
  2010-12-28  1:00 ` Drew Adams
  2010-12-28  1:47 ` Juri Linkov
  0 siblings, 2 replies; 13+ messages in thread
From: Lennart Borgman @ 2010-12-28  0:41 UTC (permalink / raw)
  To: 7747

The prompt for `rename-file' does not currently show the old file name
thought it is in the history for the prompt.

This is probably confusing for new users of the command. Wouldn't it
be better if the prompt should the current file name at init? (This
would be rather similar to what for example Windows Explorer does when
are renaming a file. And I guess this is common to must GUI:s.)

GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2010-12-15 on LENNART-69DE564





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#7747: Please put current file name in the prompt for rename-file
  2010-12-28  0:41 bug#7747: Please put current file name in the prompt for rename-file Lennart Borgman
@ 2010-12-28  1:00 ` Drew Adams
  2010-12-28  1:14   ` Lennart Borgman
  2010-12-28  1:47 ` Juri Linkov
  1 sibling, 1 reply; 13+ messages in thread
From: Drew Adams @ 2010-12-28  1:00 UTC (permalink / raw)
  To: 'Lennart Borgman', 7747

> The prompt for `rename-file' does not currently show the old file name

What old file name?  Which file is the "old file"?

> Wouldn't it be better if the prompt should the current file name at init?

What "current file"?

You can use `rename-file' from anywhere in Emacs.  Yes, if you use it from a
file buffer or from Dired then a reasonable default value is provided.  But
that's all it is: a default value.

We should treat this default value the same way we treat default values
generally (i.e., most default values).






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#7747: Please put current file name in the prompt for rename-file
  2010-12-28  1:00 ` Drew Adams
@ 2010-12-28  1:14   ` Lennart Borgman
  2010-12-28  2:24     ` Stefan Monnier
  0 siblings, 1 reply; 13+ messages in thread
From: Lennart Borgman @ 2010-12-28  1:14 UTC (permalink / raw)
  To: Drew Adams; +Cc: 7747

On Tue, Dec 28, 2010 at 2:00 AM, Drew Adams <drew.adams@oracle.com> wrote:
>> The prompt for `rename-file' does not currently show the old file name
>
> What old file name?  Which file is the "old file"?
>
>> Wouldn't it be better if the prompt should the current file name at init?
>
> What "current file"?
>
> You can use `rename-file' from anywhere in Emacs.  Yes, if you use it from a
> file buffer or from Dired then a reasonable default value is provided.  But
> that's all it is: a default value.


I did not think of that, but I am sure you understood me.


> We should treat this default value the same way we treat default values
> generally (i.e., most default values).


Yes. And the only reasonable way to do that is to put them after the prompt.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#7747: Please put current file name in the prompt for rename-file
  2010-12-28  0:41 bug#7747: Please put current file name in the prompt for rename-file Lennart Borgman
  2010-12-28  1:00 ` Drew Adams
@ 2010-12-28  1:47 ` Juri Linkov
  2010-12-28  2:15   ` Lennart Borgman
  1 sibling, 1 reply; 13+ messages in thread
From: Juri Linkov @ 2010-12-28  1:47 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 7747

> The prompt for `rename-file' does not currently show the old file name
> thought it is in the history for the prompt.

Please try `M-x rename-file RET M-n'.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#7747: Please put current file name in the prompt for rename-file
  2010-12-28  1:47 ` Juri Linkov
@ 2010-12-28  2:15   ` Lennart Borgman
  2022-02-10  8:33     ` bug#7747: Allow choice of "default in M-n" vs "default in `initial'" Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Lennart Borgman @ 2010-12-28  2:15 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 7747

On Tue, Dec 28, 2010 at 2:47 AM, Juri Linkov <juri@jurta.org> wrote:
>> The prompt for `rename-file' does not currently show the old file name
>> thought it is in the history for the prompt.
>
> Please try `M-x rename-file RET M-n'.

Yes, I know about that. What I mean is that this is very
counterintuitive for new users. They are used to have the name they
are renaming in the prompt (since that is what GUI software normally
do).

And I wonder whether the current behavior really helps old users most
of the time. I think most of the time I rename a file I just change
part of the file name.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#7747: Please put current file name in the prompt for rename-file
  2010-12-28  1:14   ` Lennart Borgman
@ 2010-12-28  2:24     ` Stefan Monnier
  2011-01-01 19:16       ` Lennart Borgman
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2010-12-28  2:24 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 7747

>> You can use `rename-file' from anywhere in Emacs.  Yes, if you use it from a
>> file buffer or from Dired then a reasonable default value is provided.  But
>> that's all it is: a default value.
> I did not think of that, but I am sure you understood me.

Maybe he's lucky enough, but I must say I'm still lost.  Can someone
turn this into an actual bug-report, please?


        Stefan





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#7747: Please put current file name in the prompt for rename-file
  2010-12-28  2:24     ` Stefan Monnier
@ 2011-01-01 19:16       ` Lennart Borgman
  2011-01-02  2:28         ` Lennart Borgman
  2011-01-02 14:57         ` Juri Linkov
  0 siblings, 2 replies; 13+ messages in thread
From: Lennart Borgman @ 2011-01-01 19:16 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7747

On Tue, Dec 28, 2010 at 3:24 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>>> You can use `rename-file' from anywhere in Emacs.  Yes, if you use it from a
>>> file buffer or from Dired then a reasonable default value is provided.  But
>>> that's all it is: a default value.
>> I did not think of that, but I am sure you understood me.
>
> Maybe he's lucky enough, but I must say I'm still lost.  Can someone
> turn this into an actual bug-report, please?

Sorry, I should have been thinking of that you all use Emacs for
almost everything so this idea might be unfamiliar to you ;-)

It is just a simple but useful thing I want - too eat the cake and
have the cake. Though I was not aware of that first.

It is very useful that the current filename is in the prompt history
when renaming a file. However one more thing can be done now:

- Put the old file name in the prompt + made it selected (if visual
regions are on).

This is what at least the w32 GUI does. If you then want to overwrite
that filename you just start typing the new file name. If you want to
edit the file name instead you move the point first. This aborts the
selection and you can now edit as usual.

The advantage is more clarity and less key strokes.

This would work very well in Emacs too - at least when cua-mode is on.
(And in the case it is not on I think we should reconsider how
self-insert is handled.)


I realize now that this bug is quite a bit more general than for
rename-file. Sorry for that.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#7747: Please put current file name in the prompt for rename-file
  2011-01-01 19:16       ` Lennart Borgman
@ 2011-01-02  2:28         ` Lennart Borgman
  2011-01-02  2:53           ` Stefan Monnier
  2011-01-02 14:57         ` Juri Linkov
  1 sibling, 1 reply; 13+ messages in thread
From: Lennart Borgman @ 2011-01-02  2:28 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7747

Stefan wrote:

> IIUC you just want minibuffer input's default value to be inserted in
> the minibuffer (and selected so that `delete' or `backspace' gets you rid
> of it) rather than starting with an empty minibuffer and letting the
> user bring in the default with M-n if she wants it.
>
> The way I see such a thing happening is by changing calls to
> completing-read (and derivatives) to use a new function which can behave
> either way (e.g. it takes a `prompt' and a `default' arg but no
> `initial' arg, and the `prompt' doesn't include the default in it,
> instead the function will take care to add it to the prompt if/when
> needed).

Yes, sorry for the confusion. This is what I meant.

I think this is a much better UI than the current implementation to
handle default values.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#7747: Please put current file name in the prompt for rename-file
  2011-01-02  2:28         ` Lennart Borgman
@ 2011-01-02  2:53           ` Stefan Monnier
  2011-01-02  3:15             ` Lennart Borgman
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2011-01-02  2:53 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 7747

retitle 7747 Allow choice of "default in M-n" vs "default in `initial'"
severity 7747 wishlist
thanks

> I think this is a much better UI than the current implementation to
> handle default values.

Clearly, that's the one you're used to from the rest of your w32 world.
Whether it's better or not also depends on whether you use and like
delete-selection-mode.
In any case, I don't think the default will change any time soon in this
respect, but I do hope that we will change the code so that end users
can choose between the two behaviors.


        Stefan





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#7747: Please put current file name in the prompt for rename-file
  2011-01-02  2:53           ` Stefan Monnier
@ 2011-01-02  3:15             ` Lennart Borgman
  0 siblings, 0 replies; 13+ messages in thread
From: Lennart Borgman @ 2011-01-02  3:15 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7747

On Sun, Jan 2, 2011 at 3:53 AM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> retitle 7747 Allow choice of "default in M-n" vs "default in `initial'"
> severity 7747 wishlist
> thanks
>
>> I think this is a much better UI than the current implementation to
>> handle default values.
>
> Clearly, that's the one you're used to from the rest of your w32 world.
> Whether it's better or not also depends on whether you use and like
> delete-selection-mode.

Yes, you have to like delete-selection-mode to use this. (But it also
makes it clear why delete-selection-mode is very useful.)


> In any case, I don't think the default will change any time soon in this
> respect, but I do hope that we will change the code so that end users
> can choose between the two behaviors.

Agree. Fine.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#7747: Please put current file name in the prompt for rename-file
  2011-01-01 19:16       ` Lennart Borgman
  2011-01-02  2:28         ` Lennart Borgman
@ 2011-01-02 14:57         ` Juri Linkov
  1 sibling, 0 replies; 13+ messages in thread
From: Juri Linkov @ 2011-01-02 14:57 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 7747

> This is what at least the w32 GUI does.

This has nothing to do with w32!  I don't use w32, but still welcome these
changes because most of GUI improvements happen in web browsers nowadays,
and I think that some of them are quite good to adapt to Emacs.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#7747: Allow choice of "default in M-n" vs "default in `initial'"
  2010-12-28  2:15   ` Lennart Borgman
@ 2022-02-10  8:33     ` Lars Ingebrigtsen
  2022-02-12  3:57       ` Richard Stallman
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-02-10  8:33 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 7747

Lennart Borgman <lennart.borgman@gmail.com> writes:

>>> The prompt for `rename-file' does not currently show the old file name
>>> thought it is in the history for the prompt.
>>
>> Please try `M-x rename-file RET M-n'.
>
> Yes, I know about that. What I mean is that this is very
> counterintuitive for new users. They are used to have the name they
> are renaming in the prompt (since that is what GUI software normally
> do).

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Many prompts in Emacs have moved (or are moving) to the "don't use an
initial", but instead puts the thing into `M-n'.  There are advantages
and disadvantages to this (the main advantage is that you can just start
typing without saying `C-a C-k' first if you don't want the default),
but it's a conscious design decision which won't be reverted, so I'm
closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#7747: Allow choice of "default in M-n" vs "default in `initial'"
  2022-02-10  8:33     ` bug#7747: Allow choice of "default in M-n" vs "default in `initial'" Lars Ingebrigtsen
@ 2022-02-12  3:57       ` Richard Stallman
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Stallman @ 2022-02-12  3:57 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: lennart.borgman, 7747

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Many prompts in Emacs have moved (or are moving) to the "don't use an
  > initial", but instead puts the thing into `M-n'.

Could someone identify for me one example of this change
which is not inside a large or complex package that is difficult to try out?

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)







^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-02-12  3:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-28  0:41 bug#7747: Please put current file name in the prompt for rename-file Lennart Borgman
2010-12-28  1:00 ` Drew Adams
2010-12-28  1:14   ` Lennart Borgman
2010-12-28  2:24     ` Stefan Monnier
2011-01-01 19:16       ` Lennart Borgman
2011-01-02  2:28         ` Lennart Borgman
2011-01-02  2:53           ` Stefan Monnier
2011-01-02  3:15             ` Lennart Borgman
2011-01-02 14:57         ` Juri Linkov
2010-12-28  1:47 ` Juri Linkov
2010-12-28  2:15   ` Lennart Borgman
2022-02-10  8:33     ` bug#7747: Allow choice of "default in M-n" vs "default in `initial'" Lars Ingebrigtsen
2022-02-12  3:57       ` Richard Stallman

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).