unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* find-alternate-file default filename annoyance
@ 2007-01-21  6:14 Leo
  2007-01-21 22:27 ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: Leo @ 2007-01-21  6:14 UTC (permalink / raw)


Hi there,

  1. Open an existing file
  2. M-x find-alternate-file

You can see 'find-alternate-file' will put `buffer-file-name' as its
filename by default. I think this is a bad default because it
contradicts the name 'find-alternate-file'. I found myself every time
struggling to remove the default filename before I can type the
desired one.

BTW,
Ido-mode doesn't have this annoyance only if ffap is not enabled.

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

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

* Re: find-alternate-file default filename annoyance
  2007-01-21  6:14 find-alternate-file default filename annoyance Leo
@ 2007-01-21 22:27 ` Richard Stallman
  2007-01-22  3:50   ` Leo
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2007-01-21 22:27 UTC (permalink / raw)
  Cc: emacs-devel

    You can see 'find-alternate-file' will put `buffer-file-name' as its
    filename by default.

This is what it has always done.

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

* Re: find-alternate-file default filename annoyance
  2007-01-21 22:27 ` Richard Stallman
@ 2007-01-22  3:50   ` Leo
  2007-01-22 14:49     ` Kim F. Storm
  2007-01-29 16:50     ` ido-dired is not activated in ffap (was: find-alternate-file default filename annoyance) Leo
  0 siblings, 2 replies; 10+ messages in thread
From: Leo @ 2007-01-22  3:50 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 578 bytes --]

On 2007-01-21, Richard Stallman said:
>     You can see 'find-alternate-file' will put `buffer-file-name' as
>     its filename by default.
>
> This is what it has always done.

Indeed the default behavior is not too bad since it places the cursor
at the beginning of the filename and can be easily removed if user
wants to choose another one.

*HOWEVER*, there must be a bug in either ffap or ido which cause Emacs
 to place the cursor at the end of the filename. I have narrowed it
 down to the following recipe:

  1. emacs -q -l faf
  2. Open an existing file
  3. C-x C-v


[-- Attachment #2: faf --]
[-- Type: text/plain, Size: 140 bytes --]

;;-*-mode: emacs-lisp;coding: utf-8;-*-
(setq ffap-require-prefix t)
(ffap-bindings)
;;; ido
(require 'ido)
(ido-mode t)
(ido-everywhere t)

[-- Attachment #3: Type: text/plain, Size: 75 bytes --]

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: find-alternate-file default filename annoyance
  2007-01-22  3:50   ` Leo
@ 2007-01-22 14:49     ` Kim F. Storm
  2007-01-22 23:46       ` Leo
  2007-01-29 16:50     ` ido-dired is not activated in ffap (was: find-alternate-file default filename annoyance) Leo
  1 sibling, 1 reply; 10+ messages in thread
From: Kim F. Storm @ 2007-01-22 14:49 UTC (permalink / raw)
  Cc: emacs-devel

Leo <sdl.web@gmail.com> writes:

> On 2007-01-21, Richard Stallman said:
>>     You can see 'find-alternate-file' will put `buffer-file-name' as
>>     its filename by default.
>>
>> This is what it has always done.
>
> Indeed the default behavior is not too bad since it places the cursor
> at the beginning of the filename and can be easily removed if user
> wants to choose another one.
>
> *HOWEVER*, there must be a bug in either ffap or ido which cause Emacs
>  to place the cursor at the end of the filename. 

Ido _always_ places the cursor at the end of the "current input", which
in this case happens to be the current buffer filename.

So there is no bug.  Just use M-DEL to delete the filename as
usual with ido.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: find-alternate-file default filename annoyance
  2007-01-22 14:49     ` Kim F. Storm
@ 2007-01-22 23:46       ` Leo
  2007-01-24  0:17         ` Kim F. Storm
  0 siblings, 1 reply; 10+ messages in thread
From: Leo @ 2007-01-22 23:46 UTC (permalink / raw)


On 2007-01-22, Kim F. Storm said:

>> *HOWEVER*, there must be a bug in either ffap or ido which cause
>> Emacs to place the cursor at the end of the filename.
>
> Ido _always_ places the cursor at the end of the "current input",
> which in this case happens to be the current buffer filename.

There maybe a good explanation behind the whole cursor placing
things. As I found 99% of the time IDO is more convenient than the
default behaviors, this one really confuses me. Is it because C-k has
been bound to ido-delete-file-at-head, so if the cursor is placed at
the beginning of the filename, users might accidentally delete files?

> So there is no bug.  Just use M-DEL to delete the filename as usual
> with ido.

But We are paying a price. This will increase the keystrokes to more
than 2 as most files have an extension.

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

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

* Re: find-alternate-file default filename annoyance
  2007-01-22 23:46       ` Leo
@ 2007-01-24  0:17         ` Kim F. Storm
  2007-01-24  4:06           ` Leo
  0 siblings, 1 reply; 10+ messages in thread
From: Kim F. Storm @ 2007-01-24  0:17 UTC (permalink / raw)
  Cc: emacs-devel

Leo <sdl.web@gmail.com> writes:

> There maybe a good explanation behind the whole cursor placing
> things. As I found 99% of the time IDO is more convenient than the
> default behaviors, this one really confuses me. Is it because C-k has
> been bound to ido-delete-file-at-head, so if the cursor is placed at
> the beginning of the filename, users might accidentally delete files?

Ok, you have convinced me -- 1% inconvenience is too much :-)

I have modified ido to place the cursor at the start of the input when
a default item is present (which ffap provides).

I've also made C-a, C-e, C-b, and C-k work more intelligently when the
cursor is not at the end of the input -- e.g. C-k delete the rest of
the input, and C-e moves to the end of the input.

