From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.pretest.bugs,gmane.emacs.devel Subject: RE: Sorting of directories in dired Date: Thu, 7 Jul 2005 09:43:59 -0700 Message-ID: References: <42CCD07F.5010509@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1120755229 29827 80.91.229.2 (7 Jul 2005 16:53:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Jul 2005 16:53:49 +0000 (UTC) Cc: Emacs-Pretest-Bug Original-X-From: emacs-pretest-bug-bounces+gebp-emacs-pretest-bug=gmane.org@gnu.org Thu Jul 07 18:53:41 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DqZcP-0007L9-O1 for gebp-emacs-pretest-bug@gmane.org; Thu, 07 Jul 2005 18:52:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DqZdm-00074F-99 for gebp-emacs-pretest-bug@gmane.org; Thu, 07 Jul 2005 12:54:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DqZaJ-0005xS-3C for emacs-pretest-bug@gnu.org; Thu, 07 Jul 2005 12:50:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DqZYg-0005Pl-M2 for emacs-pretest-bug@gnu.org; Thu, 07 Jul 2005 12:49:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DqZYO-0005Gb-2z; Thu, 07 Jul 2005 12:48:49 -0400 Original-Received: from [148.87.122.33] (helo=rgminet04.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DqZaI-0004sF-7j; Thu, 07 Jul 2005 12:50:46 -0400 Original-Received: from rgminet04.oracle.com (localhost [127.0.0.1]) by rgminet04.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id j67Gi1Xj029798; Thu, 7 Jul 2005 10:44:01 -0600 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by rgminet04.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id j67Gi0mB029780; Thu, 7 Jul 2005 10:44:00 -0600 Original-Received: from rgmsgw300.us.oracle.com (localhost [127.0.0.1]) by rgmsgw300.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id j67Ghxfb007688; Thu, 7 Jul 2005 10:43:59 -0600 Original-Received: from dradamslap (dradams-lap.us.oracle.com [130.35.177.126]) by rgmsgw300.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with SMTP id j67Ghx6S007681 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Thu, 7 Jul 2005 10:43:59 -0600 Original-To: "Emacs Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <42CCD07F.5010509@student.lu.se> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-BeenThere: emacs-pretest-bug@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: emacs-pretest-bug.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-pretest-bug-bounces+gebp-emacs-pretest-bug=gmane.org@gnu.org Errors-To: emacs-pretest-bug-bounces+gebp-emacs-pretest-bug=gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.pretest.bugs:8352 gmane.emacs.devel:40568 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40568 >>In dired files are sorted case sensitive. This does not make sense on an >>OS with case insensitive file system. Is there any way to get the >>listing in dired sorted case insensitive? > >If you're on Windows, dired is using the Lisp emulation of `ls', that >is, ls-lisp.el. You can configure it to be case insensitive. My .emacs >has this: > >(when (eq system-type 'windows-nt) > (setq ls-lisp-emulation 'MS-Windows > ls-lisp-dirs-first t > ls-lisp-ignore-case t > ls-lisp-verbosity (nconc (and (w32-using-nt) > '(links)) '(uid)))) 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. 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'. IOW, the dependency code doesn't work. --- (defcustom ls-lisp-emulation (cond ((eq system-type 'macos) 'MacOS) ;; ((eq system-type 'windows-nt) 'MS-Windows) ((memq system-type '(hpux dgux usg-unix-v unisoft-unix rtu irix berkeley-unix)) 'UNIX)) ; very similar to GNU ;; Anything else defaults to nil, meaning GNU. "*Platform to emulate: GNU (default), MacOS, MS-Windows, UNIX. Corresponding value is one of the atoms: nil, MacOS, MS-Windows, UNIX. Sets default values for: `ls-lisp-ignore-case', `ls-lisp-dirs-first', `ls-lisp-verbosity'. Need not match actual platform. Changing this option will have no effect until you restart Emacs." :type '(choice (const :tag "GNU" nil) (const MacOS) (const MS-Windows) (const UNIX)) :group 'ls-lisp) (defcustom ls-lisp-ignore-case ;; Name change for consistency with other option names. (or (memq ls-lisp-emulation '(MS-Windows MacOS)) (and (boundp 'ls-lisp-dired-ignore-case) ls-lisp-dired-ignore-case)) "*Non-nil causes ls-lisp alphabetic sorting to ignore case." :type 'boolean :group 'ls-lisp) (defcustom ls-lisp-dirs-first (eq ls-lisp-emulation 'MS-Windows) "*Non-nil causes ls-lisp to sort directories first in any ordering. \(Or last if it is reversed.) Follows Microsoft Windows Explorer." ;; Functionality suggested by Chris McMahan :type 'boolean :group 'ls-lisp) (defcustom ls-lisp-verbosity (cond ((eq ls-lisp-emulation 'MacOS) nil) ((eq ls-lisp-emulation 'MS-Windows) (if (and (fboundp 'w32-using-nt) (w32-using-nt)) '(links))) ; distinguish NT/2K from 9x ((eq ls-lisp-emulation 'UNIX) '(links uid)) ; UNIX ls (t '(links uid gid))) ; GNU ls "*A list of optional file attributes that ls-lisp should display. It should contain none or more of the symbols: links, uid, gid. nil (or an empty list) means display none of them. Concepts come from UNIX: `links' means count of names associated with the file\; `uid' means user (owner) identifier\; `gid' means group identifier. If emulation is MacOS then default is nil\; if emulation is MS-Windows then default is `(links)' if platform is Windows NT/2K, nil otherwise\; if emulation is UNIX then default is `(links uid)'\; if emulation is GNU then default is `(links uid gid)'." ;; Functionality suggested by Howard Melman :type '(set (const :tag "Show Link Count" links) (const :tag "Show User" uid) (const :tag "Show Group" gid)) :group 'ls-lisp) --- I suspect that what happened was that the code originally made sense (i.e. was consistent) with the line uncommented (and it would have made Lennart and me happy), but someone then decided that this should not be the behavior for Windows. Instead of removing or commenting-out the corresponding (i.e. dependent) code everywhere, which would have at least been consistent, only the Windows line in `ls-lisp-emulation' was commented out. 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. 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. This is especially important for novices. On Windows, it makes sense to show directories first, ignore case differences, and get rid of columns that make no sense.