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 14:11:32 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <5bel1518cr.fsf@lister.roxen.com> References: <5bhe6119sc.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 1057407204 14186 80.91.224.249 (5 Jul 2003 12:13:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 5 Jul 2003 12:13:24 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat Jul 05 14:13:22 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 19Ylus-0003gc-00 for ; Sat, 05 Jul 2003 14:13:22 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19Ym3k-0004Lt-00 for ; Sat, 05 Jul 2003 14:22:32 +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 19YluZ-0002fy-PV for emacs-devel@quimby.gnus.org; Sat, 05 Jul 2003 08:13:03 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19YluH-0002fl-Gc for emacs-devel@gnu.org; Sat, 05 Jul 2003 08:12:45 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19Yltk-0002QK-U5 for emacs-devel@gnu.org; Sat, 05 Jul 2003 08:12:13 -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 19YltD-0002Hb-CZ; Sat, 05 Jul 2003 08:11:39 -0400 Original-Received: by mail.roxen.com (Postfix, from userid 52) id 83F899A01; Sat, 5 Jul 2003 14:11:31 +0200 (MEST) Original-Received: from lister.roxen.com (lister.roxen.com [194.52.182.147]) by mail.roxen.com (Postfix) with ESMTP id 8990C99FF; Sat, 5 Jul 2003 14:11:29 +0200 (MEST) Original-Received: from mast by lister.roxen.com with local (Exim 3.36 #1 (Debian)) id 19Ylt7-0002Bt-00; Sat, 05 Jul 2003 14:11:33 +0200 Original-To: David Ponce In-Reply-To: <5bhe6119sc.fsf@lister.roxen.com> (Martin Stjernholm's message of "Sat, 05 Jul 2003 13:40:35 +0200") User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/20.7 (gnu/linux) Original-cc: bug-cc-mode@gnu.org 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:15384 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15384 > From: David Ponce > Subject: Re: CC Mode 5.30 > To: mast@lysator.liu.se > Cc: emacs-devel@gnu.org > Date: Sat Jul 5 12:18:42 2003 +0200 > > Hi, > > > > /.../ One possibility is the problem is specific to my platform. I > > > am building emacs with MSVC++ 6.0 and running on windoze 2K. This > > > system may fail to distinguish ".c" from ".C". /.../ /.../ > That is definitively the case, when system-type is windows-nt (or > cygwin), Emacs can't distinguish ".c" from ".C". 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).