From: Romain FRANCOISE <romain@orebokech.com>
Subject: Fontification of calendar breaks localization
Date: Tue, 26 Nov 2002 17:35:20 +0100 [thread overview]
Message-ID: <87wun047cn.fsf@orebokech.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1385 bytes --]
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 <romain@orebokech.com> | 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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fontification fix --]
[-- Type: text/x-patch, Size: 958 bytes --]
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)
"\\|"
next reply other threads:[~2002-11-26 16:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-26 16:35 Romain FRANCOISE [this message]
2002-11-26 17:33 ` Fontification of calendar breaks localization Alan Shutko
2002-11-26 22:46 ` Stefan Monnier
2002-11-26 23:14 ` Romain FRANCOISE
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wun047cn.fsf@orebokech.com \
--to=romain@orebokech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).