From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Martin Stjernholm Newsgroups: gmane.emacs.devel Subject: Re: [David Ponce ] Re: CC Mode 5.30 Date: Sat, 05 Jul 2003 22:10:36 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <5bznjsenur.fsf@lister.roxen.com> References: <5bhe6119sc.fsf@lister.roxen.com> <5bel1518cr.fsf@lister.roxen.com> Reply-To: bug-cc-mode@gnu.org NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1057435896 9550 80.91.224.249 (5 Jul 2003 20:11:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 5 Jul 2003 20:11:36 +0000 (UTC) Cc: bug-cc-mode@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat Jul 05 22:11:33 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19YtNd-0002Th-00 for ; Sat, 05 Jul 2003 22:11:33 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19YtWf-0000OH-00 for ; Sat, 05 Jul 2003 22:20:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19YtNJ-0000Qt-0T for emacs-devel@quimby.gnus.org; Sat, 05 Jul 2003 16:11:13 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19YtMs-0000LM-Cx for emacs-devel@gnu.org; Sat, 05 Jul 2003 16:10:46 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19YtMr-0000L9-0Y for emacs-devel@gnu.org; Sat, 05 Jul 2003 16:10:45 -0400 Original-Received: from godzilla.roxen.com ([194.52.182.190] helo=mail.roxen.com) by monty-python.gnu.org with esmtp (Exim 4.20) id 19YtMp-00008b-F7; Sat, 05 Jul 2003 16:10:43 -0400 Original-Received: by mail.roxen.com (Postfix, from userid 52) id 5185499C6; Sat, 5 Jul 2003 22:10:34 +0200 (MEST) Original-Received: from lister.roxen.com (lister.roxen.com [194.52.182.147]) by mail.roxen.com (Postfix) with ESMTP id 61D7099BD; Sat, 5 Jul 2003 22:10:32 +0200 (MEST) Original-Received: from mast by lister.roxen.com with local (Exim 3.36 #1 (Debian)) id 19YtMi-000394-00; Sat, 05 Jul 2003 22:10:36 +0200 Original-To: emacs-devel@gnu.org In-Reply-To: <5bel1518cr.fsf@lister.roxen.com> (Martin Stjernholm's message of "Sat, 05 Jul 2003 14:11:32 +0200") User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/20.7 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:15392 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15392 Martin Stjernholm wrote: >> From: David Ponce /.../ >> That is definitively the case, when system-type is windows-nt (or >> cygwin), Emacs can't distinguish ".c" from ".C". I've now changed the autoload directives in cc-mode.el so that ".c" comes before ".C" in auto-mode-alist. Still, I think the match method used in `set-auto-mode' should be changed: >> Here is the relevant code in function `set-auto-mode' in files.el, >> that set `case-fold-search' before trying to `string-match' regexps >> in `auto-mode-alist': >> >> (let ((alist auto-mode-alist) >> (mode nil)) >> ;; Find first matching alist entry. >> (let ((case-fold-search >> (memq system-type '(vax-vms windows-nt cygwin)))) >> (while (and (not mode) alist) >> (if (string-match (car (car alist)) name) >> .... > > Wouldn't it be better if it downcased the name and matched it case > sensitively instead? The "normal" case in case sensitive systems is > afaik lowercase, so patterns that are written without special > attention to it use lowercase characters and would match if the name > was simply downcased. > > Also, NT file systems can distinguish between upper and lower case > chars visually, even if it doesn't matter when finding files. Thus it > could be an idea to try to match the name case sensitively first, and > if that fails do another attempt with a downcased name (or with > case-fold-search set).