unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ido-show-dot-for-dired
@ 2012-02-04 22:05 Christoph Scholtes
  2012-02-05  8:28 ` ido-show-dot-for-dired Leo
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Scholtes @ 2012-02-04 22:05 UTC (permalink / raw)
  To: Emacs-Devel devel

Is there a reason why ido-show-dot-for-dired only has an effect in file 
name lists and not dir name lists?

I.e. (setq ido-show-dot-for-dired nil) will not show the dot in file 
name lists, but it will in dir name lists always, e.g. with C-x d. I 
think it's annoying to have the dot in the dir list and have to do C-s 
when I could just hit Enter to get to the only other subdirectory.

So, I am proposing to extend ido-show-dot-for-dired to include the 
directory lists. Setting ido-show-dot-for-dired to nil would disable the 
. in file and directory lists or enable it in both with non-nil.

Unless somebody comes up with a reason why you would want it in one and 
not the other, this patch would accomplish it:

=== modified file 'lisp/ido.el'
--- lisp/ido.el	2012-02-04 00:59:58 +0000
+++ lisp/ido.el	2012-02-04 21:20:47 +0000
@@ -3643,9 +3643,10 @@
  		(delete default ido-temp-list))
  	  (setq ido-temp-list
  		(cons default ido-temp-list))))
-    (setq ido-temp-list (delete "." ido-temp-list))
-    (unless ido-input-stack
-      (setq ido-temp-list (cons "." ido-temp-list)))
+    (when ido-show-dot-for-dired
+      (setq ido-temp-list (delete "." ido-temp-list))
+      (unless ido-input-stack
+        (setq ido-temp-list (cons "." ido-temp-list))))
      (run-hooks 'ido-make-dir-list-hook)
      ido-temp-list))

@@ -4727,6 +4728,8 @@
  	 (ido-directory-too-big (and (not ido-directory-nonreadable)
  				     (ido-directory-too-big-p ido-current-directory)))
  	 (ido-work-directory-index -1)
+         (ido-show-dot-for-dired (and ido-show-dot-for-dired
+                                      (not default-dirname)))
  	 (ido-work-file-index -1))
      (setq filename
  	  (ido-read-internal 'dir prompt 'ido-file-history default-dirname 
mustmatch initial))


WDYT?

Christoph



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

* Re: ido-show-dot-for-dired
  2012-02-04 22:05 ido-show-dot-for-dired Christoph Scholtes
@ 2012-02-05  8:28 ` Leo
  2012-02-05 19:38   ` ido-show-dot-for-dired Christoph Scholtes
  0 siblings, 1 reply; 6+ messages in thread
From: Leo @ 2012-02-05  8:28 UTC (permalink / raw)
  To: emacs-devel

On 2012-02-05 06:05 +0800, Christoph Scholtes wrote:
> So, I am proposing to extend ido-show-dot-for-dired to include the 
> directory lists. Setting ido-show-dot-for-dired to nil would disable the 
> . in file and directory lists or enable it in both with non-nil.

I am not sure.

The current behaviour is quite handy to open current default-directory
i.e. C-x d RET and you are done.

Leo




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

* Re: ido-show-dot-for-dired
  2012-02-05  8:28 ` ido-show-dot-for-dired Leo
@ 2012-02-05 19:38   ` Christoph Scholtes
  2012-02-06  3:51     ` ido-show-dot-for-dired Leo
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Scholtes @ 2012-02-05 19:38 UTC (permalink / raw)
  To: Leo; +Cc: emacs-devel

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

> The current behaviour is quite handy to open current default-directory
> i.e. C-x d RET and you are done.

Right, but do we need the dot for that?

I guess this is somewhat related to my bug report #10731
(http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10731).

There the argument is that the head of the list is not selected because
that is consistent with the buffer selection dialog. I can agree with
that. Enter and C-j should not have the same effect. 

However, isn't the dot in case of the C-x d dialog the head of the list?
If the dot wasn't there, C-j could still send you to the current default
directory, which would be consistent with the behavior you described in
the bug report. Whereas now with the dot, C-j and Enter _have_ the same
effect. They both select the current default-directory.

