emacs-devel
[Top][All Lists]
Advanced

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

Re: [David Ponce <address@hidden>] Re: CC Mode 5.30


From: Martin Stjernholm
Subject: Re: [David Ponce <address@hidden>] Re: CC Mode 5.30
Date: Sat, 05 Jul 2003 14:11:32 +0200
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/20.7 (gnu/linux)

> From: David Ponce <address@hidden>
> Subject: Re: CC Mode 5.30
> To: address@hidden
> Cc: address@hidden
> 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).




reply via email to

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