From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Romain FRANCOISE Newsgroups: gmane.emacs.devel Subject: Fontification of calendar breaks localization Date: Tue, 26 Nov 2002 17:35:20 +0100 Organization: orebokech dot com Sender: emacs-devel-admin@gnu.org Message-ID: <87wun047cn.fsf@orebokech.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1038329615 27426 80.91.224.249 (26 Nov 2002 16:53:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 26 Nov 2002 16:53:35 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18GijK-00068B-00 for ; Tue, 26 Nov 2002 17:38:34 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18GipW-0002CR-00 for ; Tue, 26 Nov 2002 17:44:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18Gii7-0001In-00; Tue, 26 Nov 2002 11:37:19 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18GihB-00011z-00 for emacs-devel@gnu.org; Tue, 26 Nov 2002 11:36:21 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18Gih7-00010T-00 for emacs-devel@gnu.org; Tue, 26 Nov 2002 11:36:19 -0500 Original-Received: from cismrelais.univ-lyon1.fr ([134.214.101.250]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18Gih6-00010D-00 for emacs-devel@gnu.org; Tue, 26 Nov 2002 11:36:17 -0500 Original-Received: from cismrelais (localhost [127.0.0.1]) by cismrelais.univ-lyon1.fr (Postfix) with ESMTP id 9668DB4FF2; Tue, 26 Nov 2002 17:36:15 +0100 (CET) Original-Received: from yeast (J446-b.resJ.insa-lyon.fr [134.214.166.176]) by cismrelais.univ-lyon1.fr (Postfix) with ESMTP id 8B062B59C5; Tue, 26 Nov 2002 17:36:14 +0100 (CET) Original-Received: from swift (swift [192.168.1.6]) by yeast (Postfix) with ESMTP id 9F38B132BE; Tue, 26 Nov 2002 17:35:37 +0100 (CET) Original-Received: by swift (Postfix, from userid 1000) id 6484C18086; Tue, 26 Nov 2002 17:35:20 +0100 (CET) Original-To: emacs-devel@gnu.org Mail-Copies-To: nobody User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) X-Virus-Scanned: by AMaViS snapshot-20020222 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:9689 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9689 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi, recently a patch by Alan Shutko which allows fontification of the Calendar and Diary buffers was applied to the trunk. It is a very nice feature, however it breaks when you're using a "localized" Calendar; that is if you have changed the month and day names to reflect your language's. For instance in my case (in French), I have: (setq calendar-day-name-array ["Dimanche" "Lundi" "Mardi" "Mercredi" "Jeudi" "Vendredi" "Samedi"] calendar-month-name-array ["Janvier" "Février" "Mars" "Avril" "Mai" "Juin" "Juillet" "Août" "Septembre" "Octobre" "Novembre" "Décembre"]) so that the Diary and Calendar are displayed in French. Alan's patch uses a regular expression to recognize month names and fontify them, this regular expression does not match with accentuated characters, so some month names get fontified and others don't. I have written a quick fix that builds the regular expression using the names defined in `calendar-month-name-array' so that it always accurately matches month names. It is in the attached patch (against the current CVS). What do you think? Romain. -- Romain FRANCOISE | You know that old saying, it's a miracle -- http://orebokech.com/ | that you always hurt the ones | you love? Well it works both | ways. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=cal-font-lock.patch Content-Description: fontification fix Index: lisp/calendar/calendar.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/calendar/calendar.el,v retrieving revision 1.142 diff -c -r1.142 calendar.el *** lisp/calendar/calendar.el 16 Nov 2002 19:18:57 -0000 1.142 --- lisp/calendar/calendar.el 26 Nov 2002 15:44:13 -0000 *************** *** 2477,2483 **** (defvar calendar-font-lock-keywords (list ! '("[A-Z][a-z]+ -?[0-9]+" . font-lock-function-name-face) ; month and year (cons (concat (substring (aref calendar-day-name-array 6) 0 2) "\\|" --- 2477,2488 ---- (defvar calendar-font-lock-keywords (list ! (cons ! (mapconcat 'identity ! (mapcar '(lambda (x) (concat x " -?[0-9]+")) ! calendar-month-name-array) ! "\\|") ! 'font-lock-function-name-face) (cons (concat (substring (aref calendar-day-name-array 6) 0 2) "\\|" --=-=-=--