unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Cc: emacs-pretest-bug@gnu.org
Subject: RE: Sorting of directories in dired
Date: Thu, 7 Jul 2005 13:35:53 -0700	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICGEGKCKAA.drew.adams@oracle.com> (raw)
In-Reply-To: <ufyuqnx2o.fsf@gnu.org>

    > I've been doing the same thing Juanma does (code above). But
    I wonder if
    > there isn't a bug in `ls-lisp.el'. Notice the commented-out line in
    > `ls-lisp-emulation' (below). Commenting it out does not make
    sense in light
    > of the code of `ls-ignore-case', `ls-lisp-dirs-first', and
    > `ls-lisp-verbosity', together with the fact that `ls-lisp.el'
    is preloaded.

    It does make sense: we don't want those options to have non-nil
    values, we want ls-lisp to produce the same results as with a real
    `ls' program.

    One problem with making the Windows-like behavior the default is that
    if one has a ported ls.exe and uses it to produce Dired buffers, the
    order will be different.  Such inconsistency is bad.

I probably didn't make myself clear. My point was that those other user
options are defined using defcustom in such a way that their values depend
on the current value of `ls-lisp-emulation' - current when the library is
loaded.

As the library is preloaded, there is no way for a user to change the values
of the others by simply changing the value of `ls-lisp-emulation'. The
defcustoms test a value that is, effectively, hard-wired - they might as
well have their values (for Windows) hard-wired as well. The seeming
dependencies are useless - unless I'm missing something.

    > The latter options should not bother to test `ls-lisp-emulation'. They
    > appear dependent on `ls-lisp-emulation', but if that is set
    by a user, it
    > will be set _after_ all of these preloaded defcustoms, so the
    user will in
    > any case be obliged to set each of these options, not just
    > `ls-lisp-emulation'.

    Not true: the user could load ls-lisp from .emacs and then customize
    the options, including ls-lisp-emulation.

In my Windows binary, at least, ls-lisp.el is preloaded. That's the problem.
It does no good for a user to load the library again, since the defcustoms
will then have no effect on the values.

Yes, the user can customize any and all of these, of course. But there is no
effective dependence between them, as the code might lead you (that is, me)
to believe.

    > I would like to see the commented line uncommented again, so
    that these
    > variables all do what they were originally desiged to do for Windows.

    If that line is uncommented, preloading will cause ls-lisp to produce
    Windows-like order

Yes, on Windows (only). And it will get rid of columns that make no sense on
Windows. It will produce a (default) listing like this:

  c:/foo:
  total used in directory 6363 available 16669536
  drwxrwxrwx   1        0 2004-01-15  .
  drwxrwxrwx   1        0 1969-12-31  ..
  drwxrwxrwx   1        0 2004-01-15  bin
  drwxrwxrwx   1        0 2004-01-15  TEST
  -rw-rw-rw-   1    59248 07-04 09:12 bar.el
  -rw-rw-rw-   1    28120 07-04 09:12 bar.elc
  -rw-rw-rw-   1    59268 05-25 17:11 bar.el~
  -rw-rw-rw-   1     2104 07-04 12:37 toto.el
  -rw-rw-rw-   1      853 07-04 12:43 toto.elc

Otherwise, the listing shows something like this:

  c:/drews-lisp-20:
  total used in directory 6363 available 16669504
  drwxrwxrwx   1 dradams  root            0 2004-01-15  .
  drwxrwxrwx   1 dradams  root            0 1969-12-31  ..
  drwxrwxrwx   1 dradams  root            0 2004-01-15  TEST
  drwxrwxrwx   1 dradams  root            0 2004-01-15  bin
  -rw-rw-rw-   1 dradams  root        59248 07-04 09:12 bar.el
  -rw-rw-rw-   1 dradams  root        28120 07-04 09:12 bar.elc
  -rw-rw-rw-   1 dradams  root        59268 05-25 17:11 bar.el~
  -rw-rw-rw-   1 dradams  root         2104 07-04 12:37 toto.el
  -rw-rw-rw-   1 dradams  root          853 07-04 12:43 toto.elc

IOW, aside from putting directories first and not being case-sensitive, the
Windows listing also throws out the uid and gid, which don't mean a lot for
Windows. That saves a lot of real-estate and makes the listing clearer.

    something that we decided not to do.