If I _dont't_ want to select the current directory but move down a
hierarchy of directories which all contain a single subdirectory I
always need a C-s to select the subdirectory (and not the dot) and then
press Enter. Without the dot I can just press Enter, Enter, Enter
etc. and if I want to open dired at any point I press C-j.

Christoph



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

* Re: ido-show-dot-for-dired
  2012-02-05 19:38   ` ido-show-dot-for-dired Christoph Scholtes
@ 2012-02-06  3:51     ` Leo
  2012-02-06  4:13       ` ido-show-dot-for-dired Christoph Scholtes
  0 siblings, 1 reply; 6+ messages in thread
From: Leo @ 2012-02-06  3:51 UTC (permalink / raw)
  To: emacs-devel

On 2012-02-06 03:38 +0800, Christoph Scholtes wrote:
> However, isn't the dot in case of the C-x d dialog the head of the list?
> If the dot wasn't there, C-j could still send you to the current default
> directory, which would be consistent with the behavior you described in
> the bug report. Whereas now with the dot, C-j and Enter _have_ the same
> effect. They both select the current default-directory.

The effect is the same but they are different. If "." were not there,
ENTER can not open the current directory. Another concern is C-j is a
bit less friendly towards new users.

But your proposal is slightly better for experienced ido users. Maybe we
could make the change you proposed and then advertise C-j more, after
all that is one of the keys users must understand. What do you think?

Leo




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

* Re: ido-show-dot-for-dired
  2012-02-06  3:51     ` ido-show-dot-for-dired Leo
@ 2012-02-06  4:13       ` Christoph Scholtes
  2012-02-06  6:45         ` ido-show-dot-for-dired Leo
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Scholtes @ 2012-02-06  4:13 UTC (permalink / raw)
  To: Leo; +Cc: emacs-devel

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

> On 2012-02-06 03:38 +0800, Christoph Scholtes wrote:
>> However, isn't the dot in case of the C-x d dialog the head of the list?
>> If the dot wasn't there, C-j could still send you to the current default
>> directory, which would be consistent with the behavior you described in
>> the bug report. Whereas now with the dot, C-j and Enter _have_ the same
>> effect. They both select the current default-directory.
>
> The effect is the same but they are different. If "." were not there,
> ENTER can not open the current directory. Another concern is C-j is a
> bit less friendly towards new users.

I see your point. Maybe I am just so used to using C-j for this. I can
see how RET is definitely easier for new users.

> But your proposal is slightly better for experienced ido users. Maybe we
> could make the change you proposed and then advertise C-j more, after
> all that is one of the keys users must understand. What do you think?

I personally would like the option to turn the dot off for directory
lists also. The only other question would be whether one would want the
flexibility of having the option ido-show-dot-for-dired in file lists
(as it is now) _and_ directory lists separately or whether we can tie
them together with one option.

How would you advertise the use of C-j? Via manual?

Christoph



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

* Re: ido-show-dot-for-dired
  2012-02-06  4:13       ` ido-show-dot-for-dired Christoph Scholtes
@ 2012-02-06  6:45         ` Leo
  0 siblings, 0 replies; 6+ messages in thread
From: Leo @ 2012-02-06  6:45 UTC (permalink / raw)
  To: emacs-devel

On 2012-02-06 12:13 +0800, Christoph Scholtes wrote:
> I personally would like the option to turn the dot off for directory
> lists also. The only other question would be whether one would want the
> flexibility of having the option ido-show-dot-for-dired in file lists
> (as it is now) _and_ directory lists separately or whether we can tie
> them together with one option.

It is harmless to add such an option.

> How would you advertise the use of C-j? Via manual?

Maybe we can create a manual for ido based on the Commentary section in
ido.el.

Leo




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

end of thread, other threads:[~2012-02-06  6:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-04 22:05 ido-show-dot-for-dired Christoph Scholtes
2012-02-05  8:28 ` ido-show-dot-for-dired Leo
2012-02-05 19:38   ` ido-show-dot-for-dired Christoph Scholtes
2012-02-06  3:51     ` ido-show-dot-for-dired Leo
2012-02-06  4:13       ` ido-show-dot-for-dired Christoph Scholtes
2012-02-06  6:45         ` ido-show-dot-for-dired 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).