From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Ponce Newsgroups: gmane.emacs.devel Subject: Re: CC Mode 5.30 Date: Sat, 05 Jul 2003 12:18:42 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <3F06A602.80508@wanadoo.fr> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1057400289 26986 80.91.224.249 (5 Jul 2003 10:18:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 5 Jul 2003 10:18:09 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat Jul 05 12:18:07 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 19Yk7L-00070z-00 for ; Sat, 05 Jul 2003 12:18:07 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19YkGB-0003F7-00 for ; Sat, 05 Jul 2003 12:27:15 +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 19Yk7S-0003Db-Kp for emacs-devel@quimby.gnus.org; Sat, 05 Jul 2003 06:18:14 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19Yk6S-0002TX-Je for emacs-devel@gnu.org; Sat, 05 Jul 2003 06:17:12 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19Yk64-0001EV-It for emacs-devel@gnu.org; Sat, 05 Jul 2003 06:16:50 -0400 Original-Received: from smtp6.wanadoo.fr ([193.252.22.28] helo=mwinf0301.wanadoo.fr) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Yk5z-0000rb-Jl for emacs-devel@gnu.org; Sat, 05 Jul 2003 06:16:43 -0400 Original-Received: from wanadoo.fr (AGrenoble-102-1-6-210.w81-50.abo.wanadoo.fr [81.50.22.210]) by mwinf0301.wanadoo.fr (SMTP Server) with ESMTP id 9E2164007AF; Sat, 5 Jul 2003 12:16:41 +0200 (CEST) User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.5a) Gecko/20030704 X-Accept-Language: en-us, en Original-To: mast@lysator.liu.se 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:15383 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15383 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's a possible cause. Could you please try to move the entry > > ("\\.\\(CC?\\|HH?\\)\\'" . c++-mode) > > in auto-mode-alist to the bottom of it and see if it helps? > > If it does, I'll rearrange the autoload directives so that ".c" is > tested before ".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) .... I use the following hack in my startup file, that fixes the problem: (when (eq system-type 'windows-nt) ;; File system is case insensitive. Ensure that .C or .H will not ;; open in `c++-mode'. Reorder `auto-mode-alist' so `c-mode' ;; regexps will be matched before `c++-mode' ones. (let* (aml cml) (dolist (elt auto-mode-alist) (if (eq 'c-mode (cdr elt)) (push elt cml) (push elt aml))) (setq auto-mode-alist (nreverse (nconc aml cml)))) ) Hope it helps. Sincerely, David