Right. I can live with that decision.

I'm only pointing out that the defcustom code is a bit silly, wrt Windows.
Might as well hard-wire the values for all of these variables (on Windows),
whatever values you decide upon. Might as well, because the seeming
dependence is illusory, because of the preloading.

    > People, such as Edward, who want "consistent" behavior across
    platforms
    > (e.g. showing columns that make no sense outside of Unix),
    could always
    > change the option values, but the default values should make
    sense for each
    > platform.

    That's not the Emacs philosophy, AFAIK.  Consistent behavior across
    platforms is deemed more important than consistency with other
    platform-specific applications.

OK. But then why does the code in question attempt to modify the behavior
for different platforms? You can't have it both ways, can you?

    > On Windows, it makes sense to show directories first, ignore case
    > differences, and get rid of columns that make no sense.

    The order used by Windows tools is IMHO stupid and user-unfriendly: it
    assumes, for some reason, that people do not look up directories and
    files together.

Fine. It's stupid and user-unfriendly. And it's what people are used to.

Anyway, I have no problem with us choosing the default behavior you want
(it's not what I would prefer, but I can live with it). My point regards the
defcustom definitions.

  reply	other threads:[~2005-07-07 20:35 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-06 23:58 Sorting of directories in dired Lennart Borgman
2005-07-07  0:13 ` Juanma Barranquero
2005-07-07  6:49   ` Lennart Borgman
2005-07-07  8:02     ` Juanma Barranquero
2005-07-07  8:28       ` Edward O'Connor
2005-07-07 10:11         ` Juanma Barranquero
2005-07-07 12:24           ` David Kastrup
2005-07-07 10:53         ` theming (was: Sorting of directories in dired) John S. Yates, Jr.
2005-07-07 12:17           ` theming Lennart Borgman
2005-07-07 13:31             ` theming Juanma Barranquero
2005-07-07 13:50               ` theming Lennart Borgman
2005-07-07 14:00                 ` theming Juanma Barranquero
2005-07-07 14:24                   ` theming Lennart Borgman
2005-07-07 17:36               ` theming Drew Adams
2005-07-08  4:36               ` theming Richard M. Stallman
2005-07-08 11:05             ` theming John S. Yates, Jr.
2005-07-07 12:22           ` theming (was: Sorting of directories in dired) David Reitter
2005-07-07 14:20             ` theming David Kastrup
2005-07-08 12:38               ` theming David Reitter
2005-07-08 14:27                 ` theming Stefan Monnier
2005-07-08 22:01                   ` theming Richard M. Stallman
     [not found]             ` <m1DqbHY-0004RAC@rattlesnake.com>
2005-07-07 18:59               ` theming (was: Sorting of directories in dired) David Reitter
2005-07-07 19:11             ` David Reitter
2005-07-10  5:19             ` Richard M. Stallman
2005-07-10  5:19           ` Richard M. Stallman
2005-07-07 20:37         ` Sorting of directories in dired Eli Zaretskii
2005-07-08  1:12         ` Bill Wohler
2005-07-07 16:43     ` Drew Adams
2005-07-07 21:08       ` Eli Zaretskii
2005-07-07 20:35         ` Drew Adams [this message]
2005-07-07 22:41           ` Eli Zaretskii
2005-07-07 22:53             ` Drew Adams
2005-07-08 10:58               ` Eli Zaretskii
2005-07-08 17:40             ` Richard M. Stallman
  -- strict thread matches above, loose matches on Subject: below --
2005-07-07  9:55 LENNART BORGMAN
2005-07-07 16:32 ` Edward O'Connor
2005-07-08 20:59   ` Johan Bockgård
2005-07-07 17:56 ` Alex Schroeder
2005-07-07 20:38 ` Eli Zaretskii
2005-07-07 19:53   ` Lennart Borgman
2005-07-07 21:21     ` Eli Zaretskii
2005-07-07 20:44       ` Lennart Borgman
2005-07-07 22:43         ` Eli Zaretskii
2005-07-07 22:06           ` Lennart Borgman
2005-07-08 10:28             ` Eli Zaretskii
2005-07-07 20:00   ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DNEMKBNJBGPAOPIJOOICGEGKCKAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-pretest-bug@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).