emacs-devel
[Top][All Lists]
Advanced

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

RE: patch for Dired second header line info


From: Drew Adams
Subject: RE: patch for Dired second header line info
Date: Sun, 2 Mar 2008 08:27:36 -0800

> >> Are you sure this change will not break other packages that
> >> rely on the first word `total' at the beginning of a dired
> >> buffer?
> >
> > How could I (or anyone) be sure of that? Who knows what 
> > some package might rely on?
> 
> Using one of several code search engines, for instance,
> http://www.krugle.org/kse/files?query=%22total+used%22&lang=elisp
> you can find a few packages that rely on the format of this string,
> including your ls-lisp+.el 
> http://www.emacswiki.org/cgi-bin/wiki/ls-lisp%2B.el.

1. It was a rhetorical question. 

The right way is to use a function or variable, and external packages can
then adapt. Avoiding hard-coding would also facilitate translation and other
transformations. If there are libraries today that depend on "total" at the
beginning of the line, it is because they have no choice.

2. My package ls-lisp+.el is 1/2 of the patch I sent. The other half is in
files+.el. 

IOW, ls-lisp+.el is not an example of an existing package that will be
broken by my patch - it _is_ my patch. (These libraries let users of older
Emacs users also have the new feature.)

> >> Also I think instead of displaying the number of files listed
> >> in the current dired buffer, more useful would be to display
> >> the total number of files in the current directory. There are
> >> features that hide files in the dired buffer (e.g.
> >> dired-omit-mode), so displaying the total number of
> >> files will be helpful for users to see that there are more
> >> hidden files.
> >
> > I disagree - it's a feature, not a bug, to see how many 
> > files are currently visible.
> >
> > For example, if I use Dired with wildcards, I want to see 
> > how many matching files there are. If I hide the files with
> > extension `elc', I want to see how many files are left.
> > And so on. The figure should reflect the current
> > display state.
> 
> Sorry, it didn't appear to me that the number of listed files would be
> useful too.  But we can display both numbers on the same line 
> using the traditional notation "listed/total", e.g.
> 
> total used in directory 49439 available 56233408 files 691/1000

Good idea. Go for it. And perhaps that will obviate the need for `files
listed' instead of `files'.

I still prefer the order I suggested, and shortening and clarifying `total
used in directory' to `space used' or `kbytes used'.

> > BTW, I did not check until now, but that is also apparently 
> > the approach Windows Explorer uses (FWIW). If you hide system
> > files, for instance, the file count excludes them.
> 
> BTW, such file managers also display the number and total 
> size of selected files.

Yes. I agree that `files 691/1000' is preferable.

BTW, if the meanings of `space used' and `available' were comparable, we
could do the same thing there. But one is presumably the space used in the
directory, and the other is presumably the space available on the disk, so
two labels are needed in that case.

> I have a function `dired-count-marked-files' that 
> does the same and displays this information in the echo area
> after marking a file.
> 
> Maybe instead of the echo area and instead of the header line 
> beginning with `total' we could display this information in the
> mode line?

That was in fact the starting point for my patch: a help-gnu-emacs question
was answered by a post from Kevin Rodgers that used the mode line that way.

I specifically want to avoid putting such stuff in the mode line -
especially in the minor-mode lighter list. The lighter list has a specific
meaning that should not be muddied, and the list is already busy enough. I
typically have 3 or 4 minor modes active at the same time. 

It's true that we already do that kind of thing in some modes (e.g. `grep'),
but I think it's bad practice in general and should not be expanded. And
this file/space info is not as important as the info we put in the `grep'
lighter. A temporary indication of something can sometimes be appropriate in
a lighter area, but we shouldn't turn lighters into essays or status lines.

Would you also add the space used/available to the Dired lighter? And would
you list the used/available figures for every inserted subdir in the mode
line? This is a bad idea, IMO.

So no, I disagree that the mode line is a good place to put this info.

> There is a special mode-line symbol %i and %I (`size-indication-mode')
> that is not very useful in dired mode.  We could use it (or 
> create a new %-construct) to display the total number of selected/all 
> files and their sizes in the mode line in more concise format.

I vote against it. Just one vote.






reply via email to

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