C-a normally toggles the "ignore" list processing ... and that is a
very important binding (C-a = show all).  So C-a cannot be used
directly to move to the beginning of input, but I changed it so that
it moves to the beginning of the input if the cursor is _not_ at the
end of the input ... so use C-b C-a to move cursor to the start of
input.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: find-alternate-file default filename annoyance
  2007-01-24  0:17         ` Kim F. Storm
@ 2007-01-24  4:06           ` Leo
  0 siblings, 0 replies; 10+ messages in thread
From: Leo @ 2007-01-24  4:06 UTC (permalink / raw)
  To: emacs-devel

On 2007-01-24, Kim F. Storm said:

> Leo <sdl.web@gmail.com> writes:
>
>> There maybe a good explanation behind the whole cursor placing
>> things. As I found 99% of the time IDO is more convenient than the
>> default behaviors, this one really confuses me. Is it because C-k has
>> been bound to ido-delete-file-at-head, so if the cursor is placed at
>> the beginning of the filename, users might accidentally delete files?
>
> Ok, you have convinced me -- 1% inconvenience is too much :-)
>
> I have modified ido to place the cursor at the start of the input when
> a default item is present (which ffap provides).
>
> I've also made C-a, C-e, C-b, and C-k work more intelligently when the
> cursor is not at the end of the input -- e.g. C-k delete the rest of
> the input, and C-e moves to the end of the input.
>
> C-a normally toggles the "ignore" list processing ... and that is a
> very important binding (C-a = show all).  So C-a cannot be used
> directly to move to the beginning of input, but I changed it so that
> it moves to the beginning of the input if the cursor is _not_ at the
> end of the input ... so use C-b C-a to move cursor to the start of
> input.

Thank you, Kim.

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

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

* ido-dired is not activated in ffap (was: find-alternate-file default filename annoyance)
  2007-01-22  3:50   ` Leo
  2007-01-22 14:49     ` Kim F. Storm
@ 2007-01-29 16:50     ` Leo
  2007-01-30 22:38       ` Kim F. Storm
  1 sibling, 1 reply; 10+ messages in thread
From: Leo @ 2007-01-29 16:50 UTC (permalink / raw)
  To: emacs-devel

On 2007-01-22, Leo said:

> ;;-*-mode: emacs-lisp;coding: utf-8;-*-
> (setq ffap-require-prefix t)
> (ffap-bindings)
> ;;; ido
> (require 'ido)
> (ido-mode t)
> (ido-everywhere t)

With the setting above, C-x d will use dired-at-point and use the
default dired behavior. C-u C-x d will have the ido-dired behavior.

But shouldn't C-x d be using ido-dired if ido is enabled?

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

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

* Re: ido-dired is not activated in ffap (was: find-alternate-file default filename annoyance)
  2007-01-29 16:50     ` ido-dired is not activated in ffap (was: find-alternate-file default filename annoyance) Leo
@ 2007-01-30 22:38       ` Kim F. Storm
  2007-01-30 23:04         ` Leo
  0 siblings, 1 reply; 10+ messages in thread
From: Kim F. Storm @ 2007-01-30 22:38 UTC (permalink / raw)
  To: Leo; +Cc: emacs-devel

Leo <sdl.web@gmail.com> writes:

> On 2007-01-22, Leo said:
>
>> ;;-*-mode: emacs-lisp;coding: utf-8;-*-
>> (setq ffap-require-prefix t)
>> (ffap-bindings)
>> ;;; ido
>> (require 'ido)
>> (ido-mode t)
>> (ido-everywhere t)
>
> With the setting above, C-x d will use dired-at-point and use the
> default dired behavior. C-u C-x d will have the ido-dired behavior.
>
> But shouldn't C-x d be using ido-dired if ido is enabled?

ffap rebinds C-x d to dired-at-point which does its own directory reading.
There is nothing ido can do about that...

One possible remedy is to set dired-at-point-require-prefix to t.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: ido-dired is not activated in ffap (was: find-alternate-file default filename annoyance)
  2007-01-30 22:38       ` Kim F. Storm
@ 2007-01-30 23:04         ` Leo
  0 siblings, 0 replies; 10+ messages in thread
From: Leo @ 2007-01-30 23:04 UTC (permalink / raw)
  To: emacs-devel

On 2007-01-30, Kim F. Storm said:

> Leo <sdl.web@gmail.com> writes:
>
>> On 2007-01-22, Leo said:
>>
>>> ;;-*-mode: emacs-lisp;coding: utf-8;-*-
>>> (setq ffap-require-prefix t)
>>> (ffap-bindings)
>>> ;;; ido
>>> (require 'ido)
>>> (ido-mode t)
>>> (ido-everywhere t)
>>
>> With the setting above, C-x d will use dired-at-point and use the
>> default dired behavior. C-u C-x d will have the ido-dired behavior.
>>
>> But shouldn't C-x d be using ido-dired if ido is enabled?
>
> ffap rebinds C-x d to dired-at-point which does its own directory reading.
> There is nothing ido can do about that...
>
> One possible remedy is to set dired-at-point-require-prefix to t.

Thank you for this.

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

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

end of thread, other threads:[~2007-01-30 23:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-21  6:14 find-alternate-file default filename annoyance Leo
2007-01-21 22:27 ` Richard Stallman
2007-01-22  3:50   ` Leo
2007-01-22 14:49     ` Kim F. Storm
2007-01-22 23:46       ` Leo
2007-01-24  0:17         ` Kim F. Storm
2007-01-24  4:06           ` Leo
2007-01-29 16:50     ` ido-dired is not activated in ffap (was: find-alternate-file default filename annoyance) Leo
2007-01-30 22:38       ` Kim F. Storm
2007-01-30 23:04         ` Leo

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